Iv’d been searching All over the web for a solution to this, and Im still Unable to find any solve for it, iv’d been in googles own libery to find this.
I want the extract coordinates, from the GPS to use as center of my google maps so when your in fx. Copenhagen at Kongs nytorv you would get that position as center.
I have some options for my map here:
var myOptions = {
center: new google.maps.LatLng(55.674, 12.403),
zoom: 10,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.BOTTOM_CENTER
},
panControl: true,
panControlOptions: {
position: google.maps.ControlPosition.TOP_RIGHT
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE,
position: google.maps.ControlPosition.LEFT_CENTER
},
scaleControl: false,
scaleControlOptions: {
position: google.maps.ControlPosition.BOTTOM_CENTER
},
streetViewControl: true,
streetViewControlOptions: {
position: google.maps.ControlPosition.BOTTOM_CENTER
}
};
right now i have a static position as center.
But i cant find where to pull the information from
I keep on trying to solve this problem so we all get a solution the problem if possible
Here is an example from google docs
https://google-developers.appspot.com/maps/documentation/javascript/examples/map-geolocation
here is the code, in case this link is broken: