[OpenLayers-Users] How do I get custom markers per layer

Mark de Blois mark.deblois at maplecroft.net
Fri Oct 27 05:41:09 EDT 2006


Hi there,

 

I am trying to setup an internal viewer taking WMS services and live
GeoRSS feeds with OpenLayers. Could have quite an impact in the company
I work for.

I am trying to work out using different custom markers for different
GeoRSS feeds. Should be possible I would think. Could anyone point me in
the right direction? I am not a star in JavaScript and have not had much
success so far.

 

Thanks to Christopher I have been able to change the default icon using
the script below. But doing so gives all markers from different feeds
the same icon. 

 

 OpenLayers.Marker.defaultIcon = function() {

     var url = OpenLayers.Util.getImagesLocation() + "marker.png";

     var size = new OpenLayers.Size(21, 25);

     return new OpenLayers.Icon(url, size);        

 };

 

If you do this before you add your layer, your GeoRSS layer will use the
new markers.

 

Thanks for any help.

 

Regards,
Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061027/346da9a6/attachment.html


More information about the Users mailing list