tags:

views:

770

answers:

1

when i send email which contain destination address when user will click on that address he should get directions from his current location to destination address on google maps.

i tried to do using following code

http://maps.google.com/maps?daddr=DestinationAddress&saddr=current+location&view=map&z=12"

but current location word does not worked. how can we find user's current location in iphone by using only html and google map. can we pass any parameter to google map so it can track user's current location. any one have any idea?

kinldy help me.

+2  A: 

You can get the location in Javascript.

The api is based on this spec.

And here's a running sample.

Some code extract:

function findLocation() {
    navigator.geolocation.getCurrentPosition(foundCallback, errorCallback, {enableHighAccuracy:true,maximumAge:600000});
}
pgb