Skip to content

Commit

Permalink
GeoLocate: when first acquiring position, zoom to z17
Browse files Browse the repository at this point in the history
- Temporarily use L.Control.Locate source code until pull request domoritz/leaflet-locatecontrol#263 is merged
  • Loading branch information
plepe committed Mar 21, 2020
1 parent 29c884d commit 7d2e238
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -45,7 +45,7 @@
<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>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/PluginGeoLocate.js
Expand Up @@ -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,
Expand Down

0 comments on commit 7d2e238

Please sign in to comment.