Crosspost: Make your map interactive with shape editing and drawing tools

Cross­pos­ted from Google Geo Developers Blog

With a paper map, you can truly make it your own by get­ting out a pen or a pen­cil, and adding your own annota­tions to it. You could circle all the museums that you want to vis­it, or trace the route that you will take on your road trip.

Maps API applic­a­tions can now offer users this sort of tact­ile inter­activ­ity using the new Draw­ing Lib­rary. The Draw­ing Lib­rary provides a tool­box which enables users to draw mark­ers, lines, and shapes on the map, much as they would in any draw­ing applic­a­tion. The tools can be used for col­lect­ing annota­tions from users, or for select­ing regions to search or high­light. Applic­a­tions can listen for events when over­lays are added and respond accord­ingly, such as issu­ing the search query or sav­ing the annota­tions to a data­base.

Shapes on a map, includ­ing shapes users have just drawn using draw­ing tools, can also be made edit­able so that users can modi­fy or cor­rect them. For example, the user could change the bounds for a geo­spa­tial query with the drag of a mouse. The Poly­line, Poly­gon, Circle, and Rect­angle classes have a new edit­able prop­erty, which toggles the vis­ib­il­ity of con­trol points on these shapes.

For more inform­a­tion on using the draw­ing lib­rary and edit­able shapes, please refer to the Maps API doc­u­ment­a­tion. The Maps API for­um is a great place to dis­cuss these new fea­tures, or raise any oth­er Maps API issues that you may have. We hope that these new fea­tures will res­ult in even great­er inter­activ­ity for applic­a­tions built on top of the Maps API.