[OpenLayers-Users] GeoRSS and Custom Icons
Eric Lemoine
eric.c2c at gmail.com
Tue Jun 24 17:59:47 EDT 2008
On Wed, Jun 11, 2008 at 10:22 AM, Levii Smith <smithlev at levii.com> wrote:
> Ok, so I'm trying to use the ICON tag out of a GeoRSS feed to display the
> ICONS on the map.
>
> I've added to the /format/georss.js and it returns either the value of the
> icon path (URL) or NULL back into feature.attributes.icon,
>
> /* Provide icon data and default */
> var iconURL = this.getChildValue(item, "*", "icon", this.iconURL);
> if(!iconURL) {
> iconURL = null;
> }
>
> Now I'm stuck at modifying the function in /layer/GeoRSS.js (line 183)...
>
> Anyone that can provide a pointer on how to fix this
>
> data.icon = this.icon == null ?
> OpenLayers.Marker.defaultIcon() :
> this.icon.clone();
>
> to use the icon in the feature, and the default if none is defined?
>
> I've tried setting OpenLayers.Marker.Icon(feature.attributes.icon); but keep
> getting an object expected error.
Hello
If I were you I wouldn't use Layer.GeoRSS. Instead I would trigger my
own Ajax request to get the GeoRSS document, use Format.GeoRSS to
unserialize the GeoRSS doc into features, and add the resulting
features to a simple vector layer (Layer.Vector). And I would rely on
OpenLayers' styling framework to style the features based on their
attributes. See the georss-flickr.html example which more or less does
this.
Sorry if this response is coming a bit late,
--
Eric
Sorry if this response is coming
More information about the Users
mailing list