Patch classes on the locate control
This patches the map on the user page in the same way as the main map. Closes #1328
This commit is contained in:
parent
1ba7eccae6
commit
1f9857e76c
1 changed files with 12 additions and 1 deletions
|
@ -12,14 +12,25 @@ $(document).ready(function () {
|
||||||
L.OSM.zoom({position: position})
|
L.OSM.zoom({position: position})
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
L.control.locate({
|
var locate = L.control.locate({
|
||||||
position: position,
|
position: position,
|
||||||
|
icon: 'icon geolocate',
|
||||||
|
iconLoading: 'icon geolocate',
|
||||||
strings: {
|
strings: {
|
||||||
title: I18n.t('javascripts.map.locate.title'),
|
title: I18n.t('javascripts.map.locate.title'),
|
||||||
popup: I18n.t('javascripts.map.locate.popup')
|
popup: I18n.t('javascripts.map.locate.popup')
|
||||||
}
|
}
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
var locateContainer = locate.getContainer();
|
||||||
|
|
||||||
|
$(locateContainer)
|
||||||
|
.removeClass('leaflet-control-locate leaflet-bar')
|
||||||
|
.addClass('control-locate')
|
||||||
|
.children("a")
|
||||||
|
.removeClass('leaflet-bar-part leaflet-bar-part-single')
|
||||||
|
.addClass('control-button');
|
||||||
|
|
||||||
if (OSM.home) {
|
if (OSM.home) {
|
||||||
map.setView([OSM.home.lat, OSM.home.lon], 12);
|
map.setView([OSM.home.lat, OSM.home.lon], 12);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue