find Current Location using html

Discussion in 'iOS Programming' started by smsawant, Jun 29, 2009.

  1. smsawant macrumors newbie

    Joined:
    May 7, 2009
    #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. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
  3. smsawant thread starter macrumors newbie

    Joined:
    May 7, 2009
    #3
    thanks for your reply.

    we can find current location in iphone by including corellocation framework in our application.

    but i dont know how to find current location using html. i.e when destination address is given on the html page.

    i think to find current location using html is possible because if iphone has GPS and we can find location using google map.
     
  4. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #4
    Ok, let me rephrase. When using HTML you don't have access to the GPS chip in the device to tell it to gather the current location.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Not so sure about that. According to the "What's New in iPhone OS 3.0" guide, "Safari also supports the Geolocation JavaScript classes, which work with the onboard location services to retrieve the current location of the device." So, you might be able to use those services as well with your own UIWebView.
     
  6. Saladinos macrumors 68000

    Saladinos

    Joined:
    Feb 26, 2008
    #6
    Indeed. Safari now supports javascript objects for obtaining the current location of the device and for getting repeated updates of the location.

    However, for this, I think you're going to want to insert your latitude and longitude instead of "current+location". For example, CoreLocation can report you as being as 51.4777 latitude, 0.0000 longitude. If you googlemap 51.4777, 0 you will see your location.
     
  7. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #7
    Javascript != HTML
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    True dat. Sorry. I guess using "only HTML and Google Maps" it's not possible. But expanding slightly from those restrictions, it is.
     
  9. smsawant thread starter macrumors newbie

    Joined:
    May 7, 2009
    #9
    Thanks All of you for your timely help.
    Information that you have provided was really helpful for me.
     

Share This Page