Questions tagged [layer-switcher]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
106 views

Adding zoom to extent button to layers displayed in ol-ext LayerSwitcher in OpenLayers?

I need a LayerSwitcher with the possibility of including a "zoom to extent" button for each layer. So, searching I found the example: https://viglino.github.io/ol-ext/examples/control/map....
Andreia Gusmao's user avatar
1 vote
1 answer
112 views

Adding button in LayerSwitcher (Openlayers)?

Got a layerswitcher in OpenLayers (ol-layerswitcher), added to a sidebar. https://raw.githack.com/walkermatt/ol-layerswitcher/master/examples/sidebar.html I would like to add buttons, for example, to &...
Andreia Gusmao's user avatar
1 vote
1 answer
147 views

Toggle Leaflet JS KML layers individually

I'm creating a map with multiple KML layers, and have been able to get the KMLs to appear, however, implementing a simple checkbox to turn each layer on and off is proving to be a problem. I've tried ...
John Spartan's user avatar
0 votes
0 answers
261 views

Layer switcher control and WMS layer control: How to set in which control you want to show the WMS layers in OpenLayers

I'm using the example http://viglino.github.io/ol-ext/examples/layer/map.wmscapabilities.html?lon=2.349572&lat=48.853266&z=16&url=http%3A%2F%2Fgeoservices.brgm.fr%2Fgeologie%3Flanguage%...
user207825's user avatar
1 vote
2 answers
438 views

Showing legend/classified features in OpenLayers from qgis2web?

How can I show legend / classified features in my layer switcher legend in OpenLayers from qgis2web similar to how the Leaflet option exports it? Openlayers shows legend items fine as a single style ...
Mikeoramma's user avatar
1 vote
1 answer
1k views

Clustering markers from GeoJSON after adding data to layer in Leaflet

I am trying to add clusters in my leaflet map. I use overlayMaps which helps to choose one of the active layers, and in that case I want my marker to be a cluster. But it is not clustering. Again ...
Anagd Lamichhane's user avatar
1 vote
1 answer
334 views

How I can update getfeautreinfourl query based on checked layers on ol-layerswitcher(ol-ext)?

I'm using ol-layerswitcher from ol-ext, But I don't know why I can get information from unchecked or removed layers from layer switcher , I am going to popup information that will be able for only ...
Navid's user avatar
  • 849
0 votes
2 answers
2k views

Why ol-layerswitcher latest version can't run in OpenLayers?

I did try load "ol-layerswitcher" in OpenLayers but It didn't work. Furthermore I tried run that through its examples in GitHub but it didn't show anything. Where is my mistake? <!DOCTYPE html> ...
Navid's user avatar
  • 849
1 vote
0 answers
2k views

OpenLayers 6.1.1 add layer to existing layer group in ol-layerswitcher

I have a productive site with OpenLayers 4.6.4 and want to switch to the actual 6.1.1 version. Since there where changes in the code I have to adapt mine to get everything work again. Actually I'm ...
geom's user avatar
  • 1,288
1 vote
1 answer
291 views

OpenLayers - LayerSwitcher MattWalker not working with fetch()

I have a problem with Matt Walker's LayerSwitcher on my map construct. I use fetch () to get a WFS. Unfortunately, the LayerSwitcher does not respond to the vector and nothing is displayed in the ...
oliver.f's user avatar
1 vote
1 answer
938 views

Display leaflet layerswitcher on click event

I would like to click on a sidebar/menu icon, and when I do the layerswitcher Icon should appear. Right now the layerswitcher is always displayed. I know how to make it disappear with the command ...
N.Juul's user avatar
  • 103
1 vote
0 answers
4k views

How to add layer switch/on off layers in OpenLayers [closed]

I have configured a WMS layer into OpenLayers localhost (port 8080), I want to show a layer toggling button which can show only OSM basemap checkbox and my layers. What is code for it how to add this ...
Shanzae's user avatar
  • 11
4 votes
3 answers
5k views

OpenLayers layer-switcher for WMS layers

I have configured a WMS layer for OpenLayers like: var wmsSource = new ol.source.ImageWMS({ url: 'http://<servername>/geoserver/<namespace>/wms', params: {'LAYERS': [ 'Layer 001', '...
Rüdiger Gubler's user avatar
0 votes
1 answer
251 views

One layerswitcher option to open two wms layers

I have two WMS layers Martello_Towers and Martello_Towers_Range. Rather than have two options in Layerswitcher I would like one option to control both layers. They are both in the same projection. I'...
Dakan_GIS's user avatar
2 votes
1 answer
719 views

Update Bootstrap Switch with Leaflet Layer Group

I have this JSFiddle that shows two example layers that can be toggled on and off using the Bootstrap Switch to add and remove them from the map; this works fine. The problem I am having is updating ...
Joshua Dickerson's user avatar
1 vote
1 answer
8k views

Leaflet, customizing the layerswitcher [closed]

So i recently decided to switch my project from Openlayers 3 to Leaflet, mainly because i needed the layer switcher control. I followed the example on the leaflet tutorial, this one to be precise and ...
G90DD's user avatar
  • 323
0 votes
2 answers
644 views

Toggle basemaps with CartoDB.js / CreateLayer

I would like to add a toggle control/switch for basemaps to my code. I tried something similar to this: http://bl.ocks.org/iriberri/08abc420a376053c71d4 but it does not work in combination with ...
schwaebische's user avatar