1 //= require leaflet.locatecontrol/dist/L.Control.Locate.umd
3 L.OSM.locate = function (options) {
4 const control = L.control.locate({
6 title: OSM.i18n.t("javascripts.map.locate.title"),
7 popup: function (options) {
8 return OSM.i18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
14 control.onAdd = function (map) {
15 const container = Object.getPrototypeOf(this).onAdd.apply(this, [map]);
17 .removeClass("leaflet-control-locate leaflet-bar")
18 .addClass("control-locate")
21 .removeClass("leaflet-bar-part leaflet-bar-part-single")
22 .addClass("control-button")
25 $(L.SVG.create("svg"))
26 .attr("class", "h-100 w-100")
28 $(L.SVG.create("use"))
29 .attr("href", "#icon-geolocate")));