Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "lazymaps", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Lazy loading, easy to use wrapper around the Google Maps API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/lazymaps.js", |
@@ -22,15 +22,38 @@ [![Build Status](https://travis-ci.org/maykinmedia/lazymaps.svg?branch=master)](https://travis-ci.org/maykinmedia/lazymaps) | ||
## Usage | ||
## Usage | ||
*Code examples in es6, library is es5 compatible.* | ||
*See [doc](doc/) for full API documentation.* | ||
*See [doc](https://github.com/maykinmedia/lazymaps/blob/master/doc/lazymaps.md) for full API documentation.* | ||
**HTML** | ||
**HTML: Basic map** | ||
```html | ||
<!-- data-coordinates and data-zoom are required. --> | ||
<div class="map" data-coordinates="52.3766882,4.8855208,17" data-zoom="15"></div> | ||
<div class="map" data-coordinates="52.3766849,4.8855208" data-zoom="17"></div> | ||
``` | ||
**HTML: Adding markers** | ||
```html | ||
<div class="map" | ||
data-coordinates="52.3766849,4.8855208" | ||
data-zoom="17" | ||
data-markers='[{ | ||
"latitude": 52.3766849, | ||
"longitude": 4.8855208, | ||
"title": "Maykin Media", | ||
"description": "Awesome webdevelopment", | ||
}]' | ||
></div> | ||
``` | ||
**HTML: Additional parameters** | ||
`data-disable-default-ui="true"`: Disables the default UI controls. | ||
`data-disable-info-windows="true`: Disables info windows (see result of new GMap(node, apiKey) to access internal objects like map and markers. | ||
**JS: Creating a single map** | ||
@@ -51,3 +74,3 @@ | ||
```js | ||
import GMap from 'lazymaps'; | ||
import { lazymaps } from 'lazymaps'; | ||
@@ -60,2 +83,7 @@ | ||
**JS: Customizing the map.** | ||
`new GMap(node, apikey)` returns a `Promise` object, lazymaps(selector, apiKey) returns an array of these promises. The resulting promises are resolved with the GMap instance. This can be used for further map customisation, please refer the API documentation [doc](https://github.com/maykinmedia/lazymaps/blob/master/doc/lazymaps.md) for available properties. | ||
## Running tests | ||
@@ -62,0 +90,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32639
109