automatically zoom map to maximum extent of wms layer

المشرف العام

Administrator
طاقم الإدارة
I try to automatically zoom map to maximum extent of layer after adding layer to map. I tried to code like this.

var layer = OpenLayers.Layer.WMS(.......);

map.addLayer(layer);

map.zoomToExtent(layer.getDataExtent());

But it doesnt' work. I also changed like this

map.zoomToExtent(layer.getMaxExtent());

It still doesn't work. What can I do to solve this issue.



أكثر...
 
أعلى