Center on the selection
var selection = ""; $.each(W.selectionManager.getSelectedFeatures(), function(indx, section){ selection = section; }); var lon=((selection.model.attributes.geometry.bounds.right-selection.model.attributes.geometry.bounds.left)/2)+selection.model.attributes.geometry.bounds.left var lat=((selection.model.attributes.geometry.bounds.top-selection.model.attributes.geometry.bounds.bottom)/2)+selection.model.attributes.geometry.bounds.bottom var mapCenter = new OL.Geometry.Point(lon,lat); var currentlocation = (new OpenLayers.LonLat(mapCenter.x,mapCenter.y)).transform(projI,projE).toString().replace(',','&');