[OpenLayers-Users] Zoom to dinamic WMS Layer

Gilberto Ramos sdjbm17 at gmail.com
Fri Jul 23 09:20:17 EDT 2010


Hi people, how are you doing?

I'm having troubles to find the way to zoom to a polygon WMS layer that is
dinamically filtered.. 

Let's put this on an example:
You have the USA states map and you have an ID for each state; you define
your WMS layer to something like this:

    var stateID = funcToGetFromURLParam("stateID");

    states = new OpenLayers.Layer.WMS(
        "States", "http://server:8080/geoserver/wms",
        {
            transparent: 'true',
            layers: 'Workspace:states',
            srs: 'EPSG:4326',
            format: 'image/png',
            filter:
"<Filter><PropertyIsEqualTo><PropertyName>ID</PropertyName><Literal>"+stateID+"</Literal></PropertyIsEqualTo></Filter>"
        });
    map.addLayer(states);

How would you zoom to this layer (to it's maximum extension, to it's
bounderies.. got what I tried to say?) after is filtered and loaded? I tried
in so many ways but I could not. :S

Thanks for your time folks!

Best regards,

Gilberto Ramos

-----
"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life.
For God sent not his Son into the world to condemn the world; but that the
world through him might be saved.
He that believeth on him is not condemned: but he that believeth not is
condemned already, because he hath not believed in the name of the only
begotten Son of God." John 3:16-18
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Zoom-to-dinamic-WMS-Layer-tp5329527p5329527.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list