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