I wanted to try out a sample demo of implementing Gmaps v3 and tried out this example from Google\'s documentation, but there is no output , the page just loads for a few se
First of all: Google Maps 3 does not need an api key anymore, so you are fine with
https://maps.googleapis.com/maps/api/js?sensor=false
as an URL.
(As Jeff Hoye pointed out, as of June 22, 2016, an API Key is required again.)
And then you forgot the "new" in this line:
var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
With those changes your map will be displayed.
it's very easy! in the new API code, you should enter your referrers. So for your localhost test:
LEAVE IT EMPTY
here is also the google api explanation:
Accept requests from these HTTP referrers (web sites) (Optional)
Use asterisks for wildcards.
If you leave this blank, requests will be accepted from any referrer.
Be sure to add referrers before using this key in production.
Without an API Key now Google Maps does not work... reference: https://console.cloud.google.com/apis