feat: add locate options
This commit is contained in:
@@ -32,6 +32,10 @@ class Place(models.Model):
|
||||
# 'tileOptions': {
|
||||
# attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||
# },
|
||||
# 'locate': {
|
||||
# 'returnToPrevBounds': True,
|
||||
# 'showPopup': False,
|
||||
# },
|
||||
})
|
||||
```
|
||||
|
||||
@@ -44,6 +48,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}`)
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -17,6 +17,7 @@ function MapLocationInit(mapId, options = {}) {
|
||||
L.control.locate({
|
||||
returnToPrevBounds: true,
|
||||
showPopup: false,
|
||||
...(options.locate || {})
|
||||
}).addTo(map);
|
||||
|
||||
function loadPos() {
|
||||
|
||||
Reference in New Issue
Block a user