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

David William Bitner david.bitner at gmail.com
Fri Oct 27 09:01:13 EDT 2006


Mark --

Here is one way that I have used.
http://www.dbspatial.com/js/ol/examples/georss.html

You can find the multi-color icons in
http://www.dbspatial.com/js/ol/img/

The code that does the color switching by color name is in
http://www.dbspatial.com/js/ol/lib/OpenLayers/Layer/GeoRSS.js


It ain't too pretty, but it worked for me.

David

On 10/27/06, Mark de Blois <mark.deblois at maplecroft.net> wrote:
>
>  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
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
>


-- 
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061027/fd2832a4/attachment.html


More information about the Users mailing list