- This topic has 1 reply, 2 voices, and was last updated 16 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
DougMHMemberI’m really trying to get my hands around this whole AJAX business, both the more traditional Javascript type (GoogleMapsExample (GME)) and the ICE Faces business.
I’m currently looking at the GME and I find myself wishing there was an example that actually went back to my localhost server instead of an external source. Be that as it may, I can’t seem to understand this part of the Javascript of the GME. Hopefully the “google.load(“maps”,”2″); will be bold below.
I understand, or think I understand, the (src=”http://…) portion going to Google, but how does the “google” object suddenly appear? Does the call to (src=”http://…) return some google API and add it to standard Javascript objects capability… such as the “window” object? That’s all I can figure.
<script type=”text/javascript”
src=”http://www.google.com/jsapi?key=ABQIAAAA7rD1jbUY1XVWsL0ov0bKehRP189eykzPrrAV7tRgT92eURxrGxQHDNt6Nc2DQaubssvpI9493dhTGg”>
</script>
<script type=”text/javascript”>
google.load(“maps”, “2”); var map = null;
var geocoder = null;
google.setOnLoadCallback(function initmap() {
map = new google.maps.Map2(document.getElementById(“map”));
geocoder = new google.maps.ClientGeocoder();
});
</script>
<script type=”text/javascript” src=”resources/map.js”></script>Again, it would be really a nice thing if there was an example on demand that made a similar call to the localhost server instead of an external server such as Google… so that the whole thread could be followed instead of the Gooble black box.
Thanks for reading.
Doug Hurst
Riyad KallaMemberMoving to OT > Soft Dev
Doug unfortunately we’re tredding into “how do I use the Google Maps API” territory, and besides that simple demo that that I did, I really haven’t done that much with it. Fortunately it’s one of the most used APIs out there, sot he documentation is deep and wide:
http://code.google.com/apis/maps/As you mentioned that is also the learning curve of JavaScript as well… which when coming from straight Java, seems to have a lot of magic in it (like objects just appearing, or var name = “Todd”; name = 13; being totally valid code.
-
AuthorPosts