Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

javascript - Share my current location with the world publicly?

I'd like to create a website where I share MY current location with the world, I've been reading about this all morning but I can't see a way to embed this into a website so it's publicly view able, Is it possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could have your common URL redirect to your latest coordinates such as: - https://www.google.com/maps/place/-31.8878269,115.8162218/@-31.8878269,115.8162218,17z

IOW specify the Lon/Lat coords in the URL as parameters.

If you were to go for a more extensive solution then I suggest server intelligence would be required to keep a database of your (and your friends?) current location. A change could be polled from interested clients or a specific event could be pushed from the server and subscribed to in a client ServiceWorker.

If you choose this path then you will inevitably be confronted by the conumdrum that Web Apps can't track geolocation unless in the foreground and the phone is not asleep. So if you wanted your ski buddies to see which piste you're on or your cycling/jogging mates to see your progress then W3C/IETF flat-out refuse to acknowledge your very existence let alone your requirements/business case :-(

Exhibit A

Exhibit B


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...