]>
git.ipfire.org Git - ipfire.org.git/blob - src/static/js/maps.js
2 $(".map").each(function() {
5 // Add the map provider
6 var layer
= L
.tileLayer("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png", {
7 attribution
: "© <a href=\"https://osm.org/copyright\">OpenStreetMap</a> contributors"
10 var search
= $(this).attr("data-map-search");
12 var provider
= new L
.Control
.Geocoder
.Nominatim();
14 console
.log("search" + search
);
16 provider
.geocode(search
, function (results
) {
17 $.each(results
, function(i
, result
) {
19 map
.fitBounds(result
.bbox
);
21 var marker
= L
.marker(result
.center
);
24 // End loop after first result