Skip to content

Commit f911f62

Browse files
committed
add scale
1 parent 6aeaf8f commit f911f62

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

osmmap2.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,10 @@
282282
'9' => 'CustomIcon',
283283
'10' => 'ImgIcon'
284284
);
285+
285286
// Icons
286287
$js .= "
288+
287289
var PlgIcon = L.Icon.extend({
288290
options: {
289291
shadowUrl: 'plugins/piwigo-openstreetmap/leaflet/images/marker-shadow.png',
@@ -293,6 +295,7 @@
293295
popupAnchor: [-10, -10]
294296
}
295297
});
298+
296299
var LeafIcon = L.Icon.extend({
297300
options: {
298301
shadowUrl: 'plugins/piwigo-openstreetmap/leaflet/images/leaf-shadow.png',
@@ -348,6 +351,7 @@
348351
349352
var MapIconBlue = new MapIcon({iconUrl: 'plugins/piwigo-openstreetmap/leaflet/images/mapicons-blue.png'}),
350353
MapIconGreen = new MapIcon({iconUrl: 'plugins/piwigo-openstreetmap/leaflet/images/mapicons-green.png'});
354+
351355
";
352356

353357
// Create the map and get a new map instance attached and element with id="tile-map"
@@ -356,6 +360,7 @@
356360
TileLayer = new L.TileLayer(Url, {maxZoom: 18, noWrap: ".$nowarp.", attribution: Attribution}),
357361
latlng = new L.LatLng(".$center_lat.", ".$center_lng.");\n";
358362
$js .= "var map = new L.Map('map', {center: latlng, zoom: ".$zoom.", layers: [TileLayer], contextmenu: true});\n";
363+
$js .= "L.control.scale().addTo(map);\n";
359364
$js .= "map.attributionControl.setPrefix('');\n";
360365
$js .= "var MarkerClusterList=[];\n";
361366
$js .= "var markers = new L.MarkerClusterGroup();\n";
@@ -378,6 +383,7 @@
378383
} else if ($pinid == 10) {
379384
$js .= "var marker = new L.Marker(latlng, { title: title, icon: new ImgIcon({iconUrl: pathurl})});\n";
380385
}
386+
381387
// create Popup
382388
if ($popup < 2)
383389
{

0 commit comments

Comments
 (0)