refactoring: extract scale & locate controls to Map.js
This commit is contained in:
parent
49ac7f5127
commit
0d30461ebc
2 changed files with 8 additions and 8 deletions
|
|
@ -113,10 +113,17 @@ BR.Map = {
|
||||||
|
|
||||||
layersControl = L.control.layers(baseLayers, overlays).addTo(map);
|
layersControl = L.control.layers(baseLayers, overlays).addTo(map);
|
||||||
|
|
||||||
|
L.control.locate({
|
||||||
|
icon: 'glyphicon glyphicon-screenshot',
|
||||||
|
iconLoading: 'glyphicon glyphicon-refresh',
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
L.control.scale().addTo(map);
|
||||||
|
|
||||||
// expose map instance for console debugging
|
// expose map instance for console debugging
|
||||||
BR.debug = BR.debug || {};
|
BR.debug = BR.debug || {};
|
||||||
BR.debug.map = map;
|
BR.debug.map = map;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
map: map,
|
map: map,
|
||||||
layersControl: layersControl
|
layersControl: layersControl
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@
|
||||||
// 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',
|
||||||
|
|
@ -276,8 +271,6 @@
|
||||||
routing: routing,
|
routing: routing,
|
||||||
profile: profile
|
profile: profile
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
L.control.scale().addTo(map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mapContext = BR.Map.initMap();
|
mapContext = BR.Map.initMap();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue