Google Maps API without key?

How do you utilize Google Maps v3 API without the key? I've seen it in this example but cannot figure out what specifically is causing it not to error out.

Edit: In case someone suggests it, the other answers on this topic on StackOverflow are outdated and no longer applicable.

Answers:

Answer

Indeed the link you posted http://www.birdtheme.org/useful/v3largemap.html works without key (there is just a warning in the console). It looks like Google is whitelisting some domain names to allow the use of API without key.

I tried to use the Google Maps API v3 to display OpenStreetMap tiles but it produces a "Google Maps API error: MissingKeyMapError" on my localhost while it is working on this site without API key: http://harrywood.co.uk/maps/examples/google-maps/apiv3.html

On most websites that don't use an API key, there is an error that prevent the use of Google Maps but you can bypass this censorship.

Solution if you don't own the server using Google Maps API without key:

Block the HTTP request sending the error with an addon like AdBlockPlus and the rule http://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?*

This will give you access to Google Maps API tiles, markers, infoWindow popup... But if you want to use the Geocoding API, you also have to remove your HTTP referer header with a browser addon like "Modify Headers".

Solution to add in your web page so every visitors can access Google Maps API without key:

Below is a JavaScript hack I created to use Google Maps API V3 without key and bypass the error message.

// hack Google Maps to bypass API v3 key (needed since 22 June 2016 http://googlegeodevelopers.blogspot.com.es/2016/06/building-for-scale-updates-to-google.html)
var target = document.head;
var observer = new MutationObserver(function(mutations) {
    for (var i = 0; mutations[i]; ++i) { // notify when script to hack is added in HTML head
        if (mutations[i].addedNodes[0].nodeName == "SCRIPT" && mutations[i].addedNodes[0].src.match(/\/AuthenticationService.Authenticate?/g)) {
            var str = mutations[i].addedNodes[0].src.match(/[?&]callback=.*[&$]/g);
            if (str) {
                if (str[0][str[0].length - 1] == '&') {
                    str = str[0].substring(10, str[0].length - 1);
                } else {
                    str = str[0].substring(10);
                }
                var split = str.split(".");
                var object = split[0];
                var method = split[1];
                window[object][method] = null; // remove censorship message function _xdc_._jmzdv6 (AJAX callback name "_jmzdv6" differs depending on URL)
                //window[object] = {}; // when we removed the complete object _xdc_, Google Maps tiles did not load when we moved the map with the mouse (no problem with OpenStreetMap)
            }
            observer.disconnect();
        }
    }
});
var config = { attributes: true, childList: true, characterData: true }
observer.observe(target, config);

This will give you access to Google Maps API tiles, markers, infoWindow popup... For the Geocoding API, you also have to remove your HTTP referer with the HTML meta tag below.

<meta name="referrer" content="no-referrer"> <!-- don't send HTTP referer for privacy purpose and to use Google Maps Geocoding API without key -->
Answer

A key is now required. Previously it wasn't required and sites that used the API without a key prior to June 22, 2016 have been grandfathered to allow them to continue to work.

See this blog post for additional information (relevant text below):

As of June 22, 2016 we are making the following changes to the Google Maps APIs Standard Plan:

  1. We no longer support keyless access (any request that doesn't include an API key). Future product updates are only available for requests made with an API key. API keys allow us to contact developers when required and help us identify misbehaving implementations.
  2. We have implemented a simple 25,000 map loads per day free limit to new Google Maps JavaScript API, Static Maps API, and Street View Image API implementations. The confusing 90-consecutive-day grace period for these APIs is being retired on October 12, 2016. With this change, developers can predictably plan for growth while media sites and US nonprofits can request more quota at no charge via our dedicated support programs.
  3. We have reduced the daily map load maximum limit you can purchase for Google Maps JavaScript API, Static Maps API, and Street View Image API from 1,000,000 to 100,000 requests per API.* We believe higher-volume developers are best served with a Premium Plan license, which includes technical support and a Service Level Agreement, and with this change we've also created consistency between Standard Plan quotas across our maps and web service APIs.
  4. We now count Google Maps JavaScript API client-side requests towards the daily limit of the associated web service API.*

The new policies will apply immediately to all Maps API implementations created on or after June 22nd, 2016.

Existing applications have been grandfathered based on their current usage to ensure that they continue to function both now and in the future. We will also be proactively contacting all existing API key users who, based on usage growth patterns, may be impacted in the future. If you’re an existing user, please take the time to read our Policy Update for Standard Plan summary for details on how each of these changes might affect your implementation.

Answer

Starting June 11, 2018, you can no longer use GoogleMaps API without key.

source

Answer

I am able to put location indicator in websites without any api key or javascript code

I use Fancybox to show a google maps modal box very easily.

<head>
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/[email protected]/dist/jquery.fancybox.min.css" />
<script src="https://cdn.jsdelivr.net/gh/fancyapps/[email protected]/dist/jquery.fancybox.min.js"></script>
</head>


<body>
<a data-fancybox="" data-options="{&quot;iframe&quot; : {&quot;css&quot; : {&quot;width&quot; : &quot;80%&quot;, &quot;height&quot; : &quot;80%&quot;}}}" href="https://www.google.com/maps/search/?api=1&amp;query=centurylink+field" class="btn btn-primary">Open Modal Map</a>
</body>

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.