Hello. On my website I've implemented some views using IPGV&M+Leaflet+Leaflet_more_maps as format. If under the settings of those views I select a map layer, it works as it should. However I would like to know if it is possible to let the user/visitor choose one of the map layers available, from a menu, checkbutton or anything else.
Thank you
Kinmen

Comments

rdeboer’s picture

Yes, see http://regionbound.com/coffee-prices-across-melbourne, upper right corner, the so-called "Layer switcher".
You determine the maps that are available for selection via the Leaflet More Maps configuration page. You can choose any of the base maps for inclusion in the Layer Switcher.
Rik

kinmen’s picture

Actually the Layer switcher doesn't always appear (not with google for ex., yes with yandex). I didn't understand well if that is used just to switch from a layer to another of the same map provider (road view / satellite / etc) or if you can switch the map provider too, which is what I try to accomplish under a visitor / user point of view.

Under admin/config/system/leaflet_more_maps there are 3 "Custom map #1 layer selection
" forms"; in the first I've flagged all the maps, kept the form empty, reload the view (cleaned the browser's cache) but I still can't see the switcher in the upper corner; if i put the name of the view in that form, still having all the maps flagged, I get the same result: no layer switcher.

Thank you for the help
K.

rdeboer’s picture

StatusFileSize
new155.6 KB
new43.9 KB

Hi K.,
You found the correct configuration page, but are using it incorrectly.

The way it works is you select as many maps as you want (maybe not all of them though) to make available to the end-user from the column of tick boxes under "Custom Map #1 Layer Selection". Then don't forget to fill out a name (anything you like, does not need to be the name of the View) under "Name of custom map #1 in the admin UI". HIt save.

Now you have a new map that can be selected in the Views UI. In the example in the screenshots this map with all its layers is called "RegionBound". Select that from the drop-down in the VIews UI (2nd screenshot) and it will come up with the layer switcher.

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed
kinmen’s picture

Ahhhh... Now I understood! I didn't get that those settings were used to create a kind of "all layers box" to apply over the view instead of selecting a single map provider. Thanks a lot. Regards
Kinmen

rdeboer’s picture

All good!
Rik

rdeboer’s picture

Status: Fixed » Closed (fixed)