I have added WMS layers using follow:
basemap = new OpenLayers.Layer.WMS( "Layer Name1",
"http://localhost:8080/geoserver/wms/workspacename", {layers: 'workspacename:layername'} );
utility = new OpenLayers.Layer.WMS( "Layer Name2",
"http://localhost:8080/geoserver/wms/workspacename", {layers: 'workspacename:layername', transparent:"true"}, {isBaseLayer:false} );
Now I want to get zoom to my utility layer, How can I?
I have tried as following:
map.zoomToExtent(utility.getDataExtent());
No comments:
Post a Comment