[OpenLayers-Users] FramedCloud GEORSS support

Simone Gadenz simone.gadenz at jrc.it
Wed Apr 2 10:18:12 EDT 2008


My 2 cents:

I load the GeoRSs through a GML layer using a GeoRSS format. I modified a
bit the GeoRSS format class to give the user the possibility of defining the
field he wants to use for symbolizations.

This is the html that works for me:

var in_options = {
             'internalProjection': new OpenLayers.Projection("EPSG:900913"),
             'externalProjection': new OpenLayers.Projection("EPSG:4326"),
             'type':'eventType alertLevel'
        };
        
        // create a GeoRSS layer
        // Inorder to accomodate all the possible geometry type the layer
must be a GML layer with a GeoRSS format
        // defining styles
 	    var styleMap = new OpenLayers.StyleMap({
                fillOpacity: 1,
                pointRadius: 10
            });
        // create a lookup table with different symbolizers for 0, 1 and 2
        var lookup = {
            EQGreen: {externalGraphic: "images/eqgreen.jpg"},
            EQOrange: {externalGraphic: "images/eqorange.jpg"},
            EQRed: {externalGraphic: "images/eqred.jpg"},
            TCGreen: {externalGraphic: "images/tcgreen.jpg"},
            TCOrange: {externalGraphic: "images/tcorange.jpg"},
            TCRed: {externalGraphic: "images/tcred.jpg"},
            FLGreen: {externalGraphic: "images/flgreen.jpg"},
            FLOrange: {externalGraphic: "images/florange.jpg"},
            FLRed: {externalGraphic: "images/flred.jpg"},
            VOGreen: {externalGraphic: "images/vogreen.jpg"},
            VOOrange: {externalGraphic: "images/voorange.jpg"},
            VORed: {externalGraphic: "images/vored.jpg"}
        }
        // add rules from the above lookup table, with the keyes mapped to
        // the "type" property of the features, for the "default" intent
        styleMap.addUniqueValueRules("default", "type", lookup);
 	    var georssformat = new OpenLayers.Format.GeoRSS(in_options);
        var gmllayer = new OpenLayers.Layer.GML("GDACS Alerts", "RSS.xml",
{'format': georssformat, styleMap: styleMap});

Hope this helps!


Simone




More information about the Users mailing list