Hum, I find a solution on this page. http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/ The author says, the key is not necessary to be used in the version 3.
"Inserting a reference to the API The first thing you will notice is that the API key is no longer necessary. In the previous versions the API key was inserted as a querystring into the script reference but not so anymore. This means that you don’t have to apply for a new API key for every domain you want to have a map at. It also means that the URI to the API is a lot shorter." Now I should find a way to define the version.. On Jul 20, 10:04 am, ddoc <[email protected]> wrote: > Hi, > > I don't understand how the reference work in GoogleMpa. > When I develop I use this <script type="text/javascript" src="http:// > maps.google.com/maps/api/js?sensor=false"></script> . > But when I want to deploy it I add the script <script src="http:// > maps.google.com/maps? > file=api&v=3&sensor=false&key=ABQIAAAAc8ZAYeiGmj5Tv8KeVlcZTBT2y > Xp_ZAY8_ufC3CFXhHIE1NvwkxRiqKyLF1_Ld6N0mH3F4ktRuMnqcg" > type="text/javascript"></script> > > In that case, when I launch the page, the browser say this method > doesn't exist? > But I can see the method below in the page about the API > 3http://code.google.com/apis/maps/documentation/javascript/reference.h... > map.setStreetView(panorama); > > If I remove the second line <script src="http://maps.google.com/maps? > file=api&v=3&sensor=false&key=ABQIAAAAc8ZAYeiGmj5Tv8KeVlcZTBT2y > Xp_ZAY8_ufC3CFXhHIE1NvwkxRiqKyLF1_Ld6N0mH3F4ktRuMnqcg" > type="text/javascript"></script> it's works, Why? > > If I let the second line and remove the first, I obtain another error. > Line: 8 > Error: 'google.maps.MapTypeId.ROADMAP' is null or not an object > Why? > > So my point is it's work only with <script type="text/javascript" > src="http://maps.google.com/maps/api/js?sensor=false"></script>. > > The begin of the script where I obtain the error is > <script type="text/javascript" src="http://maps.google.com/maps/api/ > js?sensor=false"></script> > <script src="http://maps.google.com/maps? > file=api&v=3&sensor=false&key=ABQIAAAAc8ZAYeiGmj5Tv8KeVlcZTBT2y > Xp_ZAY8_ufC3CFXhHIE1NvwkxRiqKyLF1_Ld6N0mH3F4ktRuMnqcg" > type="text/javascript"></script> > <script type="text/javascript"> > function initMap() > { > var point = new google.maps.LatLng("53.590964", > "-2.297108"); > var myOptions = { > zoom: 11, > mapTypeId: google.maps.MapTypeId.ROADMAP, > center: point, > streetViewControl: true > } > map = new > google.maps.Map(document.getElementById("map_canvas1"), myOptions); > map.setCenter(point); > > //init StreetView > var panoramaOptions = { > addressControl: false, > pov: { > heading: 394, > pitch: -3.333333333333332, > zoom: 1 > } > }; > panorama = new > google.maps.StreetViewPanorama(document.getElementById("pano"), > panoramaOptions); > map.setStreetView(panorama); > > Best regards, > Alexandre -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
