Maps icon indicating copy to clipboard operation
Maps copied to clipboard

Scale big leaflet markers

Open JeroenDeDauw opened this issue 5 years ago • 6 comments

When Leaflet markers are large images they are shown large on the map, rather than scaled.

JeroenDeDauw avatar Nov 23 '18 23:11 JeroenDeDauw

It is not clear to me what they should be scaled to. I'd also like to see an example of a marker showing up poorly. Please create one at https://sandbox.semantic-mediawiki.org/wiki/Issue/M/510

JeroenDeDauw avatar Nov 23 '18 23:11 JeroenDeDauw

It looks like sandbox does not like Maps! Here are two shots of the diffrence from openlayers to leafelet:

2018-11-27 16_40_55-anlagen der wasserversorgung aquanautwebwiki12859

2018-11-27 16_41_39-anlagen der wasserversorgung aquanautwebwiki12859

carchaias avatar Nov 27 '18 15:11 carchaias

Thanks for reporting this.

I am not sure what would be a good solution. For your case applying the same resizing as OpenLayers does would be ideal. Though this will change the behavior for current users of Leaflet, for who their markers will suddenly be changed in size.

I understand that not fixing this would mean some migration work, though maybe that is not a big thing. How many wikis are using OpenLayers with custom icons that are too big? And of those how many have more than a dozen used marker icons? I don't know but the answer might well be zero. How many icon images do you have?

JeroenDeDauw avatar Nov 28 '18 03:11 JeroenDeDauw

Relevant doc: https://leafletjs.com/examples/custom-icons/

JeroenDeDauw avatar Nov 29 '18 07:11 JeroenDeDauw

Issue still present in latest version image

JeroenDeDauw avatar May 09 '20 21:05 JeroenDeDauw