Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Leaflet 0.3 -> 0.4 Icon API upgrade
// 0.3 way
var icon = new L.Icon('icon.png');
// 0.4 way
var icon = new L.Icon({iconUrl: 'icon.png'}); // or just "L.icon(...)"
// 0.3 way
var MyIcon = L.Icon.extend({
iconUrl: 'icon.png',
...
});
// 0.4 way
var MyIcon = L.Icon.extend({
options: {
iconUrl: 'icon.png',
...
}
});
// if you need to inherit default marker properties, inherit from L.Icon.Default instead of L.Icon
@mourner

This comment has been minimized.

Copy link
Owner Author

@mourner mourner commented Jul 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment