Hi again António,
Please note that some browsers (if not all) only support location requests on an HTTPS web page
Starting with Chrome 50, Chrome no longer supports obtaining the user’s location using the HTML5 Geolocation API from pages delivered by non-secure connections. This means that the page that’s making the Geolocation API call must be served from a secure context such as HTTPS.
I presume that by “run on the server” you mean open the web page on a browser running on the server.
Please go to https://www.w3schools.com/html/html5_geolocation.asp and click the blue button Try it. The browser should ask your permission to access the location.
Thanks for your answer but i get this error
private async void buttonCurrentLocation_Click(object sender, EventArgs e)
var position = await geolocation.GetCurrentPositionAsync(); <—- Error
this.maskedTextBoxLat.Text = position.Latitude.ToString();
this.maskedTextBoxLng.Text = position.Longitude.ToString();
Error 47 ‘Wisej.Web.Ext.GoogleMaps.GoogleMap’ does not contain a definition for ‘GetGeocodeAsync’ and no extension method ‘GetGeocodeAsync’ accepting a first argument of type ‘Wisej.Web.Ext.GoogleMaps.GoogleMap’ could be found (are you missing a using directive or an assembly reference?)
var position = await geolocation.GetCurrentPositionAsync(); this.maskedTextBoxLat.Text = position.Latitude.ToString(); this.maskedTextBoxLng.Text = position.Longitude.ToString();
Please login first to submit.