[OpenLayers-Users] Problems subclassing OpenLayers.Format.GeoRSS
christopher.schmidt at nokia.com
christopher.schmidt at nokia.com
Sat Aug 14 14:36:07 EDT 2010
On Aug 14, 2010, at 2:32 PM, ext Nick Whitelegg wrote:
> Hello,
>
> I'm trying to subclass OpenLayers.Format.GeoRSS; this is because I want to extract additional information from a GeoRSS feed that is not parsed with OpenLayers.Format.GeoRSS, such as geo:dir.
>
> As can be seen, for the moment the overridden createFeatureFromItem() simply displays an alert box with the feature title. This works correctly - the title is displayed - but the items are not added to the vector layer (code as below, the code below works correctly when I just use a straight OpenLayers.Format.GeoRSS()):
>
> georss = new OpenLayers.Layer.Vector
> ("OTV Panoramas",
> { strategies: [new OpenLayers.Strategy.BBOX()],
> protocol: new OpenLayers.Protocol.HTTP
> ({ url: "/otv/rss.php",
> format: new OpenLayers.Format.GeoRSSExt() }),
> 'styleMap' : sm,
> 'projection': wgs84
> } );
>
> The specific error I get is "features[i] not defined" in line 1698 of the current release version (2.9) of OpenLayers.js.
>
> Any ideas what I'm doing wrong here? As far as I can ascertain I am using the correct current way to subclass.
You appear to have ignored the return value of createFeatureFromItem:
* Returns:
* {<OpenLayers.Feature.Vector>} A feature representing the item.
*/
createFeatureFromItem: function(item) {
var geometry = this.createGeometryFromItem(item);
Perhaps not doing that would be helpful.
-- Chris
> Thanks,
> Nick
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list