Browse Source

GeoLocate: when first acquiring position, zoom to z17

- Temporarily use L.Control.Locate source code until pull request https://github.com/domoritz/leaflet-locatecontrol/pull/263 is merged
master
Stephan Bösch-Plepelits 4 years ago
parent
commit
7d2e2383b2
  1. 2
      index.php
  2. 2
      package.json
  3. 5
      src/PluginGeoLocate.js

2
index.php

@ -45,7 +45,7 @@ html_export_var(array(
<link rel="stylesheet" href="node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.css" />
<link rel="stylesheet" href="node_modules/leaflet.polylinemeasure/Leaflet.PolylineMeasure.css" />
<script src="node_modules/leaflet/dist/leaflet.js"></script>
<script src="node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.js"></script>
<script src="node_modules/leaflet.locatecontrol/src/L.Control.Locate.js"></script>
<script src="node_modules/leaflet-textpath/leaflet.textpath.js"></script>
<script src="node_modules/leaflet-polylineoffset/leaflet.polylineoffset.js"></script>
<script src="node_modules/leaflet.polylinemeasure/Leaflet.PolylineMeasure.js"></script>

2
package.json

@ -28,7 +28,7 @@
"leaflet-geosearch": "^2.4.0",
"leaflet-polylineoffset": "^1.1.0",
"leaflet-textpath": "git+https://github.com/makinacorpus/Leaflet.TextPath.git#leaflet0.8-dev",
"leaflet.locatecontrol": "^0.61.0",
"leaflet.locatecontrol": "git+https://github.com/plepe/leaflet-locatecontrol.git#initialZoomLevel",
"leaflet.polylinemeasure": "git+https://github.com/ppete2/Leaflet.PolylineMeasure.git",
"md5": "^2.2.1",
"measure-ts": "^3.3.2",

5
src/PluginGeoLocate.js

@ -2,10 +2,11 @@ register_hook('init', function () {
// Geo location
L.control.locate({
locateOptions: {
enableHighAccuracy: true,
maxZoom: 17
enableHighAccuracy: true
},
flyTo: true,
keepCurrentZoomLevel: true,
initialZoomLevel: 17,
drawCircle: true,
circleStyle: {
weight: 0,

Loading…
Cancel
Save