drawing custom icon fails
See original GitHub issueWhat is the latest official way to extend an icon and add it to the map? The way described on the examples page does not work anymore in the current master. I get the following error because the icon is only the extended part… it is missing the inheritance.
TypeError: options.icon.createIcon is not a function
I now create icons this way… which does work, but I do not favour it…
var thisIcon = new L.Icon();
thisIcon.options.iconUrl = '/public/images/marker.png';
thisIcon.options.iconAnchor = new L.Point(16, 16),
thisIcon.options.iconSize = new L.Point(newWidth, 32);
thisIcon.options.size = new L.Point(32, 32);
thisIcon.options.shadowUrl = '/public/images/shadow.png';
thisIcon.options.shadowSize = new L.Point(32, 32);
var thisMarker = new L.Marker(new L.LatLng(52.028898, 5.141505), {icon: thisIcon});
map.addLayer(thisMarker);
Issue Analytics
- State:
- Created 12 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
c++ - .ico file looks wrong drawn with DrawIcon - Stack Overflow
The DrawIcon and DrawIconEx functions on a high DPI display scales up the icons that they draw. Even though they seem to be...
Read more >Getting Around a Common Custom Icon Problem - MacMost
Creating a custom Finder icon for a file or folder is as simple as copy and paste. However, a common problem people experience...
Read more >Custom Icons | Showit Help Center
To create a custom icon, it must be in the vector SVG format. You can generate an SVG from Illustrator and just make...
Read more >Material Symbols and Icons - Google Fonts
Material Symbols are our newest icons consolidating over 2500 glyphs in a single font file with a wide range of design variants.
Read more >How to Create and Use Custom Icons: 9 Steps (with Pictures)
1. Open Microsoft Paint.{"smallUrl":"https:\/\/www.wikihow.com\/images\/3\/3a\/Create-and-Use-Custom-Icons-Step-1.jpg","bigUrl":"\/images\/thumb\/3\/3a\/Create ... 2. Go to Image, then Attributes. Change the height & width to 32 exactly!{"smallUrl":"https:\/\/www.wikihow.com\/images\/8\/8a\/Create-and-Use-Custom-Icons ... 3. Click View,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still not updated in the documentation, please update!
+1