Hacking Google Maps and Google Earth (ExtremeTech)
Chapter 13 — I Need to Get To... 255 Here is the code for the startRoute()function: function startRoute() { routelistener = GEve ...
256 Part III — Google Map Hacks Nothing else changes aside from the status message. By not zeroing the list of points or chang- ...
Chapter 13 — I Need to Get To... 257 routedescription.value = ‘’; infopanel.innerHTML = ‘’; message.innerHTML = ‘Recording a new ...
258 Part III — Google Map Hacks To finish off the process, you also zero all of the variables used for storing information about ...
Chapter 13 — I Need to Get To... 259 var xmlsource = request.responseXML; var msg = xmlsource.documentElement.getElementsByTagNa ...
260 Part III — Google Map Hacks Next, the function sends a suitable request through to the backend database interface. The scrip ...
Chapter 13 — I Need to Get To... 261 A new point is created and pushed onto an array of points. The array is to recenter the map ...
262 Part III — Google Map Hacks <point lat=”-1.139830” lng=”52.947000”/> <point lat=”-1.139830” lng=”52.947000”/> &l ...
Chapter 13 — I Need to Get To... 263 FIGURE13-2: Showing a list of available routes and starting points. Then the individual ele ...
264 Part III — Google Map Hacks var routepoints = xmlsource.documentElement.getElementsByTagName(“point”); for (var i=0;i < r ...
Chapter 13 — I Need to Get To... 265 message = document.getElementById(“message”); rrecording = document.getElementById(“rrecord ...
266 Part III — Google Map Hacks Database Structure. The application stores routes, and for each route there are two distinct set ...
Chapter 13 — I Need to Get To... 267 elsif(param(‘m’) eq ‘getroute’) { getroute(param(‘routeid’)); } This section is just a simp ...
268 Part III — Google Map Hacks The resulting list of rows is then returned as XML, using attributes to identify the individual ...
Chapter 13 — I Need to Get To... 269 my @pointlist = split(/,/,$points); my $routeid; if (defined(param(‘routeid’)) && p ...
270 Part III — Google Map Hacks Again, a simple message is returned to indicate the completion of the operation. Obtaining a Sin ...
Chapter 13 — I Need to Get To... 271 In addition to calculating the total distance, the XML for each point also needs to be gene ...
272 Part III — Google Map Hacks Note that even with this formula, the exact distance may be different because the earth is not a ...
Chapter 13 — I Need to Get To... 273 FIGURE13-3: Initial application state. FIGURE13-4: A recorded route ready for saving to the ...
274 Part III — Google Map Hacks FIGURE13-5: The saved route, now loaded from the database. FIGURE13-6: The list of available rou ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf