Sep 17, 2010
This is part of a series looking at all 10 chapters of Map Scripting 101.
Easily one of the features most often overlooked by map mashups is the ability to tap into the map’s interactivity. I gave it an entire chapter in the book in hopes of encouraging you to “listen” for events in your applications.
For example, you can help your users identify a location by reacting to a map click. In fact, in chapter 4 I showed an example where the user can draw a line by connecting clicks.
Just as useful is knowing when the user moves or zooms the map. Then you can change what data you’re showing based on the new location or boundaries. Another use case I show for these events is to find out whether the user has moved outside pre-set bounds, such as Yellowstone National Park.
Other events covered include marker clicks, adding markers/polylines and opening/closing a message box. Use them and react to your user’s movements.