So, we've got this intranet, right?  Well on it, we're doing this
carbon calculator to determine the distances to and from a specified
location for a particular meeting where people are going to need to
travel long distances.  I've built this using JavaScript -- and now
that it's finished, I'd like to add in a Google map for a bit of a
"wow" effect.  I've used the API before, but never at my real "work-
work" job.

In trying to place the generic example on the intranet, I find that
it's returning a generic  "not valid API key" error... hmm..  a little
searching reveals that gmaps on an intranet requires  $10,000/yr for a
premier account.  Yikes.  Considering, I'm a dirty little hacker, I
went to work in finding a way around this.  I mean really, if this
calculator were available on our public page (and it could very well
be placed there yet), there wouldn't be  any difficulties.... there's
no real need for public to use it as it's such a specialized
control... The only reason it's on the intranet is because it's an
internal meeting.  I've read through the TOS and I think, in essence,
the use is conformant despite being located on an internal page.... if
i'm incorrect here, plese let me know -- i'll just as soon not use the
service.

  So anyway...  I re-generate a new key for a public page and, sure
enough, placing the same generic example on a public page works fine.
I figured I would see if I couldn't get the public page to load the
code & import it into the internal page via an iframe....  a little re-
configuration of the "document.domain" properties of both pages and
I'm off to the races.  Using this code  ( I realize posting code is a
faux pas, but if I provided a link it would be password protected ...
"gmapcode" is an iframe with src to the public html page which
includes basically a single script reference to the gmap api using the
public page's api key):

var t = document.getElementById('gmapcode').contentWindow; for( var z
in t ) { try{ if( window[z]) continue; if( z.indexOf('frame') > 0 )
continue; window[z]=t[z]; } catch(e){} }

and this seems to work surprisingly well, it gives me to access to the
global maps objects created in the iframe -- so accessing something
like "GMap2" from the window on the internal page work.   One problem
though:   in attempting to drag the map, the mouse pointer changes to
the closed-hand and remains that way -- actually dragging has no
effect on the map.  At the same time, enableScrollWheelZoom seems to
work fine, changing the map position.  I suppose I'll chock this up to
my screwy setup.  I'll probably end up placing the map logic / DOM
node on the public page within the iframe, linked from intranet.

Ah well... anyone have any brilliant insights?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to