[OpenLayers-Users] Advanced georss management

Christopher Schmidt crschmidt at metacarta.com
Fri Mar 21 09:45:56 EDT 2008


On Fri, Mar 21, 2008 at 06:58:22AM +0100, simone.gadenz at jrc.it wrote:
> Hi all!
> 
> I need to set up an advanced GeoRSS management in one of our viewer. In
> other words the user should be able to load an URL and decide the rendering
> according to a tag he/she decides.

Cool.

> I started from the example and have extended the geoRSS reader to accept
> all possible GeoRSS geographic tag format (according to Georss.org) for
> point elements. Now I try to understand what is the best way to extend the
> support to lines and polygons. The problem is mainly related to what kind
> of OL's layer (vector?) I should use to better manage the symbology of such
> types. 

Yeah, unfortunately, starting from the GeoRSS layer here was probably
not the right way to go. :) The right thing to do is probably to create
a Layer.GML, with a format; set to Format.GeoRSS. This automatically
gets you support for GeoRSS Simple, GeoRSS GML, and the W3C geo parsing:
I believe that this support is complete, covering all aspects of the
specification.

The next thing to do (which may already be done: I can't remember) would
be to extend the parsing so that it also picks up 'tags', and makes
those as feature attributes.

Then, you would create a StyleMap object: In it, you would define two
styles (I think): a Default one, and one for selection. You can either
build up rules to calculate a property based on your attributes -- or,
if the attribute maps directly to something like a filename (for
example, all items in the 'hospitals' category will use 'hospitals.png')
you can use a Style object without any rules, and simply use attribute
interpolation:
{
  externalGraphic: "/images/${category}.png",
  width: 20,
  height: 20  
}

These developments are all recent: trunk only, rather than 2.5, I
believe. So for these developments, I highly recommend using trunk. 

I don't really know the specifics of this: Andreas and Tim Schaub have
been working hard on it, and they probably know much more.

Once you do this, you should create a selectfeature control on your
layer, and use the
http://openlayers.org/dev/examples/select-feature-openpopup.html example
to see how to assign the selectfeature control to open a popup when you
select a feature on the layer. You can then craft your GeoRSS popup in
any way you want. 

> As long as symbology is concerned the first idea is to create a repository
> of marker symbols on our server and to let the user manage the association
> among tag field values and symbols in an interface that will open before
> rendering the data.

That's cool. I think this interface is essentially one to design your
Styles / Rules.

Please feel free to continue to discuss your development here: If you
want more immediate feedback, you may even want to consider doing your
development in an OpenLayers sandbox, where other developers will be
able to see and work with the code more easily.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list