1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-08-06 19:20:48 +00:00

Fix marker icon sizes

This commit is contained in:
jeremy@jermolene.com 2022-12-09 08:11:01 +00:00
parent 54a44516a7
commit cff3473fa6

View File

@ -56,12 +56,13 @@ GeomapWidget.prototype.renderMap = function(domNode) {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map); }).addTo(map);
// Create default icon // Create default icon
const iconProportions = 365/560,
iconHeight = 50;
const myIcon = new L.Icon({ const myIcon = new L.Icon({
iconUrl: $tw.utils.makeDataUri(this.wiki.getTiddlerText("$:/plugins/tiddlywiki/geospatial/images/markers/pin"),"image/svg+xml"), iconUrl: $tw.utils.makeDataUri(this.wiki.getTiddlerText("$:/plugins/tiddlywiki/geospatial/images/markers/pin"),"image/svg+xml"),
iconSize: [38, 95], iconSize: [iconHeight * iconProportions, iconHeight], // Side of the icon
shadowSize: [50, 64], iconAnchor: [(iconHeight * iconProportions) / 2, iconHeight], // Position of the anchor within the icon
iconAnchor: [22, 94], popupAnchor: [0, -iconHeight] // Position of the popup anchor relative to the icon anchor
popupAnchor: [-3, -76]
}); });
// Add scale // Add scale
L.control.scale().addTo(map); L.control.scale().addTo(map);