Skip to content Skip to sidebar Skip to footer

"google.maps.MapTypeId Is Undefined" When Using GMAP3 In FF 14

Testing the sample code from gmap3:

Solution 1:

You can try naming your function that initializes the map and then put it as callback in the link loading Google Maps api.

Something like this:

<script src="http://maps.google.com/maps/api/js?sensor=false&language=zh&callback=initMainMap" type="text/javascript"></script>

<script type="text/javascript">
   function initMainMap(){
      //function body
   }
</script>

Original answer from here: Google Maps API v3 - TypeError... https://stackoverflow.com/a/8361021/1266136


Solution 2:

might be a little late, but for me it helped adding this line:

var myLatlng = new google.maps.LatLng(0.0, 0.0);

before you call mapTypeId: google.maps.MapTypeId.TERRAIN

Like this:

 var myLatlng = new google.maps.LatLng(0.0, 0.0); // this will somehow initialize google.maps...
 $('#geoTestDiv').gmap3(
              { action: 'addMarker',
                latLng : [46.578498,2.457275],
                map:{
                  center: true,
                  zoom: 14,
                  mapTypeId: google.maps.MapTypeId.TERRAIN
                }
              }
              );

Post a Comment for ""google.maps.MapTypeId Is Undefined" When Using GMAP3 In FF 14"