AW: [OpenLayers-Users] Re: how to style vector layer points from valuesof GeoRSS tag?

Arnd Wippermann arnd.wippermann at web.de
Sat Aug 6 05:53:35 EDT 2011


Hi,

most likely OpenLayers GeoRSS reader doesn't parse for the attribute
"magnitude".

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von fabiowebby
Gesendet: Samstag, 6. August 2011 01:50
An: users at openlayers.org
Betreff: [OpenLayers-Users] Re: how to style vector layer points from
valuesof GeoRSS tag?

Hi Marc,
thank you very much for your reply. I tried to follow the tutorial you
posted but unfortunately it does not work. now I cannot see the points
anymore. I came up with the following code:

var map = new OpenLayers.Map("map");

var style = new OpenLayers.Style();

var ruleLow = new OpenLayers.Rule({
  filter: new OpenLayers.Filter.Comparison({
      type: OpenLayers.Filter.Comparison.LESS_THAN,
      property: "magnitude",
      value: 3,
  }),
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "black"} });

var ruleHigh = new OpenLayers.Rule({
  filter: new OpenLayers.Filter.Comparison({
      type: OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,
      property: "magnitude",
      value: 3,
  }),
  symbolizer: {pointRadius: 20, fillColor: "red",
               fillOpacity: 0.7, strokeColor: "black"} });

style.addRules([ruleLow, ruleHigh]);

var vector_style_map = new OpenLayers.StyleMap({
	'default': style
	
});

var google_hybrid = new OpenLayers.Layer.Google("Google Hybrid",
		{type: google.maps.MapTypeId.HYBRID});

var earthquakes = new OpenLayers.Layer.Vector("Earthquakes", {
	strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "files/test.xml",
        format: new OpenLayers.Format.GeoRSS()
    })
});

map.addLayers([earthquakes,google_hybrid]);

map.zoomToMaxExtent();

earthquakes.styleMap = vector_style_map;

Could you please tell me what I am doing wrong? Could it be because the
magnitude tag values are decimal point numbers(3.25,2.77 etc)?

Thank you very much in advance 

Regards
Fabio 

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/how-to-style-vector-layer-points-from
-values-of-GeoRSS-tag-tp6655038p6658469.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list