[OpenLayers-Users] How do I get custom markers per layer
David William Bitner
david.bitner at gmail.com
Mon Oct 30 10:34:37 EST 2006
Mark,
That size is indicated in the default icon section that you referred to in
your first post, you could set it per georss feed in the georss.js file
similarly to how I have done it for the marker url in the example that I
showed you.
David
On 10/30/06, Mark de Blois <mark.deblois at maplecroft.net> wrote:
>
> Hi David,
>
>
>
> The custom markers that I am using are being resized to the default size
> of the markers (25x21). My custom markers are being distorted to this size
> too. Do you happen to know where I can change this really easily by any
> chance? Otherwise I will have to keep diggin'.
>
>
>
> Thanks,
> Mark
>
>
> ------------------------------
>
> *From:* David William Bitner [mailto:david.bitner at gmail.com]
> *Sent:* 27 October 2006 14:01
> *To:* Mark de Blois
> *Cc:* users at openlayers.org
> *Subject:* Re: [OpenLayers-Users] How do I get custom markers per layer
>
>
>
> 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
>
--
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061030/8ce795e9/attachment.html
More information about the Users
mailing list