Auto zoom&center in GoogleMap Control 6.0

Jan 17, 2012 at 3:52 PM

Hi,

is there a way to center and zoom the map in GoogleMap Control 6.0

after adding Markers in the codebehind?

The solutions here with javascript don´t work.

Thanks,

sullrich


Feb 1, 2012 at 8:59 AM

Mhh, I thought that this is a common task that someone else had solved....

Please, if anyone has an idea, please let me know.

Regards

Feb 8, 2012 at 12:53 AM

GoogleMap1.Center = new LatLng(40, 32);
GoogleMap1.Zoom = 7;

Feb 9, 2012 at 9:39 AM

The problem is that I don´t know which values the Center and Zoom must have to show

all added markers.

That´s what I mean with "auto" like "automatic" in the title.

Feb 9, 2012 at 12:09 PM

It's up to you. You can calculate the center of all markers and set the zoom level to default values for example.

Feb 9, 2012 at 3:49 PM

Sure, but the GoogleMap API provides functions to calculate this things....

It´s shown here : http://googlemap.codeplex.com/Thread/View.aspx?ThreadId=61576

how to do it with javascript, but that doesn´t work for me....Maybe the example uses the API2 ?