I have an odd problem using computeDistanceBetween that is probably a stupid 
user error but, being a stupid and new user, I am unable to spot the 
reason. 

I have a simple subroutine that I call from two locations in my code.

// Distance between two points
function distBetween(a,b)
{
   var offset = google.maps.geometry.spherical.computeDistanceBetween(a,b);
   return offset;
}

One call works as expected whilst the other call returns:
Error: google.maps.geometry is undefined
Source File: http://mapcal.clanteam.com/MapCal.js Line: 940  (firefox)
Uncaught TypeError: Cannot read property 'spherical' of undefined (chrome)

What could cause google.maps.geometry to be undefined?

This is illustrated by website http://mapcal.clanteam.com/MapCal.html whilst 
http://mapcal.clanteam.com/MapCalZ.html has the offending subroutine call 
commented out (line 519 of MapCalZ.js).  

Note: The website uses both maps and calendars API to display calendar 
events on a map with directions between events.  To access your calendars it 
is needed to Login in to google calendars and grant the website access. 
 Ideally it will work best if you create a secondary calendar with a couple 
of events in the next 24 hours.  Dragging the map flag for a meeting will 
update the location and description of the calendar entry (so please dont 
try with an important business meeting - This is still a work in progress!) 
 - but it will also exercise the working call to distBetween.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/Uq7wN-gvlFkJ.
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