Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have wms layer and after i do cql filter on this. And now i want to see result. I want map zoomed to this result. My code.

ex=layer.getExtent();
map.zoomToExtent(ex);

But getExtent() returns wrong bounds. In Geoserver i have layer settings

Native SRS=70066
Declared SRS=900913
Reproject native to declared

In OL when create map i write projection: EPSG 900913;

What im doing wrong? I ll try do transformation

ex=layer.getExtent().transformation(map.projection, map.displayProjection);

projection=70066 displayProjection=900913

But it nothig to change.

Maybe im gonna do it whis Capabilities?

share|improve this question
    
possible duplicate of How to zoom map after CQL_Filter? –  iant May 18 '12 at 9:16
    
yes, i was read this. But there another way to solve this problem. If this is possible i want use getExtent. –  Kliver Max May 18 '12 at 9:19
    
see my answer to the linked question. –  iant May 18 '12 at 9:20
    
My english is bad, but if im understad u its mean that im gonna do WFS layer and use getDataExtent()? –  Kliver Max May 18 '12 at 9:25
2  
that's right a WMS Layer is jsut a picture and it has the bounds that you have set in the request –  iant May 18 '12 at 9:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.