1

I'm using Google Map to get the lat and long in Oracle Apex and i want to get the value of console console.log('latitude1: ' + mapsMouseEvent.latLng.lat() + ',longitude1: ' + mapsMouseEvent.latLng.lng() );

<script>

    
function initMap() {
    var lat;
    var lng;
    const myLatlng = { lat: 8.9671994, lng: -79.5665534 };
    const map = new google.maps.Map(document.getElementById('googlemap'), {
        center: new google.maps.LatLng(8.9671994, -79.5665534),
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        zoom: 8,
        center: myLatlng,
        gestureHandling: "greedy",
    });

  // Create the initial InfoWindow.
  let infoWindow = new google.maps.InfoWindow({
    content: "Click the map to get Lat/Lng!",
    position: myLatlng,
  });
  infoWindow.open(map);

  // Configure the click listener.
  map.addListener("click", (mapsMouseEvent) => {
    // Close the current InfoWindow.
    infoWindow.close();

    // Create a new InfoWindow.
    infoWindow = new google.maps.InfoWindow({
      position: mapsMouseEvent.latLng,
        

        
    });
     console.log('latitude1: ' + mapsMouseEvent.latLng.lat() + ',longitude1: ' + mapsMouseEvent.latLng.lng() );   
    infoWindow.setContent(
      JSON.stringify(mapsMouseEvent.latLng.toJSON(), null, 2)
    );
    infoWindow.open(map);
    

      
  });
    
}    
</script>

I'm using a dynamic action event:mouse move, and execute javascript code:

$v("P8_INFO",this.mapsMouseEvent.latLng.lat());

but i can't get the value of this.mapsMouseEvent.latLng.lat().

thx.

0

1 Answer 1

4
//for get value
alert($v("P8_INFO"));

//for set value
$s("P8_INFO",this.mapsMouseEvent.latLng.lat());

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.