Bachchans at Mukesh Ambani’s party

Bollywood-Hollywood

Aishwarya Rai Bachchan along with Amitabh and Jaya Bachchan and sister-in-law Shweta Nanda attended the book launch of Ash’s favourite designer duo Abu Jani and Sandeep Khosla at Antilla, Mukesh and Neeta Ambani’s bungalow in Mumbai on Saturday.

The designer duo launched their book India Fantastique.

Image: Aishwarya Rai Bachchan, Amitabh and Jaya Bachchan and Shweta Nanda

Advertisements

We are all taken aback at VVS Laxman’s decision

Sports

Local hero VVS Laxman’s retirement just ahead of the Test series against New Zealand beginning in Hyderabad on Thursday has lessened the general interest level among common people.

The Rajiv Gandhi stadium at Uppal wore a desolate look with little interest seen among the locals as Team India practised in the morning followed by the visitors’ session in the afternoon.

If the Hyderabad Cricket Association officials had earlier sounded unhappy for not being able to see Laxman one last time, the curator Y L Chandrashekhar too became emotional.

“We are all taken aback at his decision… He prepared so hard, slammed two centuries recently one being at the Gymkhana ground the wicket of which I had prepared… But we all are sad that he would not be playing here. He would have loved to play on this strip,” Chandrashekhar told PTI.

Day 6: Torch Relay visits Gloucester Cathedral and Severn Valley Railway

Sports

Day 6 of the Olympic Torch Relay will see the Flame pass a number of iconic landmarks including Gloucester Cathedral.

It will also travel along the Severn Valley Railway, carried on the train from Bewdley to Kidderminster by 43-year-old Christopher Stokes from Kidderminster.

Among the day’s other Torchbearers will be Olympian Sharron Davies, carrying the Flame in Leominster in recognition of her swimming career.

Stuart Woodburn, 30, a teacher from Worcestershire will also carry the Flame. A Torchbearer through Ledbury, Stuart was nominated through the LOCOG campaign for the way he supports and inspires everyone at the school, especially in sport.

The Evening Celebration will take place at Worcester County Cricket Ground from 4pm. The event will feature a variety of entertainment staged by LOCOG and the three Presenting Partners of the London 2012 Olympic Torch Relay – Coca-Cola, Lloyds TSB and Samsung.

Towards the end of the two-hour show, the last Torchbearer of the day – Sally Flood, from Bromsgrove who was nominated for her charity work – will light a celebration cauldron on stage at the event which will enable the Olympic Flame to be seen by the audience.

On Day 6 the Flame will be carried through the following communities:
Gloucester, Maisemore, Hartpury, Corse and Staunton, Ledbury, Bartestree, Lugwardine, Hereford, Leominster, Ludlow, Clee Hill, Cleobury Mortimer, Far Forest, Callow Hill, Bewdley, Kidderminster, Droitwitch Spa, Fernhill Heath and Worcester.

Cutest Attraction of a Zoo

Lifestyle-City

The four one-day-old cubs, with mom Sumba, have become the Belgrade Zoo’s biggest attraction.

Day-old white lion cubs lie next to their mother Sumba in their enclosure at Belgrade’s Zoo December 21, 2011. The four white lions cubs, an extremely rare subspecies of the African lion, have become the zoo’s greatest attraction. Another four white lion cubs were born in April earlier this year.

Karan Johar hits back at Priyanka Chopra

Bollywood-Hollywood

After Priyanka Chopra’s friends hit back at star wives (read: Gauri Khan) in a section of the press, it is now Gauri’s pals to do so. Her buddy Karan Johar took to his micro-blogging site to vent out his anger.

 

He states, “Using their hired PR machinery and hiding behind so called ‘friends’ to get news into tabloids is nothing but spineless and lame!! Some people need to wake up and smell the KOFFEE!!! Get a reality check before it’s too late!!! Grow up!!! and don’t mess with goodness.”

 

NB: You don’t have to be a rocket scientist to figure out who he is referring to. It’s obviously Priyanka.

Reportedly some star wives and a producer-director had launched a nasty campaign against PC. Wonder what Piggy Chop’s friends have to say to KJo now? Tee hee!

Resources

Google Maps API Tutorial

How GLayers Work

When you add GLayer()s to your map, the API creates something like a GTileLayerOverlay() onto the G_MAP_OVERLAY_LAYER_PANE (pane 1).

The images on the layer are not individual icons, they’re painted onto tiles. The tiles look like this:

and have URLs like:
http://mlt3.google.com/mapslt?lyrs=lmc:panoramio&x=2013&y=1318&z=12&w=256&h=256
http://mlt3.google.com/mapslt?lyrs=lmc:youtube&x=2013&y=1318&z=12&w=256&h=256
http://mlt3.google.com/mapslt?lyrs=lmc:wikipedia_en&x=2013&y=1318&z=12&w=256&h=256

If you have more than one GLayer() on your map, there’s still only one layer of tiles. The different types of content are all assembled onto the same set of tiles, like this:

with URLs like:
http://mlt1.google.com/mapslt?lyrs=lmc:panoramio,lmc:wikipedia_en,lmc:youtube&x=2013&y=1316&z=12&w=256&h=256

The order in which you addOverlay the GLayers onto the map controls the order in which the LMCs appear in the URL. The order of the LMCs within the URL controls the order in which the images overlap. In the above example, the panoramio images are on the bottom, then the wikipedia images, and the youtube images are on the top.

The tiles are normally palletized PNG files with 8 bits per pixel, if the beowser is MSIE they will be full colour PNG files with 32 bits per pixel. I guess that the API chooses the smaller 8-bit images if the browser environment supports it.

Clicks

GLayer()s reside below all other clickable overlays. Polygons and polylines reside on thge same pane, but at a higher z-index value. All other clickable overlays reside in higher panes.

If there’s a clickable overlay covering a particular point, then a click at that point will be grabbed by that overlay, and won’t reach the GLayer(). So, if you want the GLayer() to be clicked when below a semitransparent GPOlygon, you’ll need to make that GPolygon unclickable by using {clickable:false}

When the user clicks on a GLayer icon, the click does not trigger a map “click” event.

When the user right-clicks on the map while a GLayer() is present, the details returned by the “singlerightclick” event are those of the GLayer(), not those of the map.

As well as the images, the API receives information about the positions of the hot spots, which it uses for changing the cursor when you hover over a hot spot. This information is not accessible.

There doesn’t appear to be any way to programmatically trigger a click on a GLayer hot spot.

LMCs

All possible layers are identified by an LMC. The documented layers also have IDs. You can use either an ID or an LMC when you create your GLayer. E.g. GLayer(“lmc:panoramio/0”) is the same thing as GLayer(“com.panoramio.popular”). It’s a good idea to use the ID whenever you’re adding a documented layer, because Google just might change the details of undocumented features.

Resources

Google Maps API Tutorial

How It Works – Looking Inside the Dynamic HTML

The API Javascript is an engine that takes commands in the form of Javascript Method calls,
and manipulates a dynamic HTML element, the map container div.

I took a snapshot of the structure of the dynamic HTML of a simple page in Firefox.
I’ve saved a copy of the raw, uncommented, HTML code here
The page from which the snapshot was taken looks like this

The HTML would be slightly different in different browsers.
The API Javascript generates different HTML so that, as far as possible, the results look the same when displayed in those browsers.

I switched off SVG on the map, so that the polyline appears in the dynamic HTML.
With SVG enabled, the polyline doesn’t use any HTML.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google Maps</title>
</head>
    <link rel="stylesheet" type="text/css" href="noprint.css" title="Frame" media="print">
    <link rel="stylesheet" type="text/css" href="noscreen.css" title="Frame" media="screen">
<body>

This is the start of the map container div

<div id="map" style="width: 550px; height: 450px; position: relative; background-color: rgb(229, 227, 223);">

This is the start of the div that contains everything that moves as the map pans.
It contains the map tiles, markers, polylines, info windows and shadows.

  <div style="overflow: hidden; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;">
    <div style="position: absolute; left: 0px; top: 0px; z-index: 0; cursor: url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur), default;">
      <div style="position: absolute; left: 0px; top: 0px; display: none;">
        <div style="position: absolute; left: 0px; top: 0px; z-index: 0;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/transparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -moz-user-select: none;">
        </div>
      </div>

This contains the map tile images.

      <div style="position: absolute; left: 0px; top: 0px;">
        <div style="position: absolute; left: 0px; top: 0px; z-index: 0;">
          <img src="http://mt2.google.com/mt?n=404&v=ap.41&x=70&y=92&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -191px; top: -304px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt3.google.com/mt?n=404&v=ap.41&x=70&y=93&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -191px; top: -48px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt0.google.com/mt?n=404&v=ap.41&x=70&y=94&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -191px; top: 208px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt1.google.com/mt?n=404&v=ap.41&x=70&y=95&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -191px; top: 464px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt3.google.com/mt?n=404&v=ap.41&x=71&y=92&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 65px; top: -304px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt0.google.com/mt?n=404&v=ap.41&x=71&y=93&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 65px; top: -48px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt1.google.com/mt?n=404&v=ap.41&x=71&y=94&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 65px; top: 208px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt2.google.com/mt?n=404&v=ap.41&x=71&y=95&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 65px; top: 464px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt0.google.com/mt?n=404&v=ap.41&x=72&y=92&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 321px; top: -304px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt1.google.com/mt?n=404&v=ap.41&x=72&y=93&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 321px; top: -48px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt2.google.com/mt?n=404&v=ap.41&x=72&y=94&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 321px; top: 208px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt3.google.com/mt?n=404&v=ap.41&x=72&y=95&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 321px; top: 464px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt1.google.com/mt?n=404&v=ap.41&x=73&y=92&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 577px; top: -304px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt2.google.com/mt?n=404&v=ap.41&x=73&y=93&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 577px; top: -48px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt3.google.com/mt?n=404&v=ap.41&x=73&y=94&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 577px; top: 208px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt0.google.com/mt?n=404&v=ap.41&x=73&y=95&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 577px; top: 464px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt2.google.com/mt?n=404&v=ap.41&x=74&y=92&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 833px; top: -304px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt3.google.com/mt?n=404&v=ap.41&x=74&y=93&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 833px; top: -48px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt0.google.com/mt?n=404&v=ap.41&x=74&y=94&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 833px; top: 208px; width: 256px; height: 256px; -moz-user-select: none;">
          <img src="http://mt1.google.com/mt?n=404&v=ap.41&x=74&y=95&zoom=9" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 833px; top: 464px; width: 256px; height: 256px; -moz-user-select: none;">
        </div>
      </div>

This is G_MAP_MAP_PANE, pane number 0.
In earlier versions, the map tiles were in this pane, but now they have their own layer below the panes.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 100;">
      </div>

This is the unnamed pane number 1.
It contains the polyline image.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 101;">
        <img src="http://mt.google.com/mld?width=193&height=10&path=IImJ?%7DoR&color=0,0,255,140.25&weight=5" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 179px; top: 245px; -moz-user-select: none; z-index: 1000;">
      </div>

This is G_MAP_MARKER_SHADOW_PANE, pane number 2
It contains the marker shadow images.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 102;">
        <img src="http://www.google.com/intl/en_ALL/mapfiles/shadow50.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 266px; top: 191px; width: 37px; height: 34px; -moz-user-select: none; z-index: -4300000;">
      </div>

This is unnamed pane number 3

      <div style="position: absolute; left: 0px; top: 0px; z-index: 103;">
      </div>

This is G_MAP_MARKER_PANE, pane number 4
It contains the marker images.
Each marker is listed twice, once using the PNG image to be displayed on the screen.
Once using the GIF image to be printed.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 104; cursor: default;">
        <img src="http://www.google.com/intl/en_ALL/mapfiles/marker.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 266px; top: 191px; width: 20px; height: 34px; -moz-user-select: none; z-index: -4300000;">
        <img src="http://www.google.com/intl/en_ALL/mapfiles/markerff.gif" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 266px; top: 191px; width: 20px; height: 34px; -moz-user-select: none; z-index: -4300000;">
      </div>

This is G_MAP_FLOAT_SHADOW_PANE, pane number 5
It contains the info window shadow image.
As you can see, the info window graphics are quite complicated.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 105;">
        <div style="position: absolute; left: 219px; top: 118px; z-index: -4300000;">
          <div style="overflow: hidden; width: 70px; height: 30px; position: absolute; left: 29px; top: 0px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 1044px; height: 370px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 70px; height: 30px; position: absolute; left: 258px; top: 0px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -710px; top: 0px; width: 1044px; height: 370px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 70px; height: 60px; position: absolute; left: 0px; top: 30px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -3px; top: -310px; width: 1044px; height: 370px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 70px; height: 60px; position: absolute; left: 259px; top: 30px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -373px; top: -310px; width: 1044px; height: 370px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 140px; height: 60px; position: absolute; left: 70px; top: 30px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -470px; top: -310px; width: 1044px; height: 370px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; position: absolute; left: 99px; top: 0px; width: 159px; height: 30px;">
            <div style="overflow: hidden; width: 640px; height: 30px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -70px; top: 0px; width: 1044px; height: 370px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 29px; top: 30px; width: 360px; height: 280px; visibility: hidden;">
            <div style="overflow: hidden; width: 360px; height: 280px; bottom: -1px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: -30px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 288px; top: 30px; width: 360px; height: 280px; visibility: hidden;">
            <div style="overflow: hidden; width: 360px; height: 280px; bottom: -1px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -684px; top: -30px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 70px; top: 30px; width: 0px; height: 60px;">
            <div style="overflow: hidden; width: 320px; height: 60px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -73px; top: -310px; width: 1044px; height: 370px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 210px; top: 30px; width: 49px; height: 60px;">
            <div style="overflow: hidden; width: 320px; height: 60px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -73px; top: -310px; width: 1044px; height: 370px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 99px; top: 30px; width: 640px; height: 598px; visibility: hidden;">
            <div style="overflow: hidden; width: 640px; height: 598px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iws2.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -360px; top: -30px; width: 1044px; height: 370px; -moz-user-select: none;">
            </div>
          </div>
        </div>
      </div>

This is G_MAP_MARKER_MOUSE_TARGET_PANE, pane number 6
It contains the invisible click targets for the markers, so that the click targets are above the info window shadow.
In Firefox, the target is controlled by the image maps, such as “#gmimap0”, which are defined later.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 106;">
        <img usemap="#gmimap0" src="http://www.google.com/intl/en_ALL/mapfiles/markerTransparent.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 266px; top: 191px; width: 20px; height: 34px; -moz-user-select: none; z-index: -4300000;">
      </div>

This is G_MAP_FLOAT_PANE, pane number 7
It contains the info window.
As you can see, the info window graphics are quite complicated.

      <div style="position: absolute; left: 0px; top: 0px; z-index: 107; cursor: default;">
        <div style="position: absolute; left: 194px; top: 32px; z-index: -4300000;">
          <div style="overflow: hidden; width: 25px; height: 25px; position: absolute; left: 0px; top: 0px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 690px; height: 786px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 25px; height: 25px; position: absolute; left: 224px; top: 0px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -665px; top: 0px; width: 690px; height: 786px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 98px; height: 96px; position: absolute; left: 76px; top: 65px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: -690px; width: 690px; height: 786px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 25px; height: 25px; position: absolute; left: 0px; top: 65px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: -665px; width: 690px; height: 786px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; width: 25px; height: 25px; position: absolute; left: 224px; top: 65px;">
            <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -665px; top: -665px; width: 690px; height: 786px; -moz-user-select: none;">
          </div>
          <div style="overflow: hidden; position: absolute; left: 25px; top: 0px; width: 199px; height: 25px;">
            <div style="overflow: hidden; width: 640px; height: 25px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -25px; top: 0px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 0px; top: 25px; width: 25px; height: 40px;">
            <div style="overflow: hidden; width: 25px; height: 598px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: -25px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 224px; top: 25px; width: 25px; height: 40px;">
            <div style="overflow: hidden; width: 25px; height: 598px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -665px; top: -25px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 25px; top: 65px; width: 51px; height: 25px;">
            <div style="overflow: hidden; width: 640px; height: 25px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -25px; top: -665px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 174px; top: 65px; width: 50px; height: 25px;">
            <div style="overflow: hidden; width: 640px; height: 25px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -25px; top: -665px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <div style="overflow: hidden; position: absolute; left: 25px; top: 25px; width: 199px; height: 40px;">
            <div style="overflow: hidden; width: 640px; height: 598px;">
              <img src="http://www.google.com/intl/en_ALL/mapfiles/iw1.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -25px; top: -25px; width: 690px; height: 786px; -moz-user-select: none;">
            </div>
          </div>
          <img src="http://www.google.com/intl/en_ALL/mapfiles/close.gif" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 225px; top: 10px; width: 14px; height: 13px; -moz-user-select: none; z-index: 10000; cursor: pointer;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/maximize.gif" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 207px; top: 10px; width: 14px; height: 13px; -moz-user-select: none; z-index: 10000; visibility: hidden; cursor: pointer;">
          <img src="http://www.google.com/intl/en_ALL/mapfiles/restore.gif" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 207px; top: 10px; width: 14px; height: 13px; -moz-user-select: none; z-index: 10001; visibility: hidden; cursor: pointer;">
          <div style="position: absolute; left: 16px; top: 16px; width: 217px; height: 58px; z-index: 10;">
            <div>Some stuff to display in the
              <br>Info Window
            </div>
          </div>
          <map name="iwMap0" id="iwMap0">
          <area coords="0,0,0,90,129,90,80,161,174,90,249,90,249,0" href="javascript:void(0)" shape="poly">
          <area coords="81,159,78,160,76,161,74,163,72,167,72,171,73,173,74,175,77,178,79,182,80,185,81,189,81,193,83,193,83,189,84,185,85,183,86,180,88,177,90,175,92,171,92,167,90,163,88,161,87,160,85,159" href="javascript:void(0)" shape="poly">
          </map>
          <img usemap="#iwMap0" src="http://www.google.com/intl/en_ALL/mapfiles/transparent.gif" style="border: 0px none ; margin: 0px; padding: 0px; -moz-user-select: none; position: absolute; left: 0px; top: 0px; width: 249px; height: 161px;">
        </div>
      </div>
    </div>
  </div>

That’s the end of the stuff that moves when the map pans.
From here onwards, the elements remain in fixed positions.

This div contains the copytight text and Terms of Use link.

  <div style="color: black; font-family: Arial,sans-serif; font-size: 11px; white-space: nowrap; -moz-user-select: none; position: absolute; right: 3px; bottom: 2px;">
    <span>Map data ©2007  TeleAtlas -
    </span>
    <a style="color: rgb(119, 119, 204);" href="http://www.google.com/intl/en_ALL/help/terms_local.html">Terms of Use
    </a>
  </div>

This is the Google Logo.

  <a style="-moz-user-select: none; position: absolute; left: 2px; bottom: 0px;" href="http://maps.google.com/maps?ll=43,-79&spn=1.807822,3.02124&z=8&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBRRwPhutbWBmyj82Go_H6JlE7EvFBSKFFFHFePAwvib9UM0geoA3Pgafw&oi=map_misc&ct=api_logo" title="Click to see this area on Google Maps">
  <img src="http://www.google.com/intl/en_ALL/mapfiles/poweredby.png" style="border: 0px none ; margin: 0px; padding: 0px; width: 62px; height: 30px; -moz-user-select: none; cursor: pointer;">
  </a>

This is the GLargeMapControl().

  <div style="width: 59px; height: 256px; -moz-user-select: none; position: absolute; left: 7px; top: 7px;">
    <div style="overflow: hidden; position: absolute; left: 0px; top: 0px; width: 59px; height: 226px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/lmc.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; width: 59px; height: 354px; -moz-user-select: none;">
      <div log="pan_up" title="Pan up" style="position: absolute; left: 20px; top: 0px; width: 18px; height: 18px; cursor: pointer;">
      </div>
      <div log="pan_lt" title="Pan left" style="position: absolute; left: 0px; top: 20px; width: 18px; height: 18px; cursor: pointer;">
      </div>
      <div log="pan_rt" title="Pan right" style="position: absolute; left: 40px; top: 20px; width: 18px; height: 18px; cursor: pointer;">
      </div>
      <div log="pan_down" title="Pan down" style="position: absolute; left: 20px; top: 40px; width: 18px; height: 18px; cursor: pointer;">
      </div>
      <div log="center_result" title="Return to the last result" style="position: absolute; left: 20px; top: 20px; width: 18px; height: 18px; cursor: pointer;">
      </div>
      <div log="zi" title="Zoom In" style="position: absolute; left: 20px; top: 65px; width: 18px; height: 18px; cursor: pointer;">
      </div>
    </div>
    <div style="position: absolute; left: 0px; top: 226px; width: 59px; height: 30px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/lmc-bottom.png" style="border: 0px none ; margin: 0px; padding: 0px; width: 59px; height: 30px; -moz-user-select: none;">
      <div log="zo" title="Zoom Out" style="position: absolute; left: 20px; top: 11px; width: 18px; height: 18px; cursor: pointer;">
      </div>
    </div>
    <div style="position: absolute; left: 19px; top: 86px; width: 22px; height: 150px; cursor: pointer;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/slider.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 72px; width: 22px; height: 14px; -moz-user-select: none; cursor: url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur), default;">
    </div>
  </div>

This is the GMapTypeControl().

  <div style="color: black; font-family: Arial,sans-serif; font-size: small; -moz-user-select: none; position: absolute; right: 7px; top: 7px; width: 210px; height: 19px;">
    <div title="Show street map" style="border: 1px solid black; position: absolute; background-color: white; text-align: center; width: 5em; cursor: pointer; right: 11em;">
      <div style="border-style: solid; border-color: rgb(176, 176, 176) white white rgb(176, 176, 176); border-width: 1px; font-size: 12px; font-weight: bold;">Map
      </div>
    </div>
    <div title="Show satellite imagery" style="border: 1px solid black; position: absolute; background-color: white; text-align: center; width: 5em; cursor: pointer; right: 5.5em;">
      <div style="border-style: solid; border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white; border-width: 1px; font-size: 12px;">Satellite
      </div>
    </div>
    <div title="Show imagery with street names" style="border: 1px solid black; position: absolute; background-color: white; text-align: center; width: 5em; cursor: pointer; right: 0em;">
      <div style="border-style: solid; border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white; border-width: 1px; font-size: 12px;">Hybrid
      </div>
    </div>
  </div>

This is the GScaleControl().

  <div style="width: 116px; height: 26px; color: black; font-family: Arial,sans-serif; font-size: 11px; -moz-user-select: none; position: absolute; left: 68px; bottom: 5px;">
    <div style="overflow: hidden; position: absolute; left: 0px; top: 0px; width: 4px; height: 26px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/scale.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: 0px; top: 0px; -moz-user-select: none;">
    </div>
    <div style="overflow: hidden; position: absolute; left: 3px; top: 11px; width: 112px; height: 4px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/scale.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -12px; top: 0px; -moz-user-select: none;">
    </div>
    <div style="overflow: hidden; position: absolute; left: 115px; top: 11px; width: 1px; height: 4px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/scale.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -412px; top: 0px; -moz-user-select: none;">
    </div>
    <div style="overflow: hidden; position: absolute; left: 72px; top: 0px; width: 4px; height: 12px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/scale.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -4px; top: 0px; -moz-user-select: none;">
    </div>
    <div style="overflow: hidden; position: absolute; left: 112px; top: 14px; width: 4px; height: 12px;">
      <img src="http://www.google.com/intl/en_ALL/mapfiles/scale.png" style="border: 0px none ; margin: 0px; padding: 0px; position: absolute; left: -8px; top: 0px; -moz-user-select: none;">
    </div>
    <div style="position: absolute; left: 8px; bottom: 16px;">20 mi
    </div>
    <div style="position: absolute; left: 8px; top: 15px;">50 km
    </div>
  </div>

The image maps that are used for the marker click targets are defined here.

  <map name="gmimap0">
  <area href="javascript:void(0)" alt="" shape="poly" coords="9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0" log="miw" id="map_undefined">
  </map>
</div>
</body>
</html>

Third Party Extensions

Google Maps API Tutorial

Using Jef Poskanzer’s OverlayMessage

OverlayMessage allows you to place a semi-transparent message over the top of any HTML element. It’s not a true Google API Map extension, because it works equally well on things other than maps.

It can be useful for Google Maps that take a while to load. You can display the message before the map starts to load, and clear it in the <body onload> function, if you’re not using onload for anything else.

Here’s an example

Full details of how to use it are at http://www.acme.com/javascript/#OverlayMessage

Third Party Extensions

Google Maps API Tutorial

Jef Poskanzer’s Clusterer

If you happen to have thousands of points that you want to plot, you’ll find that the map becomes too slow to be usable. One way round this, without a server side database, is to use Jef Poskanzer’s excellent Clusterer.js.

See http://www.acme.com/javascript/#Clusterer

Here’s an example

Instead of displaying the markers directly, you tell the Clusterer about them, and it monitors the map movements and zoom level and determines when it is appropriate to display icons that indicate clusters, and when it is appropriate to display individual markers.

Jef has asked me not to describe how to use Clusterer, so I won’t.

Parameters

If you don’t like the default Clusterer settings, then you can set some parameters.

  • clusterer.icon
    can be set to the GIcon to be used to indicate a cluster, so you can use your own marker icon to match the rest of your page.
  • clusterer.maxVisibleMarkers
    sets the maximum number of icons that will be displayed at any one time. The default is 150.
  • clusterer.gridSize
    sets the size of the grid used for placing the clusters. The default value of 5 indicates that there can be 5 clusters from east to west across the map.
  • clusterer.minMarkersPerCluster
    sets the minimum number of markers that can be in a cluster. The default value is 5.
  • clusterer.maxLinesPerInfoBox
    sets the number of detail lines that will be displayed in the info window associated with a cluster. If you’ve got a small map, then you may need to reduce this to prevent the cluster info boxes being too large for your map. If there are more markers in a cluster than this value, then the info window adds a line that says “.. and XXX more”. The default value is 10.

You don’t have to set any of these parameters, the Clusterer works perfectly well with the default settings.

Third Party Extensions

Google Maps API Tutorial

Third Party Extensions

This is a list of all the third party extensions that I know about.

Clusterer Handles large numbers of markers.
OverlayMessage Place a semitransparent message over a map.
ELabels Place any html element on a map (good for text labels)
GxMagnifier Adds a moveable magnified window
GxMarker Provides markers with built in tooltip support and hover events
EInsert Attach an image to the map that scales when the map zooms
EWindows Multiple custom info windows
PDMarker Change marker images, show tooltips on hover, customised info windows, manage lists of markers, store marker data, etc.
Custom Tile Generator Generates tiles from an XML description
GRoutes Provides functionality for displaying multiple routes
BpBrowser Exposes browser and Operating System info
BpDownloadUrl Like GDownloadUrl but with more options
BpLabel Place any html element on a map (good for text labels)
BpMarker Extended Marker class with tooltip and mousover icon swapping
BpMarkerLight Extended Marker class with tooltip and mousover icon swapping
BpMarkerList Automatic sidebars.
BpWindow Display info in a box that can extend outside the map.
BpControl Simple interface to GControl.
MapTypeMenuControl A compact map type control
MarkerManager An improved Open Source version of GMarkerManager
LabeledMarker Puts text onto markers
EGeoXml Renders My Maps KML files and other similar KML files.
HtmlControl HtmlControl provides an easy way to add and position custom GControls over your Google Map.
EPoly Adds a few methods to polygons and polylines.
ASP.NET Control Write Google Maps with ASP.NET code instead of Javascript
EBubble An alternative to info windows
GeoXml Renders KML, GML, GPZ and GeoRSS files.
Blocks Simplified markers. Faster than GMarkers.
Graticules Display lat/lng grid or UK National Grid.
Arrows Displays small arrows using SVG or VML.
Offsetable Marker A draggable marker that leaves a line pointing back to where it came from.
Scaled Circle Displays a scaled circle using SVG or VML.
Clickable Polylines and Polygons Displays clickable polylines and polygons using SVG or VML.
Distance to Poly Calculates the distance of a point from a polyline or the boundary of a polygon.
Calculate US OS references Calculates UK Ordnance Survey map references.
ExtInfoWindow Customised Info Window
GMouseWheelControl Extra mouse functionality
ClusterMarker Detects and substitutes markers that would overlap
Bearings and Directions Functions for distances, bearings, rhumb lines, etc.
GeoKit A Rails plugin
USNaviguide_Google_Tiles A Perl module that calculates tile details
jMaps jQuery plugin for Google Maps
Parallel Lines Creates a pair of parallel polylines
MStatusControl Displays map centre, SW and NW corners, zoom level and mouse position (tile numbers, (x,y) position and lat/lon)
MapIconMaker Easily create dynamically sized and coloured icons.
MarkerTracker Display directional indicators for markers as they move out of a maps view.
GReverseGeocoder Reverse Geocoder
ourarea allows you to easily create an embeddable Google Map showing the area around your business that you deliver to or support.
EShapes provides a number of additional static methods for GPolyline and GPolygon for creating certain shapes
Frame Animation Frame animation overlay
MControl Suite A bunch of custom controls.
cSnapToRoute Snap a marker to the closest point in a polyline
ProgressbarControl Progress bar control
NASA Maps NASA Extensions to the Google Maps API
Geometry Controls Edit content just like My Maps
CSGeoXml Renders KML files as a single overlay.
Intellisense Helper Intellisense helper for VS2008.
ClusterManager Substitutes markers that would overlap with clusters.
Popup Title A little popup for GMarkers
Dragzoom Zoom by dragging a rectangle on the map
ExtLargeMapControl Custom Large Map COntrol that uses the new graphics
ExtMapTypeControl Adds overlay controls that look like map type controls
SnapToRoute Snap a marker to closest point on a line.
MultiIconMarker Change marker icon when an event occurs
MyMapExplorer Embed MyMaps in your web page
Custom Marker Maker Creates suitable files for a custom marker.

Clusterer

Allows you to use large numbers of markers by collecting them into “clusters” to avoid having too many markers drawn on the screen at any time.
Author: Jef Poskanzer

Example page: http://www.acme.com/jef/hotsprings/ and my example

Information: http://www.acme.com/javascript/#Clusterer and my tutorial

OverlayMessage

OverlayMessage allows you to place a semi-transparent message over the top of any HTML element. It’s not a true Google API Map extension, because it works equally well on things other than maps.
Author: Jef Poskanzer

Example page: my example

Information: http://www.acme.com/javascript/#OverlayMessage

Elabels

ELabels allow you to place any HTML element on a map as a Custom Overlay. You can use it in a similar manner to TLabel.
Author: Mike Williams

Information: my tutorial

Example Page:my example

GxMagnifier

GxMagnifier is a free add-in control for Google Maps that creates a moveable, magnified window on top of your map.
Author: Richard Kagerer

APIv2 compatibility: Andre Howe

Example page: boxme.net/wdch/test.html

Download: boxme.net/wdch/GxMagnifier2.js

Information (v1 version): http://www.googlemappers.com/libraries/gxmagnifier/docs/default.htm

GxMarker

Provides markers with built in tooltip support and hover events.
Author: J. Shirley

APIv2 compatibility: Robert Aspinall

Information: code.toeat.com/package/gxmarker

EInsert

The EInsert extension allows you to attach a scaleable image to the map. The extension scales the image as the zoom level changes.
Author: Mike Williams

Information: my tutorial

Example Page:my example

EWindows

The EWindows extension provides some of the functionality of Custom Info Windows.
You can design your own info window styles, and have more than one EWindow open on the same map.

Author: Mike Williams

Information: my tutorial

Example Page: my example

PdMarker

PdMarker is a Javascript extension to Google Maps markers. You can change marker images, show tooltips on hover, customised info windows, manage lists of markers, store marker data, etc.
Author: Peter Jones

Information: http://www.pixeldevelopment.com/pdmarker.asp

Example Pages:www.pixeldevelopment.com/virtualgoogleearth.asp
http://www.pixeldevelopment.com/showmap.asp?gallery=stanleypark2004&caller=index.asp

Custom Tile Generator

This Windows desktop application accepts XML files that describes shapes (beziers, closed curves, curves, ellipses, images, polygons, polylines, rectangles, text and filled shapes) and generates a set of tiles suitable for using in a custom GTileLayer.
Author: Jacob Reimer

Information: http://www.reimers.dk/blogs/jjrdk/archive/2006/04/14/216.aspx and http://www.reimers.dk/blogs/jjrdk/archive/2006/05/09/252.aspx

Example Page: http://www.reimers.dk/demos/wmsdemo.aspx

GRoutes

GRoutes is a JavaScript package that provides functionality for displaying multiple routes (including an associated set of markers) on a map along with a control to switch between maps. Informational texts on the markers to be displayed in the info window (bubble) are also supported.
Author: Holger Pollmann

Information: http://www.stud.uni-giessen.de/~st8632/misc/internet/googlemaps.html

Example Page: http://www.stud.uni-giessen.de/~st8632/misc/internet/groutesdemo.html

BpBrowser

Encapsulates browser, os, and version information. Free for commercial and non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpDownloadUrl

A more fully-featured version of GDownloadUrl, allowing you to execute POST and synchronous AJAX requests. Free for commercial and non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpLabel

A robust GOverlay subclass. Lets you put HTML on the map as an overlay. Free for non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpMarker

A GMarker subclass with a few extra options. Free for non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpMarkerLight

A light-weight GOverlay subclass with image and icon swapping, tooltip support, etc. The fact that it’s light-weight allows you to add hundreds of markers to a map quickly. Free for non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpMarkerList

Encapsulates a map sidebar which holds divs which represent markers. Allows for sorting, managing div content and events through the use of HTML templates, and more. Free for non-commercial use..
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpWindow

An infoWindow-type tool which can open outside the map. As a result, the map will never automatically pan to show its contents. It also can open outside of its iframe, and open up, right, left, or down, depending on what direction will allow it to open within existing page borders. Free for non-commercial use.
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

BpControl

A simple interface to GControl()
Author: Bitperfect Internet Solutions

Information and examples: http://www.gmaptools.com

MapTypeMenuControl

A compact drop-down map type control.
Author: Dawn Endico

Information and examples: maps.tafoni.net/MapTypeMenuControl/

MarkerManager

Improved version of GMarkerManager.
As well as doing everything that GMarkerManager does, the Open Source version allows markers to be removed, has some bug fixes, and can be used to manage custom overlays, such as ELabels and EInserts, as well as GMarkers.

Author: Doug Ricket, others

Information and examples: code.google.com/p/gmaps-utility-library-dev/wiki/Libraries/

LabeledMarker

Supports markers with textual labels.
Author: Mike Purvis

Code and example: gmaps-utility-library.googlecode.com/svn/trunk/labeledmarker/

Hint: LabeledMarker works well alongside MapIconMaker, like this

EGeoXml

The EGeoXml extension renders My Map KML files and other KML files of similar structure. The internal structures are exposed, allowing you to have much more control than when using GGeoXml.
Author: Mike Williams

Information: my tutorial

Example Page: my example

HtmlControl

HtmlControl provides an easy way to add and position custom GControls over your Google Map.
An HtmlControl can contain any valid HTML markup and can be styled with any valid CSS style-rules.
HtmlControl makes it easy to create; buttons, hideable menus and forms, map loading messages and much more!
Author: Martin Pearman

Information: googlemapsapi.martinpearman.co.uk/htmlcontrol

Example Page:googlemapsapi.martinpearman.co.uk/htmlcontrol/demo_map.php

EPoly

Author: Mike Williams
Adds methods to GPolygon and GPolyline for determining the area, bounds, path length and whether a GLatLng is contained within the poly.

Information: my tutorial

Example Page: my example

ASP.NET Control

Author: Subgurim
Code and information: en.googlemaps.subgurim.net

EBubble

The EBubble extension provides an alternative to info windows.
Author: Mike Williams

Information: my tutorial

Example Page: my example

GeoXml

The GeoXml extension enables client-side parsing and viewing of a number of flavors of GeoXml, including GML from WFS servers, GPX from GPS devices or log as well as KML and multiple flavors of GeoRSS,In addition to the XML it supports saving out and re-loading of KJSON.
Author: Lance Dyas

Information and example: http://www.dyasdesigns.com/geoxml

Blocks

These are a very simple coloured block marker with a tooltip. The point of these is that for the same load time, you should be able to use more of these on a map than you can GMarkers.
Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Graticules

Display lat/lng grid or UK National Grid.
Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Arrows

Displays small arrows using SVG or VML.
Because this extension relies on SVG or VML, it will not work in browsers which do not support these features.

Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Offsetable Marker

This uses sub-classing on GMarker to provide a marker that can be dragged from its spot but leaves a line indicating its actual reference point.
Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Scaled Circle

Displays a scaled circle using SVG or VML.
Because this extension relies on SVG or VML, it will not work in browsers which do not support these features.

Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Clickable Polylines and Polygons

Displays clickable polylines and polygons using SVG or VML.
Because this extension relies on SVG or VML, it will not work in browsers which do not support these features.

Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Distance To Poly

Calculates the distance of a point from a polyline or the boundary of a polygon.
Author: “Bill Chadwick ”

Information: http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm

Calculate US OS references

Converts Lat/Lng pairs to UK Ordnance Survey references, like “SU 66277 62491”.
Author: “Bill Chadwick ”

Code: http://www.bdcc.co.uk/Gmaps/LatLngToOSGB.js

ExtInfoWindow

Customised Info Window.
Author: Joe Monahan

Information and examples: gmaps-utility-library.googlecode.com/svn/trunk/extinfowindow/.

GMouseWheelControl

A custom control built by using Google Map API to enhance the usage of a mouse on Google Map. It can be used in any Google map mashups. It takes advantage of scroll wheel mouse.
Author: Pman (Parvez Akkas)

Information and Example: http://www.pmanslab.com/projects/gmwControl/.

ClusterMarker

ClusterMarker detects any group(s) of two or more markers whose icons visually intersect when displayed. Each group of intersecting markers is then replaced with a single cluster marker. The cluster marker, when clicked, simply centres and zooms the map in on the markers whose icons previously intersected.
Author: Martin Pearman

Information and Example: googlemapsapi.110mb.com/clustermarker/.

Bearings and Directions

Not actually an extension, but a collection of useful functions
Distance between two points (using Haversine formula).
Distance between two points (using Vincenty formula).
Bearing of one point from another.
Midpoint between two points.
Destination point given distance and bearing from start point.
Rhumb lines
Convert between degrees-minutes-seconds and decimal degrees
Convert between UK Ordnance Survey grid reference and lat/long.

Author: Chris Veness

Information and code: http://www.movable-type.co.uk/scripts/latlong.html.
and http://www.movable-type.co.uk/scripts/latlong-vincenty.html.
and http://www.movable-type.co.uk/scripts/latlong-gridref.html.
GeoKit

Geokit is a Rails plugin for building location-based apps. It provides geocoding, location finders, and distance calculation in one cohesive package. If you have any tables with latitude/longitude columns in your database, or if you every wanted to easily query for “all the stores within a 50 mile radius,” then GeoKit is for you.
Authors: Bill Eisenhauer and Andre Lewis

Information and Examples: geokit.rubyforge.org.

USNaviguide_Google_Tiles

A Perl module that calculates just about everything you’d want to know about tiles including:
Tile name for a coordinate (lat,lng)
Tile name for a pixel location (x,y)
Tiles for a bounding box of coordinates and zoom
Bounding box for a tile in coordinates
Bounding box for a tile in pixel locations
Coordinates to pixel
Pixel to coordinates
Author: John D. Coryat
Information and Code: http://www.usnaviguide.com/google-tiles.htm.

jMaps

jQuery plugin that provides several useful functions that make working with Google maps easier.
Author: Tane Piper

Code: hg.digitalspaghetti.me.uk/jmaps/.

Documentation: hg.digitalspaghetti.me.uk/jmaps/raw-file/271365e77c35/docs/index.html.

Parallel Lines

Creates parallel polylines.
Author: Bill Chadwick

Code: wheresthepath.googlepages.com/BDCCParallelLines.js.

Example: wheresthepath.googlepages.com/ParallelLines.htm.

MStatusControl

displays map centre, SW and NW corners, zoom level and mouse position (tile numbers, (x,y) position and lat/lon)
Author: Marcelo Montagna

Source and Example: maps.forum.nu/gm_MStatusControl.html.

MapIconMaker

Easily create dynamically sized and coloured icons.
The icon images are generated dynamically using a secret feature of the Google Chart API.

There’s a Wizard to help you choose the settings, and a Blog article with details and examples.

(The URL of the Wizard changes from time to time. If the wizard link fails, use the blog link and go from there.)

As well as generating the image, IconFactory also produces correct shadows, click targets, and printImages.

Author: Pamela Fox

Source and Examples: gmaps-utility-library.googlecode.com/svn/trunk/mapiconmaker/

Hint: LabeledMarker works well alongside MapIconMaker, like this (now probably obsolete, because MapIconMaker v1.1 includes createLabeledMarkerIcon)

MarkerTracker

Display directional indicators for markers as they move out of a maps view.
There’s a Blog article with details and examples.

Author: Dan Rummel

Source and Examples: gmaps-utility-library.googlecode.com/svn/trunk/markertracker/

GReverseGeocoder

Given latitude and longitude coordinates, the reverse geocoder obtains the nearest address
Author: Nico Goeminne

Information: nicogoeminne.googlepages.com/documentation.html

ourarea

Allows you to easily create an embeddable Google Map showing the area around your business that you deliver to or support.
Author: Nirmal Patel

Website: http://www.nirmalpatel.com/ourarea/

EShapes

The EShapes extension provides a number of additional static methods for GPolyline and GPolygon for creating certain shapes. It also provides two functions that can help in the placement of such shapes.
Author: Mike Williams

Information: my tutorial

Example Page: my example

Frame Animation Overlay

Author: “bratliff”
Useful for animated overlays, like moving weather radar images.

Please make your own copy because the one on this page may change.

Code: http://www.polyarc.us/frameanimation.js

Example Page: http://www.polyarc.us/ridge

MControl Suite

A bunch of custom controls.
MMapTypeControl
MOpacityControl – With a separate slider foreach tile layer
MZoomControl – Allows for predefined zoom levels
MStatusControl – Displays map status and mouse position info
MTileNumberControl – Displays tile numbers over the map
Author: Marcelo Montagna
Information and example: maps.forum.nu/gm_custom_controls.html

cSnapToRoute

Snap a marker to the closest point in a polyline
Author: Bill Chadwick

Information and example: wheresthepath.googlepages.com/cSnapToRouteDemo.html

ProgressbarControl

Progress Bar Control
Author: Björn Brala

Information and example: gmaps-utility-library.googlecode.com/svn/trunk/progressbarcontrol/

NASA Maps

Extra map types for the Moon and Mars, including polar maps.
Author: NASA

Info: ti.arc.nasa.gov/projects/planetary/maps.php

As supplied, the polar map projections don’t support polylines or polygons.

If you want to draw polylines, then you can use this version of the code: nasamaps2.js which uses a nasty hack to work round the bug in the API. If you’re not using polylines, then use the NASA version of the code, because i’t likely to be faster and to be kept up to date with new imagery.

Here’s an example of a NASA Polar map with polylines.

Geometry Controls

Edit content just like with My Maps.
Author: Chris Marx and Pamela Fox and others

Example: gmaps-utility-library-dev.googlecode.com/svn/trunk/geometrycontrols/examples/test.html

Info: gmaps-utility-library-dev.googlecode.com/svn/trunk/geometrycontrols/docs/reference.html

Code: gmaps-utility-library-dev.googlecode.com/svn/trunk/geometrycontrols/

CSGeoXml

A modified version of EGeoXml that acts like a single overlay.
Author: Matt Bernier

Information: devblog.cloudsync.com/projects/csgeoxml/

Intellisense Helper

Intellisense helper for VS2008.
Author: Nicolas Boonaert & Roger Chapman

Information: http://www.codeplex.com/GMapJS

ClusterManager

ClusterManager detects any groups of two or more markers whose icons visually intersect when displayed. Each group of intersecting markers is then replaced with a single cluster marker. The cluster marker, when clicked, provides an info window that gives access to the original markers.
Author: Peter van der Zee

Information and Example: cm.qfox.nl.

Popup Title

Displays a popup mini bubble for marker mouseover titles.
Author: Masashi Katsumata

Information and Example: googlemaps.googlermania.com/gmapkit/example/GMarkerPopupTitle.html.

Dragzoom

Dragzoom is a custom Google Maps control which allows you to zoom by dragging a rectangle on the map.
Author: Andre Lewis

Information and examples: gmaps-utility-library.googlecode.com/svn/trunk/dragzoom/

ExtLargeMapControl

A custom Large Map COntrol that uses the new graphics, as seen on maps.google.com.
Author: Bjorn Brala

Information and examples: gmaps-utility-library.googlecode.com/svn/trunk/extlargemapcontrol/.

ExtMapTypeControl

ExtMapTypeControl lets you add a control to the map which looks like the typical GMapTypeControl from the obfuscated API. By specifying additional options however, you can also add a Traffic button to the control and a drop-down legend for that button. Author: Pamela Fox and others
Information and examples: gmaps-utility-library.googlecode.com/svn/trunk/extmaptypecontrol/.

SnapToRoute

SnapToRoute will snap a marker to closest point on a polyline.
Author: Bjorn Brala

Information and examples: gmaps-utility-library.googlecode.com/svn/trunk/snaptoroute/.

MultiIconMarker

An alternative for GMarker that allows the associated GIcon to be changed (not just the icon image) when an event occurs.
Hint: by using your own custom events you can achieve the equivalent of a .setIcon() method.

Author: Masashi Katsumata

Information and examples: gmaps-utility-library-dev.googlecode.com/svn/trunk/multiiconmarker/.

MyMapExplorer

Allows you to embed a map created using Gooogle Maps’ My Maps feature into any web page with more information and flexibility than Google’s iFrame embed code.
Author: John Beales

Information and examples: code.google.com/p/mymapexplorer.

Custom Marker Maker

Upload an image (png, gif, jpg) and this page creates the 6 separate image files (image, shadow, printImage, mozPrintImage, printShadow and transparent) that make up a custom marker icon and suggests an array of x,y pixel coordinates that define the image map area used for capturing image clicks in non IE browsers. Transparency of the original image is preserved. Users see their image as a marker on a map and are presented with a zipped package for download that contain the generated images and some sample code.
Author: Graham

URL: http://www.powerhut.co.uk/googlemaps/custom_markers.php.

More advanced stuff

Google Maps API Tutorial

Icon Sprites

This undocumented feature can be used to improve the page loading time in situations where you use several different custom icons.On the left is a single image file that contains ten icon images. GIcon.sprite allows the individual icon images to be cropped out from that image and used as marker icons.Here’s an exampleThe syntax looks like this:

   var myicon = new GIcon();
   myicon.sprite = {image:"sprites.png", width:20, height:34, top:68, left:0}
  • image: the URL of the sprite file. Countermands any existing .image setting.
  • width: the width of the icon. Ignored if the icon already has a .iconSize setting.
  • height: the height of the icon. Ignored if the icon already has a .iconSize setting.
  • top: the vertical pixel position within the sprite file where this icon image starts.
  • left: (optional) the horizontal pixel position within the sprite file where this icon image starts.

It is possible to have sprites of different sizes in the same sprite file.It is possible to use 2D arrays of icon images since v2.141, using “top” and “left” to specify the position.

Thanks to “Esa” for spotting the details of this feature.

More advanced stuff

Google Maps API Tutorial

Using <CANVAS>

It is possible to directly use <canvas> in conjunction with a map.

Here’s an example

Details of how to use <canvas> are available from the Mozilla Developer Centerdeveloper.mozilla.org/en/Canvas_tutorial

However there are a few drawbacks.

Browser Support

Not all browsers support <canvas>, and there is some variation between levels of support in the browsers the do support it. The HTML5 standard which defines <canvas> is still evolving.

In particular, MSIE does not currently support <canvas>.

There is an add on called ExplorerCanvas which can intercept <canvas> canvas commands and convert some of them into VML and Filter commands that MSIE does recognise, but many <canvas> features are not supported, the end result is extremely slow.

Therefore it’s a good idea to test for <canvas> support, and provide some sort of alternative when that support is absent. In the above example, I have a small test canvas which always exists outside the map. If that canvas doesn’t have a .getContext() Method, then I don’t create the active canvas, but create a simple marker instead.

Cryptic error messages

Firefox3 <canvas> error messages are seriously cryptic. They thow a couple of lines of complete gibberish, out of which the only bit that means anything to me is the line number on which the error occurred.

Click handling

<Canvas> elements don’t seem to accept attributes like “onclick” and “onmouseover”, etc.

In some circumstances they seem to eat such events, even in the transparent parts of the <canvas>, preventing them from dropping through to the map controls and overlays below them. In other cirsumstances the clicks do drop through. I don’t know what causes the change in behaviour.

Therefore, if you’re going to use <canvas> in such a way that it overlaps clickable objects, do perform a quick sanity test to see if the clicks are going to reach the underlying elements.

Placing <canvas> elements in a map

You could place your <canvas> elements directly onto one of the map panes, but then you’d have to manage the lat/lng handling yourself.

In the example, I use an ELabel as a container for the <canvas>. This gives the advantage of having all the standard methods like .hide(), .setPoint(), etc. built in.

You could place <canvas> elements inside other structures, such as info windows, or GControls.

You could appendChild a <canvas> element to the map container, but watch out for the click passing problem mentioned above.

<canvas> images and onload function

I don’t usually recommend using onload functions, but if you’re using images in <canvas> then it is necessary to ensure that the image has completely loaded before you attempt to use it in <canvas>. One way to do this is to load the image in the main inline code and launch the <canvas> from the onload event.

Rotating icons

The awkward thing with rotations in <canvas> is that they don’t rotate the object, they rotate the canvas axes around point (0,0), the top left corner of the canvas workspace. That’s not what we generally want. We usually want to rotate an element about its centre.

In other graphics systems, we would translate the object to (0,0), then rotate it, then perform the inverse translation to put it back where it came from.

That’s basically what we have to do in <canvas> but the inverse translation takes place in the rotated frame, so instead of it being (-x,-y) it becomes (x*sin(a)+y*cos(a),y*cos(a)-y*sin(a)). The whole rotate-about-centre operation looks like this:

      var cosa = Math.cos(angle);
      var sina = Math.sin(angle);
      canvas.clearRect(0,0,x*2,y*2);
      canvas.save();
      canvas.rotate(angle);
      canvas.translate(x*sina+y*cosa,x*cosa-y*sina);
      canvas.drawImage(img,-x,-y);
      canvas.restore();

The save() and restore() operations put the axes back where they originally came from.

More advanced stuff

Google Maps API Tutorial

Communicating between iframes

I don’t think it’s possible to pass references to complex Objects, like GMarker()s, between iframes. What you can do instead is to have “helper” functions in the target iframe that accepts simple Objects, like Numbers and Strings, and obtains references to the complex objects within that iframe.

Here’s a simple example

This example has two iframes, one for the map and one for the sidebar.

Only frame1 loads the Google Maps API code.
It loads the XML for the markers in the normal way and adds them to the map. It builds up the sidebar contents in the normal way, but instead of putting them into document.getElementById(“side_bar”), it sends the contents to a helper function in frame2. parent.frame2.sideBar(side_bar_html)

The helper function in frame2 takes the passed string and places in its local “side_bar” div.

Once the side bar has been passed, frame2 contains a series of calls like
<a href=”javascript:parent.frame1.myclick(1)”>. These pass a simple number to the “myclick()” helper function that lives in frame1.

Warning

Debugging Javascript that crosses between iframes is significantly harder than debugging Javascript that operates in a single frame.

More advanced stuff

Google Maps API Tutorial

Using pseudo-HTML data files for maxContent

If you’re using maxContent, or anything else, to display large quantities of HTML data about each marker, then you’ve got to store that data somewhere. If you’ve got lots of markers, things can get messy.

You could store the data in one large XML file or plain text file, but that becomes a pain to create and maintain if you’ve got large amounts of HTML data for each marker.

You could store the maxContent for each marker in a separate HTML file, which you load on demand. The only problem with that is that if you’ve got lots of markers, you end up with lots of files. If you’re using something like googlepages, you have to upload each file, one by one, and there’s a limit of 500 files per googlepages site.

What I came up with is storing the data in one rather unconventional HTML file. The file contains the maxContent HTML for all the markers, using <hr> as a separator. It doesn’t have <head>, <body> or <html> tags or a Doctype, because the maxContent gets injected into a div.innerHTML within an existing page. However, it’s still close enough to acceptable HTML for you to be able to load it into a browser and check the format and content of all the sections at once.

I’ve also put other data about the markers in the same file, separated with “|” characters, but you could just as well store the other data in a separate XML file with the records arranged in the same order.

The data is read in a similar manner to that used when reading a plain text data file, except that the data is split into sections using “<hr>” as the separator, rather than “\n”.

More advanced stuff

Google Maps API Tutorial

GGeoXml with sidebar

GGeoXml doesn’t expose the content that it adds to your map, so you can’t directly obtain information on its markers from Javascript. However, in some circumstances, it is possible to intercept the addoverlay events which are generated when it adds the markers to the map.

Here’s an example

Warning: This trick relies on undocumented details of the GGeoXml behaviour. It may well fail to work in future releases.

Other, more stable, methods for creating a sidebar are EGeoXml and GeoXml

When GGeoXml adds overlays to a map, an “addoverlay” event is triggered. It’s possible to catch that event, extract information about that overlay, and build a sidebar.

This is possible because GGeoXml adds extra accessible properties to the overlays that it creates. These properties currently are:

  • name
  • description
  • snippet
  • hiddenInStream
  • id
  • parentFolderForCallbackOverlayAddTimeout
  • parentGeoXml

The property that we’re interested in for building the sidebar is “name”.

Problems

Overlay management

GGeoXml now performs some sort of crude overlay management on the overlays it creates. This causes the overlays to be removeOverlay()ed when they leave the viewport and addOverlay()ed again when they re-enter the viewport. We need to be careful not to add an extra side bar entry for the overlay each time it re-enters the viewport.

In my example, I add my own extra property to the overlay to remember that I already know about the overlay.

Sidebar order

GGeoXml adds the overlays in random order. If you need the overlays to appear in alphabetical order of name, then you have to sort them yourself.

Long Sidebar

There’s no indication of whether a particular overlay is the last one in the KML file. This means that the usual technique of building the sidebar HTML until the last entry has been processed won’t work. In my example, I add each sidebar entry one by one. If there are large numbers of overlays, this becomes inefficient, since the browser has to re-render the sidebar div after each entry has been added.

I can’t think of any nice way around this, unless you happen to know how many overlays your KML file contains.

Intercepting infowindow content

Another trick that you might want to perform with GGeoXml is to modify the content of the infowindows that it manages. For example you might want to add a “get directions” facility at the bottom, or you might want to have active content in the info window.

It turns out that modifying overlay.description doesn’t modify the contents of the infowindow. The data must be being stored somewhere else before the “addoverlay” event gets triggered.

What you can do is to listen for the undocumented map “infowindowprepareopen” event, and modify the content of the GInfoWindowTab that it passes as a parameter.

In my example I simply add an extra line of text at the bottom of the infowindow contents.

You could place deactivated content in a KML file, perhaps using [ and ] instead of < and >, so that GGeoXml will allow the text to pass through, and then replace those characters as the infowindow opens.

More advanced stuff

Google Maps API Tutorial

GoogleBar Options

The GoogleBar allows you to achieve similar functionality to what you would get by using the Google AJAX Search API to perform a Local Search, but provides a few advantages:

  1. If you just need the basic functionality, all you need is one extra command in your code: map.enableGoogleBar().
  2. You can use it without having agreed to the Google AJAX Search API Terms of Use, which seem to not allow you to modify the results.

The Maps API GoogleBar options provide facilities which you can use to:

  • Modify or replace the text, images, or other content of the Google Search Results
  • Changing the order in which the Google Search Results appear
  • Intermix Search Results from sources other than Google
  • Intermix other content such that it appears to be part of the Google Search Results
  • Modify, replace or otherwise disable the functioning of links

All of which would be prohibited if you were using the Google AJAX Search API.

Options

The possible entries in the googleBarOptions are:

property type purpose
showOnLoad bool If true, the Google Bar will be expanded when the map has loaded.
linkTarget string Use one of these string variables to control the link target pane G_GOOGLEBAR_LINK_TARGET_BLANK, G_GOOGLEBAR_LINK_TARGET_PARENT, G_GOOGLEBAR_LINK_TARGET_SELF, G_GOOGLEBAR_LINK_TARGET_TOP
resultList string Use one of these string variables to control result list suppression G_GOOGLEBAR_RESULT_LIST_INLINE, G_GOOGLEBAR_RESULT_LIST_SUPPRESS
suppressInitialResultSelection bool If true, the info window is not opened on the first result.
suppressZoomToBounds bool If true, the map does not zoom and pan to fit the results.
onIdleCallback function Function be be called when the GoogleBar finishes searching
onSearchCompleteCallback function Function to be called when the search is complete, before the reults are plotted
onMarkersSetCallback function Function to be called after the markers have been placed on the map.
onGenerateMarkerHtmlCallback function Function to be called when the info window is about to be opened on one of the results. Must return the (modified) html element object to be used for the info window contents.

The first six options are fairly straight forward, but the callback functions need a bit of explanation:

onIdleCallback

This function is called when the GoogleBar is opened for the first time, and called again whenever the previous results are cleared. It is not called if a second search is executed without the user explicitly clearing the previous results.

No parameters are passed.

onSearchCompleteCallback

This function is called when the search is complete, before the results are plotted.

There is one parameter, a reference to a GlocalSearch object, see Official Class reference

Of particular interest is the .results[] array, which is an array of GlocalResult() objects, see Official Class reference

You can read that information, but also, because it’s a reference, you can modify the contents of the .result[] array. The .html will have already been calculated, so changing things like the .results[i].city won’t affect what gets displayed in the info window.

If you want to change the info window contents at this point, then you need to change the .results[i].html.innerHTML.

onMarkersSetCallback

This function is called when the API has created markers corresponding to the search results.

There is one parameter, an array of anonymous Objects.
Each Object in the array has two properties, .result is a GlocalResult object and .marker is a GMarker.

onGenerateMarkerHtmlCallback

This function is called whenever an info window is about to be opened.

The parameters are:

  1. The GMarker
  2. The HTMLElement which is intended to become the info window contents
  3. The GlocalResult

The function must return a HTMLElement which will become the actual info window contents.

Simple result filtering example

This example uses onSearchCompleteCallback to filter the search results, reducing the number of results to no more than two.

Simple info window modification

This example uses onGenerateMarkerHtmlCallback to read information from the GMarker and from the GlocalResult to modify the contents of the info window at the time that the info window is opened.

Advanced example: add ELabels

This advanced example uses all the GoogleBar Options. It displays an Elabel alongside each marker, and in order to do that it uses the callback functions like this:

onIdleCallback uses map.clearOverlays() to remove the old ELabels

onSearchCompleteCallback uses map.clearOverlays() to remove the old ELabels

onMarkersSetCallback reads the location of each GMarker and the titleNoFormatting of each GlocalResult and uses that information to create an ELabel.

onGenerateMarkerHtmlCallback hides the ELabel corresponding to the marker on which the info window is opening.

More advanced stuff

Google Maps API Tutorial

Custom Cursors

It is possible to use your own custom cursors for the map and for GDraggableObjects.

Here’s a simple example

The cursor is implemented as part of the operating system code, not in the browser itself, and the implementation varies considerably depending on the operating system and the browser.

MSIE

MSIE allows you to specify a list of CUR and ANI files and standard cursor keywords.
E.g. ‘url(mycursor.ani), url(mycursor.cur), pointer’
The “hot spot” must be specified in the CUR or ANI file itself, you can’t specify it in the cursor list.

If, for any reason, one cursor in the list cannot be used in the current environment, then the next one in the list will be used. However, if you attempt to use standard CSS3 syntax to specify the “hot spot” of any of the cursors, the whole list is ignored.

Gecko based browsers

Recent versions of Gecko-based browsers (Firefox, Mozilla, Netscape, Flick, etc.) allow you to specify a list of CUR, PNG, GIF, JPG, XBM and BMP files but require that the last element in the list be a standard cursor keyword.
They also allow the “hot spot” to be specified in the cursor list using standard CSS3 syntax.
E.g. ‘url(mycursor.png) 16 16, pointer’
If you don’t specify a “hot spot” in the list, then for XBM and CUR files the “hot spot” specified in the file will be used, and for other file types the tip left pixel (0,0) will be used.

Animated cursors are not currently supported in Gecko-based browsers. If you specify an animated GIF, then the first frame will be used.

If, for any reason, one cursor in the list cannot be used in the current environment, then the next one in the list will be used. However, if the last entry in the list is not a standard cursor keyword, then the whole list is ignored.

Webkit based browsers

I can’t find a list of rules for Safari or Chrome, but anything that works in Firefox seems to work.

Presto based browsers

I can’t find a list of rules for Opera, and can’t get anything to work. Any attempt at using a custom cursor list causes the whole list to be ignored. The standard cursor keywords work on their own, but not if there’s a “url()” in the list.

Windows versions

Translucent cursors are not supported in Windows versions prior to XP.

Cursors larger than 32*32 pixels are not supported in Windows versions prior to XP.

Mac Os X

Custom cursors don’t currently work on Mac Os X in Gecko based browsers.

Creating CUR files

Normal image processing applications won’t output CUR files. You’ll need a separate dedicated CUR file editor.

I happened to use ArtCursors from Aha-Soft www.aha-soft.com/artcursors. It costs $39.99 and comes with a 30 day trial period. There are several similar looking shareware programs at fairly similar prices.

Alternatively, you could try downloading ready-made cursors from one of the many “free cursor” sites. I recommend deactivating Javascript and other active content before you go searching for such sites. The active content on some of those sites is extremely annoying.

Custom cursors outside the map

You can use custom cursors on any HTML element by using the same type of cursor list in a CSS “cursor:” style setting.

Standard cursor keywords

Standard cursors are “auto”, “crosshair”, “default”, “help”, “move”, “pointer”, “text”, “wait”, and in some environments “hand”, “progress”, “not-allowed”, “no-drop”, “vertical-text” and “all-scroll”.

Changing cursors dynamically

You can change the cursors of a GDraggableObject at any time with .setDraggableCursor() and .setDraggingCursor(). With API versions up to v2.92 you can only set the map cursors with the {draggableCursor} and {draggingCursor} options at the time that you create the map.

It is possible to change the cursors of a map dynamically by using the .getDragObject() Method.

   map.getDragObject().setDraggableCursor("crosshair");

The map cursors are actually owned by the GDraggableObject that is used to control the dragging of the map and its contents.

More advanced stuff

Google Maps API Tutorial

Geocoding Low Quality Data

The technique for geocoding multiple addresses shown here is OK if your original address data is of reasonable quality.

I recently attempted to geocode a file of locations that had been collected in my family history system, and found that that mechanism wasn’t appropriate. Much of the data was collected from hand written documents, some of which are over 200 years old, so there are transcription errors. Some of the original information was obtained from illiterate individuals and uses strange spelling. Some of the streets no longer exist. Some of the towns have changed their names, e.g. “Layton with Warbreck” is now “Blackpool”. Some of the county boundaries have changed, e.g. the geocoder can’t find “Bowness, Westmorland” because it’s now in Cumbria.

I also seem to have hit several towns for which the geocoder has wildly inaccurate information. I have ancestors who came from Lytham, Charnock Richard, and North Meols.

My data was so bad that any sort of fully automated process would be useless. Every location needed to be looked at to see if the result is reasonable. Since I don’t actually know where the locations should be, I couldn’t drag a pointer to the correct locations. All I could do was to try modifying the address until the geocoder returned something sensible.

I ended up using two maps, one at street level and one zoomed out far enough so that I could see that the street was in the right town. I found that more convenient than zooming in and out with a single map.

Below the maps, I placed a control area in which the .getLocation() results could be displayed and selected, and the address text could be modified.

I display the results in XML format so that I can copy and paste the data into the final XML file. If your webhost supports server side scripting, you could post the data directly to your server to be stored in your online database.

I ended up with this

More advanced stuff

Google Maps API Tutorial

Custom direction details

GDirections.load() doesn’t give you much control over the layout of the directions information. If you want to have the directions displayed slightly differently, you have to read through the GRoutes and GSteps and build up the whole thing yourself.

Here’s a page where I’ve already done that to produce a display that looks almost exactly like that produced by GDirections, but since it’s all done in exposed Javascript, you can take a copy and customise the code to make it look the way that you want it to.

The parameters of my “customPanel()” function are:

  1. The map object.
  2. A string containing the name of the global variable that points to your map.
  3. The GDirections() object.
  4. The div into which the directions are to be placed.

Potential Pitfalls

  1. Don’t forget to use {getSteps:true} otherwise there won’t be any GRoute or GStep information to process
  2. The GDirections “load” event seems to happen just before it centres the map. If you are relying on GDirections to perform the initial centering of the map, then you have to set a short timeout after the “load” before the direction details are processed.