> From: Rossko
>
> Have you got a browser javascript debugger yet?
> Firefox tells me -
> _gel is not a function
> and it's complaining about
> _gel("status").innerHTML = "loading...";
>
> _gel is just a <span> element, it is not a javascript
> function, you can't do _gel("status") Try replacing that line with
> _gel.innerHTML = "loading...";
> and then checkout the next line
> _gel("content").innerHTML = "";
> which is going to fail in the same way. I'd be inclined to
> just comment that one out.
No, _gel() is a Google Gadget API function which is just a shortcut for
document.getElementById():
http://code.google.com/apis/gadgets/docs/legacy/reference.html
You can provide your own implementation for the Maps API:
function _gel( id ) { return document.getElementById(id); }
> > I'll explain what I think needs to done again. ....
> > So I believe I would need to change this part:
> > map.getBoundsZoomLevelAsync(bounds, function(level) { ....
>
> It's your page, change what you like :)
> It's quite true that the javascript GMap2 object doesn't have
> a getBoundsZoomLevelAsync(), but it does have a getBoundsZoomLevel().
> That's not asynchronous, it has no callback function, you
> just use it directly. The page I'm looking at never gets
> that far so I haven't worried about it yet.
For the sync vs. async API issue, the cleanest way to deal with it is to use
GAsync(). This allows you to write the same code for both the Mapplet and
Maps API. For example, this code:
map.getBoundsZoomLevelAsync( bounds, function(level) {
// ...
});
would be:
GAsync( map, 'getBoundsZoomLevel', [bounds], function(level) {
// ...
});
and this code can work in either a mapplet or a Maps API page.
GAsync is part of the Mapplet API, but for the Maps API you'll need to
include the GAsync source code which you can get here:
http://mg.to/2007/06/22/write-the-same-code-for-google-mapplets-and-maps-api
http://mg.to/mapplet/async/async.js
-Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---