src/main/resources/public/geolocation.js
//only happens for the condition in creating user marker
only happens for the condition in creating user marker
only happens for the condition in creating user marker
function converUserLocationToReadableAddressSetup() {
  geocoder
    .geocode({ location: userLocation })
    .then((response) => {
      if (response.results[0]) {
        userLocation = response.results[0].formatted_address;
        var locationString = "";
        for (i = 0; i < userLocation.length; i++) {
          locationString += userLocation[i];
        }
        document.getElementById("name").innerHTML =
          "Your position is " + locationString;
        userMarkerInfoHelper();
      } else {
        console.log("location unknown");
      }
    })
    .catch((e) => window.alert("Geocoder failed due to: " + e));
}
function converUserLocationToReadableAddressSetup ( ) { geocoder . geocode ( { location : userLocation } ) . then ( ( response ) => { if ( response . results [ 0 ] ) { userLocation = response . results [ 0 ] . formatted_address ; var locationString = "" ; for ( i = 0 ; i < userLocation . length ; i ++ ) { locationString += userLocation [ i ] ; } document . getElementById ( "name" ) . innerHTML = "Your position is " + locationString ; userMarkerInfoHelper ( ) ; } else { console . log ( "location unknown" ) ; } } ) . catch ( ( e ) => window . alert ( "Geocoder failed due to: " + e ) ) ; }
only happens for the condition in creating user marker
only happens for the condition in creating user marker