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:
Marco Antonio Frias Butrón 2016-10-16 16:26:19 -04:00 committed by Tom Hughes
parent 1ba7eccae6
commit 1f9857e76c

View file

@ -12,14 +12,25 @@ $(document).ready(function () {
L.OSM.zoom({position: position})
.addTo(map);
L.control.locate({
var locate = L.control.locate({
position: position,
icon: 'icon geolocate',
iconLoading: 'icon geolocate',
strings: {
title: I18n.t('javascripts.map.locate.title'),
popup: I18n.t('javascripts.map.locate.popup')
}
}).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) {
map.setView([OSM.home.lat, OSM.home.lon], 12);
} else {