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 26, 2016
1 parent 66abb83 commit a748948
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
3 changes: 2 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
5 changes: 3 additions & 2 deletions 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.

12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</table>
</div>
<div id="tabs_div" class="hidden">

<ul id="tab" class="nav nav-tabs" role="tablist">
</ul>

Expand Down Expand Up @@ -68,7 +68,7 @@
Online service of the BRouter routing engine. For the offline Android app and more information see <a href="http://brouter.de/" target="_blank">brouter.de</a>.
</p>
<p>
<i>Work in progress:</i> The web client is still in (slow) development; it has some glitches,
<i>Work in progress:</i> The web client is still in (slow) development; it has some glitches,
you might miss some essential features and stumble upon bugs. The user interface is subject to change.
</p>
<p>
Expand All @@ -93,20 +93,20 @@
</ul>
</p>
<p>
<i>Data:</i> based on <a href="http://www.openstreetmap.org" target="_blank">OpenStreetMap</a>. It is usually updated once a week when a new Planet file is available,
<i>Data:</i> based on <a href="http://www.openstreetmap.org" target="_blank">OpenStreetMap</a>. It is usually updated once a week when a new Planet file is available,
see dates of <a href="http://brouter.de/brouter/segments4/" target="_blank">data files</a>.
</p>
<p>
<i><a href="https://github.com/nrenner/brouter-web#credits-and-licenses" target="_blank">Credits</a></i>,
<i><a href="https://github.com/nrenner/brouter-web/blob/master/CHANGELOG.md" target="_blank">Changelog</a></i> and
<i><a href="https://github.com/nrenner/brouter-web#credits-and-licenses" target="_blank">Credits</a></i>,
<i><a href="https://github.com/nrenner/brouter-web/blob/master/CHANGELOG.md" target="_blank">Changelog</a></i> and
<i><a href="https://github.com/nrenner/brouter-web#readme" target="_blank">more info</a></i> on the client.
</p>
</div>

<script>
// global package prefix for BRouter web application
BR = {};

console.log('\r\n###\r\n### BRouter-Web\r\n###\r\n### Please note that the routing API used here is not public!\r\n###\r\n');
</script>

Expand Down
5 changes: 5 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
// left sidebar as additional control position
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() {
bootbox.alert({
title: 'About',
Expand Down

0 comments on commit a748948

Please sign in to comment.