Ruben Cherigo
Ruben Cherigo

Reputation: 11

Oracle Apex Javascript get value

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.

Upvotes: 1

Views: 1427

Answers (1)

Abolfazl Aghili
Abolfazl Aghili

Reputation: 111

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

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

Upvotes: 4

Related Questions