Map Scripting


Create Location-based Web Applications

Chapter 5: Handle Map Events

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.

Map drag event looks for the map leaving an area

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.

Category: Book updates


51 Responses

  1. luis says:

    simpsons@paulah.adversary” rel=”nofollow”>.…

    tnx for info!…

Leave a Reply

Adam DuVanderHi, I'm Adam. I'm writing a book about developing maps on the web. This site is where I'll share the things I find and help you create your own maps. Find out more.

Map Scripting 101