开发者

Launch google map from mobile Browser

I was using "google local" on NOKIA 6800 browser the search result page had a link "view on map?" Clicking on i开发者_开发百科t launched Google Maps application, and map centered on the location of the search result.

how it is done?? Javascript ?? I have seen similar behavior in Iphone


For a static map you can use:

http://maps.google.com/maps/api/staticmap?center=kerstendalseweg%2017,berg%20en%20dal,%20nederland&zoom=14&size=400x400&sensor=false

Wrapped in an anchor for use in a HTML page:

<a href="http://maps.google.com/maps/api/staticmap?center=kerstendalseweg%2017,berg%20en%20dal,%20nederland&zoom=14&size=400x400&sensor=false">Go to Vette BSO</a>

For starting navigation I used this (with start en destination address)

<a href="http://maps.google.com/maps?saddr=kerstendalseweg 17, berg en dal, nederland&daddr=51.8285781,5.9287059">Go to Vette BSO</a>

From google maps API docs: You can also easily link to Google Maps for driving directions. We suggest you use the following format for driving directions on Google Maps:

http://maps.google.com/maps?saddr={start_address}&daddr={destination_address} 


It depends what mobile you use.

On Android you can use either http://maps.google.com/maps? prefix or geo:lat,long? prefix in url. Invoking Google Applications on Android Devices

On Iphone you can use comgooglemaps://? prefix: Google Maps iOS URL Scheme

To detect mobile device type use the following java script (this one detects iPhone or iPad):

if ((userAgent.indexOf('iPhone') != -1) || (userAgent.indexOf('iPad') != -1) )
    window.location = "comgooglemaps://?saddr=london&daddr=manchester"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜