Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

executing Javascript crashes by first loading the application with included google maps api

halitevliJul 6 2014 — edited Jul 11 2014

Hi,

I'm an oracle forms developer and new in Apex. Apex is a wonderful RAD-Tool. So, I currently developing a mobile app with integrated Google Maps functionality. For several days I'm stuck on the following problem:

Demo page: https://apex.oracle.com/pls/apex/f?p=364::4931249888545:::::

When I run this the first time it hangs after the logging point "alert("2:geocoder");" in the script. But after refresh the "Page 2" is execute the script completely fine.

If I then execute the page/application and previously browser cache deleted is the problem there again.

Here the implementation (one of many hundreds different try ):

Page1: Button "Gopage2": Redirect to page2

Page2:

   - Page Settings:

          JavaScript File URLs: https://maps.googleapis.com/maps/api/js?v=3.exp

          Function and Global Variable Declaration:

function getRevLocation(){

var geocoder;

var marker;

var lat;

var lng;

alert("Start");

lat = parseFloat(48.9304902);

lng = parseFloat(8.4458497);

//lat = parseFloat($x("P6_LATITUDE").value);

//lng = parseFloat($x("P6_LONGITUDE").value);

alert (lat+"/"+lng);

var latlng = new google.maps.LatLng(lat, lng);

alert("1:latlng");

geocoder = new google.maps.Geocoder();

alert("2:geocoder");

geocoder.geocode({'latLng': latlng}, function(results, status) {

alert("3:inFunction");

  if (status == google.maps.GeocoderStatus.OK) {

    if (results[1]) {

       alert("4:StatusOK"+results[1].formatted_address);

       $s("P2_CITY",results[1].formatted_address);

    }

  } else {

     alert("6:Error");

     $s('P2_CITY',('Geocoder failed due to: ' + status));

    }

});

}

          Execute when Page Loads:

getRevLocation();

   

Please HELP. I am totally desperate.

Best regards

Halit

This post has been answered by halitevli on Jul 11 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2014
Added on Jul 6 2014
4 comments
1,788 views