HTML5 Geolocation 定位服务 实例
本例采用html5 Geolocation 定位服务 和 google maps api 3 完成,运行时请确保你的浏览器支持 html5. <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.7&sensor=false"> </script> <script type="text/javascript"> function initialize(position) { var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); // position.coords.latitude 经度 //