[OpenLayers-Users] Visibility of features in vector layer
Eric Lemoine
eric.lemoine at camptocamp.com
Wed Jul 8 13:01:00 EDT 2009
On Wednesday, July 8, 2009, Paul Spencer <pagameba at gmail.com> wrote:
> Eric,
>
> On 8-Jul-09, at 9:25 AM, Eric Lemoine wrote:
>
>
> On Wednesday, July 8, 2009, Matthew Doyle <M.Doyle at bom.gov.au> wrote:
>
>
> Hello all,
>
> Sorry for resurrecting this topic, but i am having trouble getting my
> features to "remember" which StylemMap they have been changed to, using the
> renderIntent.
>
> After following Heidtmare's suggestions below, my WFS layer is now showing
> and hiding features on the fly using the renderIntent and then calling
> drawFeature, as follows:
>
> for(var i = 0; i < WFSLayer.features.length; i++) {
> WFSLayer.features[i].renderIntent = "hidden";
> WFSLayer.drawFeature(WFSLayer.features[i]);
> }
>
> This works great, right up until i zoom the map or move to a different
> extent. Each feature goes back to their "default" renderIntent and the
> features are shown once again.
>
> How can i force a permanent change for each feature so that when the user
> zooms it remembers what changes have just been made?
>
>
> Hi
>
> You can use the "style" property. E.g.
>
> feature.style = OpenLayers.Feature.Vector.style["delete"];
>
>
>
> why does the renderIntent approach not work? It does work for controls like SelectFeature. From what I see in the code, the renderIntent of the feature is changed in createSymbolizer called from drawFeature, which should use the renderIntent of the feature (in this case, 'hidden'). Unless the style map doesn't contain a 'hidden' style, in which case it would default back to ... um ... 'default' :)
I agree with your reasonning Paul - setting feature.renderIntent to
"delete" should work equally.
>
> Paul
>
>
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list