Skip to content

Commit

Permalink
Use leaflet.locatecontrol plugin to have a "show my position" button …
Browse files Browse the repository at this point in the history
…below zoom buttons
  • Loading branch information
bagage committed Jul 21, 2016
1 parent 8732582 commit 1b23c37
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"bootbox": "~4.4.0",
"seiyria-bootstrap-slider": "~4.8.1",
"url-search-params": "~0.5.0",
"Leaflet.RestoreView": "makinacorpus/Leaflet.RestoreView#master"
"Leaflet.RestoreView": "makinacorpus/Leaflet.RestoreView#master",
"leaflet.locatecontrol": "^0.52.0"
},
"overrides": {
"leaflet": {
Expand Down Expand Up @@ -80,6 +81,15 @@
},
"url-search-params": {
"main": "build/url-search-params.js"
},
"Leaflet.RestoreView": {
"main": "leaflet.restoreview.js"
},
"leaflet.locatecontrol": {
"main": [
"dist/*.css",
"src/L.Control.Locate.js"
]
}
},
"resolutions": {
Expand Down
3 changes: 2 additions & 1 deletion dist/brouter-web.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/brouter-web.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>BRouter web client</title>

<link rel="stylesheet" href="dist/brouter-web.css" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<div id="map"></div>
Expand Down
2 changes: 2 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
// left sidebar as additional control position
map._controlCorners[leftPaneId] = L.DomUtil.create('div', 'leaflet-' + leftPaneId, map._controlContainer);

L.control.locate().addTo(map);

document.getElementById('about_link').onclick = function() {
bootbox.alert({
title: 'About',
Expand Down

0 comments on commit 1b23c37

Please sign in to comment.