On Jul 21, 2:50 pm, Renuka <[email protected]> wrote:
> Hi,
>
> I recently started with google maps API. I got a key generated for the
> domain "localhost". My service provider does not give away static ip
> addresses to non-commercial connections.
> Of course, google expects a static IP from the network which
> registered the key.
>
> But, I registered for the key 2 days back and since then, my IP didnot
> change. My page uses a simple code to just render the map.
>
> <html>
>     <head>
>
>         <script type="text/javascript" src="http://maps.google.com/
> maps/api/js?
> sensor=false&amp;key=ABQIAAAAWBPr9nPLAlfFlaaLpfnz6RT2yXp_ZAY8_ufC3CFXhHIE1N­vwkxShNKH4EKuy3gDAF6FcmCVNvvD55g"></

keys are not required for v3 of the API.

> script>
>
>         <script type="text/javascript">
>
>             initialize();
>
>             function initialize() {
>                 var myLatlng = new google.maps.LatLng(-34.397,
> 150.644);
>                 var myOptions = {
>                     zoom: 8,
>                     center: myLatlng,
>                     mapTypeId: google.maps.MapTypeId.ROADMAP
>                 }
>                 var map = new
> google.maps.Map(document.getElementById("map_canvas"), myOptions);
>             }
>         </script>
>     </head>
>
>     <body>
>         <div id="map_canvas"></div>
>
>     </body>
>
> </html>
>
> When I hit the page, I get a script error: 'null' is null or not an
> object. athttp://...staticmaps...../main.js.
> Now, is the error because my key is invalid as I have a dynamic ip?

Don't know.  If you post your page to a public webpage, we could run a
debugger on it and possibly tell you.  At this point, you are the only
one that can do that.

Other than the fact you don't need a key for v3, there isn't anything
I can see that is wrong, but my web browser is a lot better at finding
errors than my eyes...

Although, looking for your call of initialize, I see that it is in the
wrong place. You want to call initialize once the DOM has been
completely rendered (usually in the body onload function).

  -- Larry

-- 
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.

Reply via email to