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