This project is read-only.

accessing Google map control from javascript

Apr 4, 2012 at 7:44 AM

I have read the topic on this and I saw that to do this, I will have to do something like ..

var map =
maps will be the namespace right? but where do I declare this namespace. I can't seem to use the maps namespace.

Apr 4, 2012 at 8:59 AM


You don't need to declare the namespace, it's done by the GoogleMap control javascript code.
It is more like a prefix, if we want to be precise, than a namespace. 

For example:
Let's say you have a GoogleMap control on your ASP.NET page with ID="GoogleMap1".

In older version you had access to the client side (JS) Artem GoogleMap control wrapper just by referring:
var map = GoogleMap1;

In version 6.0, I have added that prefix (namespace) on order to separate from "global mess".
So, you can access the client side GoogleMap control object by:
var map = maps.GoogleMap1;

Hope that helps.

Apr 4, 2012 at 6:00 PM

Ah. I see. OK thx. Just another quick question.

I would like to change, lets say the address of the map from javascript. How should I go about doing this to get the changes reflected on the server side?

For example, I tried to do this,

var map = maps.GoogleMap1;
//it seems map.address = "my new address" works too
map.set_address("my new address");
and over at the server side

address = GoogleMap1.Address
I'm currently not getting the new address.