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.
أكثر...
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.
أكثر...