0
표시 하시겠습니까? 귀하의 위치를 URL에 공유하고 싶지만지도를 표시하지 않습니까? 어디서 잘못 될 수 있는지 궁금합니다. 하지만 사파리와 크롬Google지도 API :지도를 표시 할 수 없음
$(document).ready(function(){
initialize();
$("#btInit").click(function(){
navigator.geolocation.getCurrentPosition(onSuccess);
}); //call this function when the user click
});
var map;
// MAP
function initialize() {
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var mapOptions = {
zoom: 17
};
}
// 위치 정보
function onSuccess(position){
var myLat = position.coords.latitude;
var myLong = position.coords.longitude;
var latLng = new google.maps.LatLng(myLat, myLong);
map.setCenter(latLng);
google.maps.event.addDomListener(document, initialize);
나는이 링크를 따라야 만한다. http://www.paulund.co.uk/how-to-use-geolocation-api-with-google-maps –