This application uses Google Maps API version 2. The same tool with Version 3 is here.
This is the tool I use to create overlays for my Google API maps. I use it to draw polyline,
polygon, circle and polygon with hole on my Google map. It is also a marker tool.
In the drawing process I may delete and edit points and lines. Style management
is available with the 'Style options' button. Polygon colour, line colour, line thicknes, opacity may be changed.
The coordinates for the overlay are written inside KML text, ready to be
copied and saved in a KML file. I can also choose to let the tool present only the KML coordinates,
without the KML elements. And I can also switch to the Google Maps API JavaScript code for the overlay.
The map registers mousemove and presents the coordinates of the mouse position.
Zoom level is shown when zoom is changed.
Examples of my use of Google Maps API with KML
Southern Cassowary distribution
Little Spotted Kiwi distribution
You may draw paths, routes, directions with this application. Choose Combinations in Draw mode. One of the options there use GDirections.
The OpenStreetMap map type has been added to the Google Maps map types. It has been embedded as a layer within the Google Map. This will in many parts of the world give you map tiles with more details than the default Google Maps tiles.
If a coastline is part of the shape you want to create, you may use templates and build on them
Build Google maps polylines and polygons from templates
Here are some other tools and helpers I have made
| Smaller map tool | Marker tool, KML, coordinates |
| Edit Google Maps KML file | Custom overlay for Google Maps |
| Google Maps API v3 tool | Reading a KML file |
I use "new GPolygon.fromEncoded" to present polygons with holes
on the map. To do the encoding, I use PolylineEncoder.js provided by
Mark McClure.
Choose Code text Javascript when you have finished a polygon with hole if you want to see
the javascript for "new GPolygon.fromEncoded".
To draw a polygon with a hole with this application: Click "Holes" and follow the instructions.
Draw a closed shape in Polyline draw mode. Draw a (closed) shape within (if you want a hole, but it is possible to draw the
second shape outside or overlapping). Choose Polygon draw mode to view the result.
The Google Maps API was not compatible with IE8. This has been filed as a bug in
http://code.google.com/p/gmaps-api-issues/issues/detail?id=1055
and
http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=362142
Problem description
The problem is that the 'click' event in Google Maps API do not behave in IE8 the way it does in other
browsers. There are workarounds. The 'mousemove' event in Google Maps API returns the correct
position in IE8. In this application I register the mouse position when the map is clicked and use
that instead of the clicked position. Thus, IE8 works fine with my google maps tool.
Update
5. January 2010: There is a message in the google thread above that the bug has been fixed.
I have changed the code in my application. There is no special treatment for IE8 now in the code.