Integrating Maps into Your Java Web Application with Google Maps and Ajax

John Ferguson Smart has written a nice article on Integrating Maps into Your Java Web Application with Google Maps and Ajax. The article focuses on the Google Maps API (the only server side piece is a simple Servlet), and takes you through learning the API, and then using more advanced techniques such as dynamic markers, and ondemand (via ajax) content inclusion:
function fetchDetails(id) { var req = GXmlHttp.create(); req.open("GET", "/maps/SiteDirectory?id="+id, true); req.onreadystatechange = getCallbackFunction(req, displayDetails); req.send(null); }function displayDetails(siteDetailsXML) { // Get the root "site" element from the document var site = siteDetailsXML.getElementsByTagName("site")[0]; var name = getNodeValue(site.getElementsByTagName("name")[0]); var id = getNodeValue(site.getElementsByTagName("id")[0]); var symbol = getNodeValue(siteDetailsXML.getElementsByTagName("symbol")[0]); var website = getNodeValue(siteDetailsXML.getElementsByTagName("website")[0]); var address = site.getElementsByTagName("address")[0] var address1 = getNodeValue(siteDetailsXML.getElementsByTagName("line1")[0]); var address2 = getNodeValue(siteDetailsXML.getElementsByTagName("line2")[0]); var city = getNodeValue(siteDetailsXML.getElementsByTagName("city")[0]); var postcode = getNodeValue(siteDetailsXML.getElementsByTagName("postcode")[0]); marker = getMarker(id); marker.showMapBlowup(); var html = '<span class="site-title-line">' + name + ' (' + symbol + ')' +'</span>' + '<span class="site-details-line">' + address1 +'</span>' + '<span class="site-details-line">' + address2 +'</span>' + '<span class="site-details-line">' + city + ' ' + postcode +'</span>' + '<span class="site-details-line">' + '<a xhref="' + website + '">' + website + '</a>' +'</span>' marker.openInfoWindowHtml(html); }

Zero. Zilch. Nada. None. No commento.

Feel free to leave related comments here!

Rather Leave A Voice Comment?

Feel free to leave voice comments here!

Social Bookmarking

del.icio.us:Integrating Maps into Your Java Web Application with Google Maps and Ajax digg:Integrating Maps into Your Java Web Application with Google Maps and Ajax spurl:Integrating Maps into Your Java Web Application with Google Maps and Ajax furl:Integrating Maps into Your Java Web Application with Google Maps and Ajax Y!:Integrating Maps into Your Java Web Application with Google Maps and Ajax

Leave a comment

The most recent replies are displayed at the top. Please comment accordingly. Your name and email are required. Track comments via RSS.

Next Generation Ecommerce Software & Web Store Platform > Fast, Simple, Friendly Stores
RSS
Stores  Features  Blog  Archives  About  Contact       © 2006 Web 2.0 Stores