17

In an application that I'm building,

I am trying to send my location info(Lat,Long/ Geocoded) to my emergency contact list.

I am assuming that all my recipients are using smartphones(Android/iOS)

Until now, the application sends my location info as a string through SMS:

"I am at: " + Some Geocoded Location

However, I thought that this is not an optimal way of sending the exact location info.

So, I was thinking if it was possible to generate a map through Google Maps API with a

pinpoint/dot on it, and send a link to that map.

Can this be done in Device level(Without contacting any servers)

Or, can this be done by making my own map website?

Or, is this not possible at all?

I'd appreciate better approaches and suggestions as well.

Thank you in advance

Se Won Jang
  • 773
  • 1
  • 5
  • 12

1 Answers1

28

The simple and smarter way is to use q= parameter, so that it displays the map with the point marked.


Example -:

http://maps.google.com/?q=<lat>,<lng>

where lat- latitude, lng- longitude


If the device that receives the sms with the above link is one of following :

  • Smartphone(say android) , then it will show maps application in launching intent list on device when clicked on the above shared url.
  • If not (simple phone) the link will redirect to browser with the maps.google.com showing the location with pin point.
Arpit Garg
  • 8,476
  • 6
  • 34
  • 59
  • Thank you so much! One more thing: I need to code a receiver-side application if I want google maps to open right away right? – Se Won Jang Sep 26 '13 at 08:48
  • 1
    Please do not ask simple silly questions , do some R & D over your work requirement. For receiver side code snippet refer http://stackoverflow.com/questions/8132069/suppress-chooser-dialog-when-calling-google-map-using-intent – Arpit Garg Sep 26 '13 at 09:54
  • @Arpit can you please explain this – Abhishek Mar 10 '16 at 11:42
  • @Abhishek The above mentioned url can be send in text form to any phone. If the phone is not smartphone than the maps will open in mobile browser – Arpit Garg Mar 11 '16 at 07:35
  • @Arpit so you are saying that if i open this link then it will show my current location , right – Abhishek Mar 14 '16 at 05:25
  • @Abhishek It will not show current location , but the lat,lng values as specified in the q parameter – Arpit Garg Mar 15 '16 at 06:36
  • 2
    For those using urls in SMS text messages, I found that I had to encode the ',' (comma) separating the lat and long parameters. Encoded value is `%2C`. – Chris Knight Sep 17 '17 at 21:17