maps: add tooltip to geolocate button (#26374)

This commit is contained in:
Frédéric Péters 2018-09-13 09:51:46 +02:00
parent b74b099f85
commit c128a78291
3 changed files with 12 additions and 4 deletions

View File

@ -144,7 +144,9 @@ $(function() {
}).addTo(map);
}
if (L.Control.Gps && $map_widget.data('include-geoloc-button')) {
var gps_control = new L.Control.Gps({position: map_controls_position});
var gps_control = new L.Control.Gps({
position: map_controls_position,
tooltipTitle: gettext('Display my position')});
map.addControl(gps_control);
}

View File

@ -34,7 +34,8 @@ L.Control.Gps = L.Control.extend({
fillColor: '#f23',
fillOpacity: 1
},
position: 'topleft'
position: 'topleft',
tooltipTitle: 'Display my position'
},
initialize: function(options) {
@ -54,6 +55,7 @@ L.Control.Gps = L.Control.extend({
this._button = L.DomUtil.create('a', 'gps-button', this._container);
this._button.href = '#';
this._button.text = '\uf192';
this._button.title = this.options.tooltipTitle;
this._button.style.fontFamily = 'FontAwesome';
L.DomEvent
.on(this._button, 'click', L.DomEvent.stop, this)

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: combo(js) 0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-13 07:22+0000\n"
"PO-Revision-Date: 2018-09-13 09:29+0200\n"
"POT-Creation-Date: 2018-09-13 07:51+0000\n"
"PO-Revision-Date: 2018-09-13 09:51+0200\n"
"Last-Translator: Frederic Peters <<fpeters@entrouvert.com>\n"
"Language: French\n"
"MIME-Version: 1.0\n"
@ -23,3 +23,7 @@ msgstr "Zoomer"
#: apps/maps/static/js/combo.map.js:143
msgid "Zoom out"
msgstr "Dézoomer"
#: apps/maps/static/js/combo.map.js:149
msgid "Display my position"
msgstr "Afficher ma position"