Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 4: The Google Web API


Listing 3-2:XHTML for VML/Polylines in Internet Explorer

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”


http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xmlns:v=”urn:;
schemas-microsoft-com:vml”>




<title>Your Page Title Here</title>
<style type=”text/css”>
v\:* {
behavior:url(#default#VML);
}
</style>
<script src=”http://maps.google.com/maps?file=api&v=1&key=abcdefg”

type=”text/javascript”>
</script>
</head>

Styles and Elements


You are completely free to develop and design your own styles, stylesheet, and layout according
to the needs of your web site. Google Maps does not place any limitation or restriction on how
you lay out or style your web site when it includes a Google Map.


However, the map will tend to dominate most pages, and you should take this into account
when designing the layout and other content for your pages.


XML (Extensible Markup Language)


The XML standard is a way of representing data in a structured format that is architecture
neutral. Although XML is not a required element in Google Maps applications, it is common
to provide large volumes of data (map points, information windows, and so on) by specifying
the information in XML, loading the XML through the Google Maps API, and then display-
ing that information using the functionality of the API. The API also supports XSL
Transformations, a method of converting an XML document into HTML using a stylesheet.


Generating, parsing, and using XML is covered in more detail in Chapter 5.

Free download pdf