How to send google maps location info through SMS as a link

寵の児 提交于 2019-11-27 13:19:14

问题


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.


来源:https://stackoverflow.com/questions/19020802/how-to-send-google-maps-location-info-through-sms-as-a-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!