[fusion-users] Hiding layers and clearing the selection at the same time.

Paul Spencer pspencer at dmsolutions.ca
Thu Jan 8 07:05:52 EST 2009


Ari,

I would try reversing the logic and hide the layers first with no  
redraw, then clear the selection (which triggers a redraw).  drawMap  
should then pick up the changes in the layer visibility.

Cheers

Paul

On 8-Jan-09, at 6:16 AM, Ari Þórðarson wrote:

> Hello everybody
>
> I would like to hide many layers and clear the selection in the map  
> at the same time.
> Does anyone have an idea how this could be accomplished.
>
> If I call these two functions the selection in the map is cleared  
> but the layers are not hidden.
>
> this.getMap().getAllMaps()[0].clearSelection();
> this.getMap().getAllMaps()[0].sneHideLayers(layers, false);
>
> The function sneHideLayers was added by us here at Snertill Iceland  
> and it hides many layers
> in the same request.  It was added inside MapGuide.js and it looks  
> like this:
>
> sneHideLayers: function( layers, noDraw ) {
>                 for (var i = 0; i < layers.length; i++) {
>                                this.processLayerEvents(layers[i],  
> false);
>                                 
> this.aHideLayers.push(layers[i].uniqueId);
>                 }
>                 if (!noDraw) {
>                                this.drawMap();
>                 }
> },
>
> Greetings, Ari
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://research.dmsolutions.ca/



More information about the fusion-users mailing list