Hacking Google Maps and Google Earth (ExtremeTech)
Chapter 9 — Using Overlays 155 } } } request.send(null); } } The basic process is as listed earlier — the page is loaded, and du ...
156 Part III — Google Map Hacks Generating an XML File Dynamically In the previous example a static XML file was generated by ad ...
Chapter 9 — Using Overlays 157 The most important line in this script is the one that outputs the HTTP header. When supplying XM ...
158 Part III — Google Map Hacks Listing 9-6:Creating the Table Structure #!/usr/bin/perl use DBI; my $dbh = DBI->connect( ‘db ...
Chapter 9 — Using Overlays 159 my ($title,$lng,$lat) = split /:/; $dbh->do(sprintf(‘insert into ch09_simple values(%s,%s,%s)’ ...
160 Part III — Google Map Hacks Listing 9-8(continued) push(@lines, sprintf(‘<marker lat=”%f” lng=”%f” title=”%s”/>’, $row ...
Chapter 9 — Using Overlays 161 printf(‘<marker lat=”%f” lng=”%f” title=”%s”/>’, $row->{lat}, $row->{lng}, $row->{ ...
162 Part III — Google Map Hacks Listing 9-10: Adjusting the JavaScript to Create an Information Window function addmarker(x,y,ti ...
Chapter 9 — Using Overlays 163 Creating More Detailed Windows from XML and XSLT The Extensible Stylesheet Language (XSL) provide ...
164 Part III — Google Map Hacks Listing 9-11 (continued) { printf(‘<marker lat=”%f” lng=”%f” title=”%s”><infowindow> ...
Chapter 9 — Using Overlays 165 Listing 9-12: The XSL <?xml version=”1.0” encoding=”ISO-8859-1” ?> <xsl:stylesheet versi ...
166 Part III — Google Map Hacks Listing 9-13 (continued) request.open(‘GET’,’/examples/ch09-11.cgi’, true); request.onreadystate ...
Chapter 9 — Using Overlays 167 You can see the resulting information window in Figure 9-4. The information displayed is much mor ...
168 Part III — Google Map Hacks Dividing the Application into Components Before the specific scripts and elements are described, ...
Chapter 9 — Using Overlays 169 The final system relies on three components: An HTML file with embedded JavaScript that provides ...
170 Part III — Google Map Hacks script that provides an interface to the database. The CGI script is asked for a list of cities, ...
Chapter 9 — Using Overlays 171 Listing 9-16: Loading Markers for a City function loadcity(index) { map.clearOverlays(); message. ...
172 Part III — Google Map Hacks Moving the Map and Adding Information When the user clicks a restaurant in the information windo ...
Chapter 9 — Using Overlays 173 Calculating Where to Center the Map The final stage of moving the map to the location of the city ...
174 Part III — Google Map Hacks Listing 9-20: Updating the onLoad() Function function onLoad() { if (GBrowserIsCompatible()) { i ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf