현재 위치를지도에 표시해야합니다. 그 때문에지도로 표시하기 위해서는 위치 위도와 경도를 가져야합니다.
http://maps.googleapis.com/maps/api/geocode/xml?address=+" + MapAddress + "&sensor=false
이 페이지에서이 HTML 코드를 시도 :
에 의해 것을 얻는다.
<head>
<meta name='viewport' content='initial-scale=1.0, user-scalable=no' />
<style type='text/css'>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
<script type='text/javascript' src=https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false>
</script>
<script type='text/javascript'>
function initialize() {
var myLatlng = new google.maps.LatLng(str_lat,str_lng);
var mapOptions = {
center: myLatlng,
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:'Location!'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id='map-canvas'/>
</body>
</html>;
출처
2013-07-07 13:19:59
MSH
걷거나 차를 운전하거나 자신이있는 곳의 정적 인 위치를 추적하고 싶습니까? –
또한 답장 : http://stackoverflow.com/questions/43718998/share-my-current-location-with-the-world-publicly/43719290#43719290 – McMurphy