How to send google maps location info through SMS

2019-01-22 14:52发布

问题:

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

回答1:

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.