[OpenLayers-Users] Bug with custom markers?
Cranio
cranio at quipo.it
Fri Jan 25 07:52:14 EST 2008
Thanks, I already spotted this by having a look at the source code, and mod'd
my code to:
feature = new OpenLayers.Feature(gmap,ll,{icon:new
OpenLayers.Icon('icon.png',size,offset)});
but still mouse clicks are not recognized.
Any other clue or similar issues out there?
> function aM(icon,lon,lat,id)
> {
> var ll = gmap.forwardMercator(lon,lat);
> feature = new OpenLayers.Feature(gmap,ll);
> var marker = feature.createMarker();
> marker.icon=icon; // <--- I HAD TO DO THIS WAY CUZ I USED
> feature.createMarker ... MAYBE I SHOULDN'T?
Correct, you shouldn't. Instead, the third property of your Feature()
object should be a 'data' hash with an icon variable:
Feature(gmap, ll, {icon:new OpenLayers.Icon()})
Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
--
View this message in context: http://www.nabble.com/Bug-with-custom-markers--tp15085502p15087111.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list