Skip to content

Commit 28f3a93

Browse files
authored
Reset default greenred iconAnchor xy in osm_get_js
Those icons were misplaced on picture map: iconAnchor needed to be updated. To solve this I copied default values from L.Icon.Default options in leaflet-src.js (3395) https://github.com/xbgmsharp/piwigo-openstreetmap/blob/master/leaflet/leaflet-src.js#L3395 I did the same for popupAnchor because blue default icon has the same footprint as green and red default icons, and because leaflet-src.js is reliable. It's better with 1 x value that let the popup centered, but if -34 y value seems to high for wide maps not that tall, it would be great to move the popup on the side.
1 parent 22f3b00 commit 28f3a93

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/functions_map.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ function osm_get_js($conf, $local_conf, $js_data)
396396
shadowUrl: 'plugins/piwigo-openstreetmap/leaflet/images/marker-shadow.png',
397397
iconSize: [25, 41],
398398
shadowSize: [41, 41],
399-
iconAnchor: [21, 21],
400-
popupAnchor: [-10, -10]
399+
iconAnchor: [12, 41],
400+
popupAnchor: [1, -34]
401401
}
402402
});
403403

0 commit comments

Comments
 (0)