give your URL<input id="url"></input>
give a Layer<input id="layer"></input>
Make map visible <a onclick = layer1();>make visible</a>

Function map () {
        new ol.layer.Tile({
          extent: [-13884991, 2870341, -7455066, 6338219],
          source: new ol.source.TileWMS({
            url: document.getElementById('url').innerHTML,
            params: {'LAYERS': document.getElementById('layer').innerHTML, 
'TILED': true},
            serverType: 'geoserver'
          })
        })
      map.addLayer(map)
}

With the above method i can change url and layer and make the map visible.

When i add a map and change the url and layer again and add the map again then 
i have two different maps visible, but when i use map.removeLayer(map) then 
only the last added map will remove. How can i make this?


-- 
You received this message because you are subscribed to the Google Groups "OL3 
Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ol3-dev+unsubscr...@googlegroups.com.
To post to this group, send email to ol3-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/ol3-dev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ol3-dev/7290c17a-2b8d-4e78-96cf-1d88816c01cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to