Testing the Google Maps API on the local computer

I am trying to check Google Maps on development sites in IIS. My local testing url is: http: // sitename /. Since the name does not have “.com”, I cannot get the API key. I can get the key for http: // localhost /, but I wonder if there is a way to use the testing URL http: // sitename /.

+6
testing google-maps local
source share
2 answers

It was an accident. For some reason, the page with key registers will not allow me to register a domain. After posting this question, I tried again and he gave me the key.

To use Google maps on a test server, simply register for the key with the test name http: // sitename / . This will also work for / localhost /.

+4
source share

Until I know the details of the Google Maps API, you can locally add the * .com domain to your own local server. Add an entry to / etc / hosts (the equivalent on Windows is c: / windows / system32 / etc / hosts, IIRC).

For example, you can add:

  127.0.0.1 localhost.yourotherdomain.com
 # or
 127.0.0.1 localtest.yourotherdomain.com
+4
source share

All Articles