[OpenLayers-Users] Need advice regarding styling vector points
Arnd Wippermann
arnd.wippermann at web.de
Sat Mar 7 17:46:59 EST 2009
Hi Zer,
In the example of the first post, I create the unique rules always new after
a checkbox change.
There could be the possibility to change the visibility of the style of
features using display:"none" or display:"" without modifing the other style
attributes. For OL 2.7 it works only with patch
http://trac.openlayers.org/ticket/1898.
But i have no idea, how to add this to a specific rule.
Arnd
-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Zer
Gesendet: Samstag, 7. März 2009 22:51
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Need advice regarding styling vector points
Arnd Wippermann wrote:
>
> Hi
>
> you can use rules with OpenLayers.Filter.Comparison.BETWEEN
>
> var aStyleMap = new OpenLayers.StyleMap();
>
> var rules = [];
> rules.push(new OpenLayers.Rule({
> symbolizer: {fillOpacity:0,
> pointRadius:3,strokeWidth:2,strokeColor:"aquamarine"},
> filter: new OpenLayers.Filter.Comparison({
> type: OpenLayers.Filter.Comparison.BETWEEN,
> lowerBoundary : 1,
> upperBoundary : 3,
> property: "popclass"
> })
> }));
> rules.push(new OpenLayers.Rule({
> symbolizer: {fillOpacity:1,
> fillColor:"FFAAAA",pointRadius:5,strokeWidth:2,strokeColor:"red"},
> filter: new OpenLayers.Filter.Comparison({
> type: OpenLayers.Filter.Comparison.BETWEEN,
> lowerBoundary : 10,
> upperBoundary : 11,
> property: "popclass"
> })
> }));
> rules.push(new OpenLayers.Rule({
> symbolizer: {fillOpacity:0,
> pointRadius:5,strokeWidth:2,strokeColor:"FF8000"},
> elseFilter: true
> }));
>
> aStyleMap.styles["default"].addRules(rules);
> vectorLayer.styleMap = aStyleMap;
> vectorLayer.redraw();
>
> Arnd Wippermannn
>
>
Thanks Arnd! That's a good start to show all features. But how do I do when
the users selects (using radio buttons) to only show features in one of
those groups, i.e. with "popclass" 1-3? Do I create 3 different stylemaps if
I have a 3 radiobuttons? Or is there a better way to do it?
-Z
--
View this message in context:
http://n2.nabble.com/Need-advice-regarding-styling-vector-points-tp2441146p2
442145.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list