I am currently in the process of converting my hobby site from V2 to
V3.  My site allows users to find where vintage aircraft are
displayed.  Here is an small example of my V2 map....
http://www.aerialvisuals.ca/LocationDossier.php?Serial=1429,Map=hybrid#TheMap

Anyway... I have created a test page for trying out the V3 features
before trying to integrate them into my site.  Here is the test page
of what I have so far...
http://www.aerialvisuals.ca/Admin/TestMap.php

In the V2 version of my maps users can contribute location information
by right clicking on the map and copying the lat and lon information
presented.  To see how it works try right clicking on the map via the
first link above.  The code I used to do this in V2 is...

map.enableInfoWindow();
GEvent.addListener(map,
         "singlerightclick",
         function(point, src, overlay)
         {
                var modPoint = new GPoint(point.x,point.y);
                var latLon   = map.fromContainerPixelToLatLng(modPoint);
                var decText  = latLon.toUrlValue();
                var coorText = convertDecToCoor(decText);
                var theHtml  = "<font face='Arial, Helvetica, sans-serif' 
size='4'
color='maroon'>Coordinates:<br></font>" +
                                   "<font face='Arial, Helvetica, sans-serif' 
size='3'
color='black'><span title='Aerial Visuals preferred coordinate
format.'>" + coorText + "<br></font>" +
                                   "<font face='Arial, Helvetica, sans-serif' 
size='2'
color='black'><span title='Decimal coordinate format.'>" + decText +
"</font>";
                map.openInfoWindowHtml(latLon,theHtml);
         });

I am trying to accomplish the same thing in V3.  I am not finding any
exact examples of this in the forum, through the reference guide or
tutorial, or by a Google search.  However I think I am close by
piecing it together from various related examples.  Here is what I
have so far...

                google.maps.event.addListener
                        (map, 'rightclick',
                        function(location)
                        {
                                var latLon   = location.latLng;
                                var decText  = latLon.toString();
                                var coorText = convertDecToCoor(decText);
                                var theHtml  = "<font face='Arial, Helvetica, 
sans-serif' size='3'
color='maroon'>Coordinates:</font><br>" +
                                                    "<font face='Arial, 
Helvetica, sans-serif' size='2'
color='black'>" + coorText + "</font><br>" +
                                                    "<font face='Arial, 
Helvetica, sans-serif' size='1'
color='black'>" + decText + "</font>";
                                var infoWindow = new 
google.maps.InfoWindow({content: theHtml,
position: latLon});
                                infoWindow.open(map);
                        });

To see it integrated with the rest of the code you can view the source
of the page via the second link above.

Obviously I would not be posting this if it did work, so I think I
need some help here.  The Firefox error console only says "a is
undefined" which is unfortunately not very helpful.  Any suggestions
as to what I am doing wrong?

I am very much looking forward to any suggestions anyone here may
have.  Thanks in advance!

Regards,

Mike Henniger

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to