Sunday, August 27, 2006

The GMap.Net control very cleverly handles Google Map API client side Javascript events. The website developer using the code can easily add a delegate to the Event Handler for any Google Map event (I have implemented all the events now, and not just the select few that were available in the first version of the Control - the latest source code is available, as always on Subversion from our project page on SourceForge.Net) This means that any Javascript event can be handled by Server side code - now that is neat.



To aid any custom control developers who may interested in how this happens, I have drawn up an informal flow chart showing what happens when a Google Map event is raised (green blob). The event can also be given a javascript delegate, allowing the website developer the option of client side Javascript event handling (orange dot) or server side ASP.NET event handling (black dot for website code, and red dot where instructions are passed back to the API).

I hope the diagram helps, it certainly got it sorted a little more clearly in my head!



I also upgraded the old method of databinding from a data source to the Google Map API in ASP.NET - I created a whole namespace of helper classes for each of the objects, markers, infowindows etc.. So it is now much easier (or more straightforward) to add any type of information from a data source directly to a Google Map.

1 comment:

Sten Hougaard said...

Hi,

I find it very inspiring what I read on your blog! Thank you!

But the reason why came across your blog is that I was trying to get "Google Maps .Net Control" up and running... that I failed to do..

I downloaded the code, but got errors when trying to run the code from VS2005.

As the code seems to be old, can you please supply me with an up-to-date URL to the code for the control, please..?

Thank you!

/Sten Hougaard
www.netsi.dk