[OpenLayers-Users] Problem with GeoRSS layer

Christopher Schmidt crschmidt at crschmidt.net
Thu Jun 29 19:00:06 CDT 2006


On Fri, Jun 30, 2006 at 12:07:51AM +0100, nick at hogweed.org wrote:
> 
> > On Tue, Jun 27, 2006 at 11:21:12PM +0100, nick at hogweed.org wrote:
> > > Regarding my OpenStreetMap/OpenLayers test, now that a GeoRSS layer is
> > > available I have tried making my annotations available as (what I believe
> > > is) GeoRSS, e.g.
> > >
> > > http://nick.dev.openstreetmap.org/openlayers/markers.php?bbox=-1,51,0,52
> > >
> > > However when I try and create a GeoRSS layer:
> > >
> > >     var georssLayer = new OpenLayers.Layer.GeoRSS('annotations',
> > >             'http://nick.dev.openstreetmap.org/openlayers/markers.php');
> > >     map.addLayer(georssLayer);
> > > Any ideas here? The full source is available at
> > > http://nick.dev.openstreetmap.org/openlayers/main.js.
> >
> > You want:
> >
> >  OpenLayers.ProxyHost = '';
> >
> > Right now, OpenLayers.ProxyHost is (extremely!) underdocumented, but is
> > essentially a default way to set up a local proxy, similar to the on in
> > examples/proxy.cgi, to allow you to load off-site data.
> >
> > It's set to /proxy/?url= currently -- the reason for this is that at
> > OpenLayers.org, we have a Proxy running there, and we wanted the
> > /dev/examples URLs to work as you would expect them to.
> >
> > I've opened ticket 112 to change this in Subversion, but we'll need to
> > change the examples to work as well. For the time being,
> > OpenLayers.ProxyHost = ''; before you add the layer will allow things to
> > work as you expect. I hope. :)
> 
> I tried OpenLayers.ProxyHost, it got rid of the alert box but I don't get my 
> markers showing up, even though I seem to have used the version of GeoRSS 
> which the GeoRSS layer reads and interprets.

The URL being loaded is:
http://nick.dev.openstreetmap.org/openlayers/markers.php

As you can see by looking at it, there's no content there.

GeoRSS layers are not tiled, since there's no specification on how to
get data within an area. So, you'll need to specify the area that you're
interested in in the RSS request. You can use map.getExtent().toString() 
(I think?) to get teh bounding box of the current map view, although
updating that every time the map moves might be difficult.

If it were me, I'd implement a sub-class of OpenLayers.Layer.GeoRSS
which is also a sub-class of OpenLayers.Layer.Grid, and follow a similar
way of doing things to Layer.WFS, which is a tiled XML Layer...

Alternatively, you could just have the GeoRSS be for the whole world.

If the current stuff in OpenLayers doesn't meet your needs, can you
explain how we might try to meet them better? I'm not sure what you
expect out of the RSS, but I'd like to meet your needs if we can.

-- 
Christopher Schmidt
Web Developer


More information about the Users mailing list