Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 9 — Using Overlays 151


EOF


}


sub js_movemap
{


print <<EOF;
function movemap(index) {
map.recenterOrPanToLatLng(points[index]);
}
EOF


}


sub page_footer
{
print <<EOF;










Restaurants




EOF

}


Although Listing 9-2 is dynamic, it is only dynamic in that the information is being generated
on the fly. It generates a static HTML page that works identically to the first example. The
map itself and the information it portrays are not dynamic; the content and highlights on the
map will be modified when the page is reloaded. This is essentially the same behavior as seen in
the previous example. In short, though it technically is dynamically generating the information,
it really isn’t a dynamic map.


Using AJAX


For a dynamic map you need to use Asynchronous JavaScript and XML, or AJAX for short.
AJAX is a methodology for loading information dynamically within a web page using
JavaScript. With AJAX, the HTML page that is used to load the map and other information is
static, but the JavaScript that is embedded within that page is capable of loading its own data
and information, which it can then use to alter the information and operations on the map or
the data displayed within the HTML.

Free download pdf