Thursday 26 February 2015

openlayers 2 - Zooming the map after filter


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?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...