I'm having some trouble when i want to get current location.
This is my first time using this GM API, and there are so much things i don't understand.
Here is my code, and i want
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
});
}
The problem is, i want to change -7.7801502 and 110.3846387 value automatically based on user's current position. Can i do that?
Thanks before for your help and explanation.
Another question : -> What if i'm going to change those value based on a device embedded with GPS?