try this: var new_cent = map.zoomToExtent(bounds.getCenterLonLat());
Arnd _____ Von: [email protected] [mailto:[email protected]] Im Auftrag von Nicholas Efremov-Kendall Gesendet: Donnerstag, 23. Juni 2011 19:25 An: [email protected] Betreff: [OpenLayers-Users] re set map center,or specify zoom level with mapzoomtoextent Hi all, wanted to solicit some advice from the community. I'm working on a simple dynamic app I wanted to ask about the best method to approach this. the app sets an arbitrary point, which I suppose could simply be changed to zoomtomaxextent, but re-centers the map once the user has agreed to opt-in to being geolocated. The issue is that the bounds of the single marker are much smaller than the 50km search radius of the script var bounds = marker.getDataExtent(); map.zoomToExtent(bounds); I don't want the map to recenter the bounds with every additionally added point (nearby tweets), which I feel contributes to a poor UI. How could I get the centerlonlat of the marker layer? I'm trying this method and it isn't working var bounds = marker.getDataExtent(); var new_cent = map.zoomToExtent(bounds).getCenterLonLat(); map.setCenter(new OpenLayers.LonLat(new_cent).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject()),2);
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
