Desperately seeking Javascript help

Andy Wardley abw at
Sat Jul 18 18:41:00 BST 2009

David Cantrell wrote:
> Can anyone point me at a tutorial which will show me how to put a map in
> a page, point it at my own map tiles, and Just Work?


It's not a tutorial but it shows the 20 or so lines of code you need to
create a custom tile overlay in a google map.  It's based on the example in
the google maps docs:

You'll also need a <script> tag in the page header to load the google maps
library and something to call show_map() when the documents loads.  You can
do that with <body> attributes like this:

   <body onload="show_map();" onunload="GUnload();">

Or using jQuery, like this:


Then all you need to do it write your own function to return the correct
map tile for the lng/lat/zoom:

     tiles.getTileUrl = function(point,zoom) {
	// return a URL for the tile image at point.x, pointy at
         // zoom level zoom


More information about the mailing list