How to set center point of the map?

Sep 16, 2009 at 4:32 PM

Hi!

I am using this map control in ajax tab control and I've multiple tabs, in 1 of which I've map. If I use the map outside the tab control then it works fine and show the marker at the center of the map but if I use it in tab control then it shows the marker at top left corner of the map. How it is so? and how can I set it to the center of the page in tab control?

 

Thanks

Coordinator
Sep 17, 2009 at 5:56 AM

Hi,

Get the SampleWebsite and check out the page /map/InTabPanel.aspx.
You can find it online at: http://googlemap.artembg.com/map/InTabPanel.aspx

The idea is simple: when map is inside a non visible elelemt (most probably a div with CSS display:none) it is not rendered in a correct size.
So, you should invoke the map's checkResize function just after the element becomes visible and then map can check size of it and render out properly.

Regards

Sep 17, 2009 at 10:13 AM

The idea is simple: when map is inside a non visible elelemt (most probably a div with CSS display:none) it is not rendered in a correct size.
So, you should invoke the map's checkResize function just after the element becomes visible and then map can check size of it and render out properly.

Hi!

Thanks for your reply but there is some problem I am facing while doing something like in the sample available in the link you sent to me. The problem is that I am getting an error on tab changed event now that object doesn't support this property or method. It can't find checkResize() Method. There is no such method available. I can't find this method for map in my code behind too. Can you please guide me a little?

Thanks

Coordinator
Sep 17, 2009 at 1:22 PM

Hi,

Check out this post: http://googlemap.codeplex.com/Thread/View.aspx?ThreadId=51887

Regards