[OpenLayers-Users] Changing icons in GeoRSS layer

Tobia Di Pisa tobia.dipisa at geo-solutions.it
Thu Feb 11 11:59:39 EST 2010


Hi,

I'm having a problem with Firefox by changing the icons in a GeoRSS layer.

This is my code:

...

var rss_layer= new OpenLayers.Layer.GeoRSS(...);
for(var f=0; f<rss_layer.features.length; f++){
     var feature = rss_layer.features[f];
     var size = new OpenLayers.Size(21,25);
     var offset = new OpenLayers.Pixel(-(size.w)/2, -(size.h));
     var icon = new
OpenLayers.Icon('js/mfbase/openlayers/img/marker.png',size,offset);

     var newdata = feature.data;
     newdata.icon = icon;
     var newfeature = new OpenLayers.Feature(rss_layer, feature.lonlat,
newdata);

     rss_layer.removeMarker(feature.marker);
     var marker = newfeature.createMarker();
     marker.events.register('click', newfeature, rss_layer.markerClick);
     rss_layer.features[f] = newfeature;
     rss_layer.addMarker(marker);
}

...

In Internet Explorer there is no problem. When the marker icon changes and I
click on the marker, the popup appears regularly.

In Firefox however the popup does not appear, the 'click' event is not
captured.

Can you help me please?


Regards,

     Tobia Di Pisa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100211/fd3a05b2/attachment.html


More information about the Users mailing list