hpneo / gmaps

the easiest way to use Google Maps
https://hpneo.dev/gmaps/
7.04k stars 1.29k forks source link

Important

If you're developer, I'm moving gmaps.js to NPM, you can give your opinion and check the migration progress in Issue #404


gmaps.js - A Javascript library that simplifies your life

gmaps.js allows you to use the potential of Google Maps in a simple way. No more extensive documentation or large amount of code.

Visit the examples in hpneo.github.com/gmaps Go to the API Documentation hpneo.github.io/gmaps/documentation.html

Quick Start

  1. Add a reference to Google Maps API
  2. Add gmaps.js in your HTML
  3. Enjoy!
<!DOCTYPE html>
<html>
<head>
  <title></title>
  <script src="http://maps.google.com/maps/api/js"></script>
  <script src="https://github.com/hpneo/gmaps/raw/master/gmaps.js"></script>
  <style type="text/css">
    #map {
      width: 400px;
      height: 400px;
    }
  </style>
</head>
<body>
  <div id="map"></div>
  <script>
    var map = new GMaps({
      el: '#map',
      lat: -12.043333,
      lng: -77.028333
    });
  </script>
</body>
</html>

Use with AMD

With require.js, you need to load Google Maps JavaScript API first. For example, assuming you have a googlemapsapi.js file:

define(['async!http://maps.google.com/maps/api/js?v=3&sensor=false'], function() {});

Next you have to define the dependency for gmaps.js:

require.config({
  paths: {
    "googlemapsapi": "googlemapsapi",
  },
  shim: {
    gmaps: {
      deps: ["googlemapsapi"],
      exports: "GMaps"
    }
  }
});

Also, you can use the googlemaps-amd plugin.

Build

If you would like to build gmaps from source run the following at the terminal:

git clone https://github.com/HPNeo/gmaps.git
cd gmaps
npm install
grunt

Changelog

0.4.25

0.4.24

0.4.23

0.4.22

0.4.21

0.4.20

0.4.19

0.4.18

0.4.17

0.4.16

0.4.15

0.4.14

0.4.13

0.4.12

0.4.11

0.4.10

0.4.9

0.4.8

0.4.7

0.4.6

0.4.5

0.4.4

0.4.3

0.4.2

0.4.1

0.4.0

0.3.5

0.3.4

0.3.3

0.3.2

0.3.1

0.3

0.2.31

0.2.30

0.2.29

0.2.28

0.2.27

0.2.26

0.2.25

0.2.24

0.2.23

0.2.22

0.2.21

0.2.20

0.2.19

0.2.18

0.2.17

0.2.16

0.2.15

0.2.14

0.2.13

0.2.12

0.2.11

0.2.10

0.2.9

0.2.8

0.2.7

0.2.6

0.2.5

0.2.4.1

0.2.4

0.2.3

0.2.2

0.2.1

0.2

0.1.12.5

0.1.12.4

0.1.12.3

0.1.12.2

0.1.12.1

0.1.12

0.1.11

0.1.10

0.1.9

0.1.8.10

0.1.8.9

0.1.8.8

0.1.8.7

0.1.8.6

0.1.8.5

0.1.8.4

0.1.8.3

0.1.8.2

0.1.8.1

0.1.8

0.1.7.1

0.1.7

0.1.6

0.1.5

0.1.4

0.1.3

0.1.2

0.1.1

0.1 - Initial release

License

MIT License. Copyright 2014 Gustavo Leon. http://github.com/hpneo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.