leaflet-layer-tree-plugin icon indicating copy to clipboard operation
leaflet-layer-tree-plugin copied to clipboard

Layer Definition outside of tree

Open veragreen119 opened this issue 5 years ago • 0 comments

Related to my other question regarding dynamically adding layers, I am wondering if this plugin requires that all layers be defined within the tree or if it is possible to create a layer var in the usual way and then construct the tree using the layer variables? Also does this plugin support non WFS layers?

Perhaps I am not understanding the parameters correctly and you could add documentation regarding these parameters:

{ code: "osm", name: "OpenStreetMap", active: true, selectedByDefault: false, openByDefault: true, childLayers: [], selectType: "MULTIPLE", serviceType: "OSM", params: { url: "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" } },

For example if you had a layer var:

var options_gc = {'transparent': true,'tiled': true,'format': 'image/png'}; var source_gc = L.WMS.source("http://geo.weather.gc.ca/geomet/?lang=en&service=WMS&request=GetCapabilities", options_gc); var cadWeather = source_gc.getLayer('Canadian Weather');

How would you add that to the tree referencing cadWeather? Thanks.

veragreen119 avatar May 08 '19 14:05 veragreen119