У меня возникают проблемы, когда я хочу получить текущее местоположение.
Это мой первый раз, когда я использую этот GM API, и есть так много вещей, которые я не понимаю.
Вот мой код, и я хочу
var geocoder = new google.maps.Geocoder();
function initialize() {
var latLng = new google.maps.LatLng(-7.7801502, 110.3846387);
var map = new google.maps.Map(document.getElementById('mapCanvas'), {
zoom: 15,
center: latLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker = new google.maps.Marker({
position: latLng,
title: 'Ambarrukmo Plaza Yogyakarta',
map: map,
draggable: true
});
}
Проблема в том, что я хочу изменить значение -7.7801502 и значение 110.3846387 автоматически на основе текущей позиции пользователя. Могу ли я это сделать?
Благодарим вас за помощь и объяснение.
Другой вопрос: - > Что делать, если я собираюсь изменить это значение на основе устройства, встроенного в GPS?