Currentposition 機能が動作せず、Alert2
表示されていてもマップが表示されません。私を助けてください、私は解決策を見つけることができません
if (navigator.geolocation){
navigator.geolocation.getCurrentPosition(function (position) {
// Set the user's position
userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
alert("currentloc1 : "+ userLocation);
mapObject.setCenter(userLocation);
setUserMarker();
// Get the user's address if possible
geoCodeObject.geocode({ 'latLng': userLocation }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$("#location_details").html(results[0].formatted_address);
userAddress = results[0].formatted_address;
}
else {
var errormessage="There were no hospitals found at the location. Please provide another location.";
alertBox(errormessage);
$("body").css("cursor", "default");
}
});
},
function () {
userLocation = locationPune;
alert("currentloc2 : "+ userLocation);
},
{
timeout: 5000
}
);
}else{
userLocation = locationPune;
alert("currentloc3 : "+ userLocation);
}