From 3b83f666c103b43abc8878ecd9bf79d6db97c409 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 13 Apr 2017 05:46:46 -0600 Subject: [PATCH] Add notes about new duplicate layer behavior --- changelog/upgrade-notes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 79eadf1cbf..91ffb6456e 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -2,6 +2,18 @@ ### Next release +#### Adding duplicate layers to a map throws + +Previously, you could do this: +```js +map.addLayer(layer); +map.addLayer(layer); +``` + +However, after adding a duplicate layer, things failed if you tried to remove that layer. + +Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map. + #### Simpler `constrainResolution` configuration The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`