Tuesday, November 15, 2011

Make your map interactive with shape editing and drawing tools

With a paper map, you can truly make it your own by getting out a pen or a pencil, and adding your own annotations to it. You could circle all the museums that you want to visit, or trace the route that you will take on your road trip.

Maps API applications can now offer users this sort of tactile interactivity using the new Drawing Library. The Drawing Library provides a toolbox which enables users to draw markers, lines, and shapes on the map, much as they would in any drawing application. The tools can be used for collecting annotations from users, or for selecting regions to search or highlight. Applications can listen for events when overlays are added and respond accordingly, such as issuing the search query or saving the annotations to a database.

Shapes on a map, including shapes users have just drawn using drawing tools, can also be made editable so that users can modify or correct them. For example, the user could change the bounds for a geospatial query with the drag of a mouse. The Polyline, Polygon, Circle, and Rectangle classes have a new editable property, which toggles the visibility of control points on these shapes.



For more information on using the drawing library and editable shapes, please refer to the Maps API documentation. The Maps API forum is a great place to discuss these new features, or raise any other Maps API issues that you may have. We hope that these new features will result in even greater interactivity for applications built on top of the Maps API.