Did you have already Geolocation Support?
martinx1941 opened this issue · 3 comments
martinx1941 commented
function FindLocaiton() {
geocoder = new google.maps.Geocoder();
InitializeMap();
var address = document.getElementById("addressinput").value;
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
}
else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
valentasm1 commented
Duplicate. No
#178
martinx1941 commented
Hi valentasm1, i did not mean the google api geolocation.
i mean read out the current location direct from the browser
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"
Longitude: " + position.coords.longitude;
}
valentasm1 commented
It is not related to library at all.
30s google result
https://stackoverflow.com/questions/69428693/blazor-user-device-geolocation