Skip to content

Commit

Permalink
[BP] Fix check for layer already in map (#6031)
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Nov 19, 2021
1 parent 584535f commit 628ff87
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -104,6 +104,13 @@
* @param {string} url of the service
*/
var getTheLayerFromMap = function(map, name, url, style) {

// If style is undefined use empty value to compare with source.getParams().STYLES,
// that returns empty value for the default style.
if (style == undefined) {
style = '';
}

for (var i = 0; i < map.getLayers().getLength(); i++) {
var l = map.getLayers().item(i);
var source = l.getSource();
Expand Down

0 comments on commit 628ff87

Please sign in to comment.