Hi,
I'm trying use WMSTileLayers.vue component but I can't use correctly it.
I tried adapt this: https://github.com/KoRiGaN/Vue2Leaflet/blob/master/examples/src/components/WMSLayers.vue
but I don't know how to get this effect:
mounted() {
const baseMaps = {
"Street": L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
maxZoom: 22,
}),
"Satellite": L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{
maxZoom: 20,
subdomains: ['mt0','mt1','mt2','mt3']
}),
};
L.control.layers(baseMaps).addTo(this.$refs.map.mapObject);
}
Could you help me?
Hi @mits87,
WMSTileLayers is for WMSLayers not for TileLayers like they have specific options like layers and just automatically create WMSLayers and the associated layer control.
I'm not sure what you are trying to achieve but if you just want to have 2 layers displayed and a control to select one or the other I would suggest just to add TileLayer and add a control manually.
If that work then you can just wrap all that into a component that will look like WMSTileLayers.
Layer controls should be implemented soon and should help with this kind of situations.
Hope this helps.
Micka
Hi @mits87, @ilmars, @kesm0,
Layers control is now implemented Vue2Leaflet v1.0.1.
The documentation is not good yet but you can have a look at the new WMSTileLayer example that uses the new Layers control.
WMSTileLayers control doesn't existe anymore.
Hope this helps,
Micka
Closing as no comments for 3 weeks.
Please reopen this issue if it not solved yet.
Most helpful comment
Hi @mits87,
WMSTileLayers is for WMSLayers not for TileLayers like they have specific options like layers and just automatically create WMSLayers and the associated layer control.
I'm not sure what you are trying to achieve but if you just want to have 2 layers displayed and a control to select one or the other I would suggest just to add TileLayer and add a control manually.
If that work then you can just wrap all that into a component that will look like WMSTileLayers.
Layer controls should be implemented soon and should help with this kind of situations.
Hope this helps.
Micka