xx = new L.Icon({ iconUrl: sprite, iconSize: { width: 23, height: 26},
iconAnchor: new L.point(32,0),
popupAnchor: new L.point(-3, 0) ,
shadowUrl: sprite,
shadowSize: [7,30],
shadowAnchor: [0,0] });
Is it possible to use a sprite for markers in leaflet?
Thanks so much,
Andy
.map_listing_icon_house { background-image: url('/images/gmap/listing_icons_sprite.png'); background-repeat: no-repeat;
width: 23px; height: 26px;
background-position: -32 0;
}
<div class='map_listing_icon_house'></div>
It's a little more complicated in my usage, what with the shadow, and choosing different icons, but that's the general idea.