Embed an interactive Google Map with custom markers and click events on a web page in under 15 lines of JavaScript.
Draw a driving route between two addresses using a single method call instead of navigating the full Directions API.
Cluster hundreds of map markers together when zoomed out so the map stays readable with large datasets.
Requires a valid Google Maps API key to load the underlying map tiles.
gmaps.js is a JavaScript library that makes it simpler to embed and use Google Maps on a website. The official Google Maps JavaScript API requires reading through extensive documentation and writing a fair amount of code to do basic things. gmaps.js wraps that API so common tasks take far less code. To get started, you add a reference to the Google Maps API script tag in your HTML page, then add the gmaps.js file, and then write a few lines of JavaScript to create a map pointing at a specific latitude and longitude. The quick-start example in the README shows a working map in roughly ten lines of HTML. There is no backend server or database involved: this is purely a front-end library for web pages. The library supports a range of map features. You can add and remove markers (the pins on a map), draw lines and polygons on the map surface, show routes and directions between locations, cluster many markers together when zoomed out, display Street View panoramas, add custom map layers, handle click and other interaction events, and generate static map images. Most of these correspond to features that the underlying Google Maps API already has, but gmaps.js provides shorter and more straightforward method calls to reach them. The project has gone through many releases, each adding features or fixing bugs. Version 0.4 reorganized the code into modules. The changelog in the README tracks changes going back to early versions, including fixes for Internet Explorer compatibility, support for marker clustering, and the addition of AMD and CommonJS module formats so the library can be loaded by bundlers like RequireJS. At the time of writing, the maintainer noted they were migrating the project to NPM and invited developer feedback in a GitHub issue. The library is suited for web developers who want to add interactive maps to a project without spending a lot of time reading the full Google Maps documentation.
← hpneo on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.