0

I'm using the qgis2web plugin to create a Leaflet web map. All is working well except that when using geolocation, the map zooms in too much on the device location. Zooming out is only temporary as the map seems to zoom back in on the geolocation accuracy circle.

I have looked for a solution but can't seem to find one and looking through the js or the html files and online documents didn't get me closer to a solution.

Any idea how to resolve this issue?

3

Geolocation is done by Leaflet.Locate (https://github.com/domoritz/leaflet-locatecontrol). Its readme gives options to change its behaviour. Open index.html in a text editor, and change the code according to the FAQ on that readme:

map.addControl(L.control.locate({
   locateOptions: {
           maxZoom: 10
}}));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.