Chapter 7: Integrating with iPhone Services Trong khi Google Maps không có giao thức riêng của href tùy chỉnh của nó, Mobile Safari trên iPhone có đủ thông minh để định tuyến lại bất kỳ yêu cầu để tích hợp ứng dụng bản đồ thay vì đi trang web công cộng Web Google | Chapter 7 Integrating with iPhone Services Pointing on Google Maps While Google Maps does not have its own custom href protocol Mobile Safari on iPhone is smart enough to reroute any request to to the built-in Maps application rather than going to the public Google Web site. On iPod touch Mobile Safari links directly to the public Google Web site. As a result you can create a link to specify either a specific location or driving directions between two geographical points. You cannot specify whether to display the map in Map or Satellite view. The location you specify will be displayed in the last selected view of the user. Keep in mind the basic syntax conventions when composing a Google Maps URL For normal destinations start with the q parameter and then type the location as you would a normal address substituting signs for blank spaces. For clarity include commas between address fields. Here s a basic URL to find a location based on city and state a href http maps q Boston MA Boston a Here s the syntax used for a full street address a href http maps q 1000 Massachusetts Ave Boston MA Jack Armitage s Office a 167 Chapter 7 Integrating with iPhone Services When the address shown previously is located in Google Maps the marker is generically labeled 1000 Massachusetts Ave Boston MA. However you can specify a custom label by appending the URL with Label Text as shown in the following example a href http maps q 1000 Massachusetts Ave Boston MA Jack Armitage s Office Jack Armitage s Office a Figure 7-10 shows the custom label in Google Maps. Figure 7-10 Customizing the Google Maps label You can specify a location using latitude and longitude coordinates as well a href http maps q Jack s Summer Retreat a 168 Chapter 7 Integrating with iPhone Services To get directions use the saddr parameter to indicate the starting address and daddr parameter to specify the destination .