简体   繁体   中英

How to get a Continuous Position on a Google Static Map?

I live in Monterey, CA and I own a Android smart phone. I created a webpage with Google Static Map Wizard and wanted to watch myself walk around town on my new phone by viewing the webpage on the phone. Is it possible to display a marker on the static map of my current (on the move) location? I am really into myself and would like to watch myself walk around town.

This is the code that I got out of the map wizard. Any help or direction would be very appreciated. I am not sure how to add the current location?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org    
/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<img src="http://maps.googleapis.com/maps/api/staticmap?center=36.595914,-121.887295&
zoom=16&format=png&sensor=false&size=400x500&maptype=hybrid" />
</body>
</html>

What have you tried yourself?

You can create an Android application that sends your current location to a web application, which can then modify the Google Maps image URL to include a marker at the specified location.

Another solution is using HTML5's Geolocation to add another marker to the map at your location. (Search for more information about this) This way you can avoid the need of server-side software, as everything can be done with HTML5 and JavaScript.

At any rate; it's a bit more complicated than just a static page with a map on it, so try to do some research first!

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM