From ea5d41a8ad1c04d2a0f3ea95df730313756d3c0b Mon Sep 17 00:00:00 2001 From: relikd Date: Wed, 3 Jul 2024 00:16:28 +0200 Subject: [PATCH] ref: remove default "returnToPrevBounds" --- README.md | 3 +-- map_location/static/map-location.js | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0f579d5..238cddd 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ class Place(models.Model): # attribution: '© OpenStreetMap', # }, # 'locate': { - # 'returnToPrevBounds': True, # 'showPopup': False, # }, }) @@ -48,7 +47,7 @@ class Place(models.Model): | markerZoom | Initial zoom scale (on load) – if a marker is set. (default: `18`) | tileLayer | [TileLayer](https://leafletjs.com/reference.html#tilelayer) urlTemplate (default: `"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"`) | tileOptions | [TileLayer Options](https://leafletjs.com/reference.html#tilelayer-option) (default: `{}`) -| locate | [Leaflet.Locate Options](https://github.com/domoritz/leaflet-locatecontrol#possible-options) (default: `{returnToPrevBounds: true, showPopup: false}`) +| locate | [Leaflet.Locate Options](https://github.com/domoritz/leaflet-locatecontrol#possible-options) (default: `{showPopup: false}`) ## Usage diff --git a/map_location/static/map-location.js b/map_location/static/map-location.js index 7b7bff5..d73f7e4 100644 --- a/map_location/static/map-location.js +++ b/map_location/static/map-location.js @@ -14,11 +14,7 @@ function MapLocationInit(mapId, options = {}) { zoom: 2, ...(options.map || {}) }); - L.control.locate({ - returnToPrevBounds: true, - showPopup: false, - ...(options.locate || {}) - }).addTo(map); + L.control.locate({ showPopup: false, ...(options.locate || {}) }).addTo(map); function loadPos() { if (!valField.value) {