-//= require leaflet.locatecontrol/dist/L.Control.Locate.umd
+//= require leaflet.locate
(function () {
$(document).on("change", "#user_all", function () {
});
}());
-$(document).ready(function () {
+$(function () {
const defaultHomeZoom = 12;
let map, marker, deleted_lat, deleted_lon;
const position = $("html").attr("dir") === "rtl" ? "topleft" : "topright";
- L.OSM.zoom({ position: position })
- .addTo(map);
-
- const locate = L.control.locate({
- position: position,
- icon: "icon geolocate",
- iconLoading: "icon geolocate",
- strings: {
- title: I18n.t("javascripts.map.locate.title"),
- popup: function (options) {
- return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
- }
- }
- }).addTo(map);
-
- const locateContainer = locate.getContainer();
+ L.OSM.zoom({ position }).addTo(map);
- $(locateContainer)
- .removeClass("leaflet-control-locate leaflet-bar")
- .addClass("control-locate")
- .children("a")
- .attr("href", "#")
- .removeClass("leaflet-bar-part leaflet-bar-part-single")
- .addClass("control-button");
+ L.OSM.locate({ position }).addTo(map);
if (OSM.home) {
map.setView([OSM.home.lat, OSM.home.lon], defaultHomeZoom);
if ($("#map").hasClass("set_location")) {
marker = L.marker([0, 0], {
- icon: OSM.getUserIcon(),
+ icon: OSM.getMarker({}),
keyboard: false,
interactive: false
});
$("[data-user]").each(function () {
const user = $(this).data("user");
if (user.lon && user.lat) {
- L.marker([user.lat, user.lon], { icon: OSM.getUserIcon(user.icon) }).addTo(map)
+ L.marker([user.lat, user.lon], { icon: OSM.getMarker({ icon: user.icon }) }).addTo(map)
.bindPopup(user.description, { minWidth: 200 });
}
});
});
$("input[name=legale]").change(function () {
- $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span></div>");
+ $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + OSM.i18n.t("browse.start_rjs.loading") + "</span></div>");
fetch($(this).data("url"))
.then(r => r.text())
.then(html => { $("#contributorTerms").html(html); });