One specific layer requires the following block to be positioned properly in relation to map.
const mapSize = map.getSize();
const globalPos = L.DomUtil.getPosition(map.getPane("mapPane"));
const topLeft = globalPos.multiplyBy(-1);
const bottomRight = topLeft.add(mapSize);
L.DomUtil.setPosition(map.getPane(this.options.pane), topLeft);
This block is getting called on every map view update.
The problem is: when I try to add another layer (GeoJSON/JSON), which doesn't require such adjustment, it's also being affected by DomUtil position and is placed improperly on the map. Is there a way to set position for specific layer only, or perhaps to offset the position of GeoJSON layer somehow to compensate for the changes to position set through DomUtil?
from Is there a way to set position for specific layer instead of all layers on the map?
No comments:
Post a Comment