Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

240 Part III — Google Map Hacks


photo.anchorTopLeft = new GPoint(lng,lat);
photo.anchorBottomRight = new GPoint(lng,lat);
map.addTPhoto(photo);

The idproperty should be used and enabled in the same way as TLabel. The opacity controls
the visibility of the image when it is overlaid, and the anchors for the top-left and bottom-right
extremities of the image should be self-explanatory.

Using TPhoto Overlays


A simple overlay has been generated that maps out some simple office structures, shown in
Figure 12-7.

FIGURE12-7: Office plan overlay.

To overlay the image, it is a simple case of initializing the map, creating a TPhotoobject, and
adding it to the map. The preamble is familiar, this time importing the TPhotoJavaScript
extension during the process:
<!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”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8”/>

<title>MCslp Maps Chapter 12, Ex 2</title>
<script src=”http://maps.google.com/maps?file=api&v=1&key=XXX”
type=”text/javascript”>
Free download pdf