Tag Archive for gmapapi

School families Google map

This week, I learned the next step: embedding a Google map with our data on our own (password protected) site. Twice in the past two years, I have created maps of students and employees in schools using BatchGeocode and Google Earth.

Given the flexibility of Google Earth, online resources cover a wide variety of ways to use the Google Maps API. Drupal’s GMap module is best suited for user submission of locations as separate nodes or a RSS feed. BatchGeocode provides locations in a single KML file, which I learned is XML for maps. The Google Maps API can index a KML file directly, but I didn’t want to submit our KML file to Google to index, and my tests of the strategy didn’t work anyway. GMapEZ is a special set of scripts using the Maps API but requires you to format your placemarks as conventional HTML links. Ultimately, this article at XML.com provided the most successful strategy for me: embedding points directly into the page and then adding listeners to create the popup information boxes. Embedding all the points keeps the data within our password-protected space, too.

You can accomplish this basically in a one-liner per placemark:

var marker220 = new GMarker(new GLatLng(45.51584,-122.702752)); map.addOverlay(marker220); GEvent.addListener(marker220, "mouseover", function() {marker220.openInfoWindow("Richard Kassissieh");})

A student included me in this project to create a carpool site for the Catlin Gabel community. Families find each other using the map and then post offers and requests for rides.

map