Giter VIP home page Giter VIP logo

keyless-google-maps-api's Introduction

Usage

<script src="https://cdn.jsdelivr.net/gh/somanchiu/[email protected]/mapsJavaScriptAPI.js"></script>

Example

Demo page: https://somanchiu.github.io/Keyless-Google-Maps-API/demo

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644},
          zoom: 8
        });
      }
    </script>
    <script src="https://cdn.jsdelivr.net/gh/somanchiu/[email protected]/mapsJavaScriptAPI.js"
    async defer></script>
  </body>
</html>

Supporting this project

"Buy Me A Coffee"

keyless-google-maps-api's People

Contributors

somanchiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

keyless-google-maps-api's Issues

running multiple instances doesn't work

I've a web app with multiple tabs,
the first tab shows the map correctly,
the 2nd tab display this error message in console:
This IP, site or mobile application is not authorized to use this API key.

and shows this map:
image

The same app used to work with previous version.

Your demo is working, but not my code that used to work

Hello,
I've a code that used to work correctly with the last version of the project.
But some times ago, map stopped loading and I've the floowing console errors:
image
image
image

I wonder if the error is related to the google maps Fr being loaded!

Key issue

Can we use this without any key many no times

Replace to cors.sh proxy cors

I have tried using cors.sh, but the URL form is slightly different from whateverorigin:
'https://proxy.cors.sh/https://example.com'

Based on documentation, I added header "x-cors-api-key":
xhttp.setRequestHeader("x-cors-api-key", "live_xxxxx");

And remove encodeURIComponent from xhttp.open:
xhttp.open("GET", CROSproxyURL + url, true);

And it's not necessary to JSON parse for callback:
callback(this.response);

common.js and map.js can be loaded and attached to head section, but there error in console:
Uncaught SyntaxError: Unexpected token 'true' (in common.js)
and
Uncaught SyntaxError: Unexpected token 'return' (in map.js)

Screen Shot 2024-01-06 at 02 04 58

Please help to solve this issue and please tell me how I can donate for you to buy some coffee. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.