Das Blog

Debugging one line at a time
$1*/ mo WordPress hosting! Get going with GoDaddy!
Menu
  • Home
  • Coding
    • Entity Framework
    • MVC
    • NHibernate
  • JavaScript
    • TypeScript
  • Hosting
  • SEO
  • Social
  • Database
    • MySql
    • SSIS
  • WP
  • Other
    • CakePHP
    • Error Messages
    • Google Maps
Home
Other
Google Maps
My Google Map Api Key is not working in my development environment
Google Maps

My Google Map Api Key is not working in my development environment

Codex Discipulus January 3, 2010
Google Maps API

Google Maps API

I was trying to do a small test and start using the Google Maps Api to display static maps in my sites. I started by copying the example in Google maps. After registering for my unique key and pasting the key my code it was not displaying anything on the page, no errors and for sure no map either.

This is the piece of code (I know the line with the key will be all over the place… sorry about that)

1
2
3
4
5
6
7
8
9
10
11
12
13
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>gMap</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img alt="map"
src="http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap\&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318&markers=color:red|label:C|40.718217,-73.998284&sensor=false&key=AXXXXXXAWwLmiMVvqZxVvIMrCo_FuBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNFe_EpeB0hPBBdr1eFM$6uXETDWA" />
</div>
</form>
</body>
</html>

Solution:

The problem was that I entered the incorrect domain for testing when registering for my key. Instead of using the domain name of my site I should have entered: “http://localhost” as my development environment hosting name. Once I redo the registration with the correct name I was given a new key which work flawlessly.

Google Map Api Key registration screen. Choosing the right domain for development.

Google Map Api Key registration screen. Choosing the right domain for development.

Share
Tweet
Google+
Linkedin
Stumble
Email

About The Author

Codex Discipulus

Hello, my name is David and I am a disciple of coding, always learning and always ready to help. Welcome to my blog, I hope you find it useful, please send your comments and share an article with your friends.

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Hosting ASP.Net Core 3.x Worker Service as …
    Using the Worker template now is possible to host an …
  • Calling an HTTPS WCF Service from Net …
    We all know how to call a WCF service from …
  • How to Add a VS Code Project …
    Let’s try to add a Visual Studio Code project to …
  • Step by Step Token based Authentication in …
    Token Authentication is a very popular method to secure a …
  • How to Ignore NuGet Packages in TFS …
    This should be a short post. It is really just …

Categories

  • CakePHP
  • Coding
  • Database
  • Entity Framework
  • Error Messages
  • General
  • Google Maps
  • Hosting
  • JavaScript
  • MVC
  • MySql
  • Net Core
  • NHibernate
  • SEO
  • SSIS
  • TypeScript
  • Wordpress

Tags

ActiveDirectory analytics apps aspnet CakePHP coding database projects design patterns entity framework error messages fatcow first steps ftp github gitlab godaddy google maps api hangfire Hosting iis7 java javascript membership MVC MySql NHibernate nuget nuget packages oracle owin repository SEO sharp ssis t4 tfs thesis token authentication typescript vs2010 vs2015 vs2017 web api Wordpress wp-pagenavi

Das Blog

Debugging one line at a time
Copyright © 2020 Das Blog
ScottsdaleWebStudio.com © All Rights Reserved 2017