项目作者: somanchiu

项目描述 :
Use the Google Maps JavaScript API without API KEY in any domain
高级语言: JavaScript
项目地址: git://github.com/somanchiu/Keyless-Google-Maps-API.git
创建时间: 2018-08-20T12:21:29Z
项目社区:https://github.com/somanchiu/Keyless-Google-Maps-API

开源协议:

下载


Usage

  1. <script src="https://cdn.jsdelivr.net/gh/somanchiu/Keyless-Google-Maps-API@v6.8/mapsJavaScriptAPI.js"></script>

Example

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

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Simple Map</title>
  5. <meta name="viewport" content="initial-scale=1.0">
  6. <meta charset="utf-8">
  7. <style>
  8. /* Always set the map height explicitly to define the size of the div
  9. * element that contains the map. */
  10. #map {
  11. height: 100%;
  12. }
  13. /* Optional: Makes the sample page fill the window. */
  14. html, body {
  15. height: 100%;
  16. margin: 0;
  17. padding: 0;
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <div id="map"></div>
  23. <script>
  24. var map;
  25. function initMap() {
  26. map = new google.maps.Map(document.getElementById('map'), {
  27. center: {lat: -34.397, lng: 150.644},
  28. zoom: 8
  29. });
  30. }
  31. </script>
  32. <script src="https://cdn.jsdelivr.net/gh/somanchiu/Keyless-Google-Maps-API@v6.8/mapsJavaScriptAPI.js"
  33. async defer></script>
  34. </body>
  35. </html>

Supporting this project

"Buy Me A Coffee"