Use leaflet.locatecontrol plugin to have a "show my position" button below zoom buttons
This commit is contained in:
parent
66abb83c60
commit
a74894824a
5 changed files with 17 additions and 10 deletions
|
|
@ -21,7 +21,8 @@
|
||||||
"bootbox": "~4.4.0",
|
"bootbox": "~4.4.0",
|
||||||
"seiyria-bootstrap-slider": "~4.8.1",
|
"seiyria-bootstrap-slider": "~4.8.1",
|
||||||
"url-search-params": "~0.5.0",
|
"url-search-params": "~0.5.0",
|
||||||
"Leaflet.RestoreView": "makinacorpus/Leaflet.RestoreView#master"
|
"Leaflet.RestoreView": "makinacorpus/Leaflet.RestoreView#master",
|
||||||
|
"leaflet.locatecontrol": "^0.52.0"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"leaflet": {
|
"leaflet": {
|
||||||
|
|
|
||||||
5
dist/brouter-web.js
vendored
5
dist/brouter-web.js
vendored
File diff suppressed because one or more lines are too long
2
dist/brouter-web.js.map
vendored
2
dist/brouter-web.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -140,6 +140,11 @@
|
||||||
// left sidebar as additional control position
|
// left sidebar as additional control position
|
||||||
map._controlCorners[leftPaneId] = L.DomUtil.create('div', 'leaflet-' + leftPaneId, map._controlContainer);
|
map._controlCorners[leftPaneId] = L.DomUtil.create('div', 'leaflet-' + leftPaneId, map._controlContainer);
|
||||||
|
|
||||||
|
L.control.locate({
|
||||||
|
icon: 'glyphicon glyphicon-screenshot',
|
||||||
|
iconLoading: 'glyphicon glyphicon-refresh',
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
document.getElementById('about_link').onclick = function() {
|
document.getElementById('about_link').onclick = function() {
|
||||||
bootbox.alert({
|
bootbox.alert({
|
||||||
title: 'About',
|
title: 'About',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue