I am using Nuxt Leaflet, and I have not figured out how to change the tile layer. I have tried multiple different approaches, and they all result with not requesting the proper tiles for the changed layer.
Here is an example:
<l-map
id="maps-lmap"
ref="lmap"
style="width:100%; height:100%"
:zoom="mapZoom"
:center="mapCenter"
:options="mapOptions"
:min-zoom="minZoom"
:max-zoom="maxZoom"
@update:center="mapCenterUpdate"
@update:zoom="mapZoomUpdate"
@update:bounds="mapBoundsUpdate"
>
<l-tile-layer
:url="mapTileUrl"
:attribution="mapAttribution"
:tile-size="512"
:options="{'zoomOffset':-1}"
/>
</l-map>
If I change the mapTileUrl
value to a different url, it requests the following tile urls:
https://wc-maps.s3.amazonaws.com/map-tiles-no-ocean/-1/0/0.png
If I do a conditional tile layer like this, I get the same result:
<template v-if="mapType === typeA">
<l-tile-layer
:url="tileUrlA"
...
>
</l-tile-layer>
</template>
<template v-else>
<l-tile-layer
:url="tileUrlB"
...
>
</l-tile-layer>
</template
I have also tried using L
object to add the new tile layer, and still get the same result. Anyone know why it is not requesting the proper tile urls?