Hi all,<div><br></div><div>wanted to solicit some advice from the community. I&#39;m working on a simple dynamic app I wanted to ask about the best method to approach this.</div><div><br></div><div>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</div>


<div><br></div><div><div>var bounds = marker.getDataExtent();</div><div>map.zoomToExtent(bounds);</div></div><div><br></div><div>I don&#39;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&#39;m trying this method and it isn&#39;t working</div>

<div><br></div><div><div>var bounds = marker.getDataExtent();</div><div>var new_cent = map.zoomToExtent(bounds).getCenterLonLat();</div><div>map.setCenter(new OpenLayers.LonLat(new_cent).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;),map.getProjectionObject()),2);</div>
</div><div><br></div><div><br></div><div>
</div>