I implement two different types of google maps on my site.
The first simply shows predefined locations with markers using MapTypeID:
mapTypeId: google.maps.MapTypeId.ROADMAP
The second allows the user to interact by dragging / dropping markers on the map, etc.
I call my API like this:
<script src="http://maps.google.com/maps?file=api&v=2.x&sensor=false&key=ABQIAAAAfK8z5AsiUZwKZF5CkZMF6BTAb5FWVJrlydeWm3IWDEdBI1HaUhTpyn3_qR2q3IPbPnQKou9lkKVqIA" type="text/javascript"></script>
When starting my first map, I get this error:
Uncaught TypeError: Cannot read property 'ROADMAP' of undefined
If I load the Google Maps API in another way:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
The error from the first map disappears, but now I get this error when starting the second map:
Uncaught ReferenceError: GOverlay is not defined Uncaught ReferenceError: GControl is not defined Uncaught ReferenceError: GControl is not defined Uncaught ReferenceError: GCopyright is not defined
I think the problem is with one map requiring an older version of google maps API. Can I download two separate Google Maps APIs?
thanks
source share