javascript - Add option for Blank TileLayer in Leaflet LayerGroup -
I have a collection of Besemap that I want users to choose:
var Besemap = {// Todo Blank Tile Layer "Default": LT Thill Layer ('https: // {s} .tiles.mapbox.com / v3 / {id} / {z} / {x} / {y} } .png ', {Id:' examples.map-20v6611k ', Nawawat: true}), "ESRI Roads": L. Tile layer ('http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/ {Z} / {y} / {x}', {noWrap: true})}; These layers are added with the L.control.layers (betamap) .addTo (map) in my map's layer control and do the required work
The problem I want is the ability of the user to select a blank tile layer with the same control, effectively shutting the base map, but via the L Empty tile layer .tileLayer () this does not work as a breakdown function
Security is a clean way to add a blank tile layer options for this control? Excavation through APIs and questions of various Github / Forum have not been revealed.
Thank you in advance!
returns the empty string as URL parameter and works for me and does not cause any errors :
var base = {'Empty': L.tileLayer (''), 'OpenStreetMap': L.tileLayer ('http: // {s} .tile.openstreetmap.org / {Z} / {x} / {y} .png ', {' attribution ':' map data & copy; OpenStreetMap contributors'})}; Examples of working on the planker:
Comments
Post a Comment