An open API service indexing awesome lists of open source software.

https://github.com/alchaplinsky/maps.js

Easy and declarative way to use Google Maps API
https://github.com/alchaplinsky/maps.js

Last synced: 20 days ago
JSON representation

Easy and declarative way to use Google Maps API

Awesome Lists containing this project

README

          

# Maps.js - Google Maps JavaScript API V3
Maps.js A Javascript library for working with Google Maps JavaScript API V3.
Gives you declarative way of creating maps and simplifies manipulating with maps after they're created.

## Build
To build maps.js from the source, you'll need node.js and npm.

git clone https://github.com/alchapone/maps.js.git
cd maps.js
npm install
grunt

## Usage
To Build Google Map wit Maps.js you need to follow 3 simple steps:

1. Add Google Maps API script to your HTML:

``

2. Create a container for map with fixed height in your HTML:

`

`

3. Create a new instance of `Map` function with parameters:

- To create a world map - minimum parameters required:

map1 = new Map({
div: '#worldmap'
});

- You can set center and zoom level for map

map2 = new Map({
div: '#sidneymap',
lat: -33.867365,
lng: 151.203957,
zoom: 8
});

- Easily add markers with info windows during map creation

map3 = new Map({
div: '#sidneymap',
lat: -33.867365,
lng: 151.203957,
zoom: 8,
markers: [{
lat: -33.867365,
lng: 151.2039,
title: 'Sidney',
animation: 'drop',
info:
content: 'Welcome to Sidney!'
}]
});

- Use goecode features without specifying lattitude and longitude

map4 = new Map({
div: '#map2',
geo: 'Munich'
});