Binoy Kumar Binoy Kumar - 2 months ago 14
ASP.NET (C#) Question

Why GoogleMap is not showing with key and is showing with v in my .net project

I am struck in a problem while using google map in my .net project


<script src="http://maps.google.com/maps/api/js?v=3&libraries=places&sensor=true" type="text/javascript"></script>


When I am using the above code I am properly getting the google map but if I tried to add key

<script src="http://maps.google.com/maps/api/js?key=xxxx-&libraries=places&sensor=true" type="text/javascript"></script>


Map is not showing and also getting this error


Uncaught TypeError: Cannot read property '__e3_' of undefined


I also tried

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=xxxxxxxx_xxx---------&libraries=places"></script>


But still it is not working.
Any suggesstion?

Answer

If you omit the "v=3" parameter, it defaults to the experimental version of the API (if you have a standard plan account). It appears that there is a fault with the experimental version that's not displaying a map at the moment. So add the "v=3" parameter in addition to the other parameters.

<script src="http://maps.google.com/maps/api/js?v=3&key=<YourAPIKey>&libraries=places&sensor=true" type="text/javascript"></script>