Google Maps not showing in an OAF Page - V3 API
875812Sep 22 2011 — edited Nov 1 2011Hi all,
We were using google maps v2 api and now I am trying to upgrade to V3. I just wrote a simple code to show just the map in an oaf page. I could see the div element but not the map. Below is the code in oa framework to call the js.
pageContext.putJavaScriptLibrary("myJsLibrary", "mapLibrary.js");
String googleJSRegistration = "<script language='javascript' src='http://maps.googleapis.com/maps/api/js?sensor=false'> </script>\n";
String loadFunc =
"var gmap = new GoogleInterface();" +
"gmap.enableLogging(" + loggingEnabled + ");" +
"function LoadGMap() { gmap.instantiateMap(); }";
Js file:
function GoogleInterface()
{
function instantiateMap()
{
// Map = new GMap2(document.getElementById('googleMap'));
var myOptions = {
zoom: 4,
center: new google.maps.LatLng(37.062500, -95.677068),
panControl: true,
mapTypeControl: true,
scaleControl: true,
streetViewControl: true,
overviewMapControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
Map = new google.maps.Map(document.getElementById("googleMap"),myOptions);
}
`}
Could someone please help me with this?
Thanks in advance.