whq-google-map - Online Hosted Library

Get snippets for hosted files, download or install the whq-google-map NPM package inclusive dependencies. At this website you will find all NPM packages. These NPM packages can be added to an online managed NPM project. Out of this project it is possible, to create a single compressed CSS or JavaScript file to avoid too much HTTP request on your website.

Please rate this library. Is it a good library? Are there some bugs?

All versions of whq-google-map with all dependencies

Version


More infos about whq-google-map

WHQ Google Map

Wrapper for embedding a Google Map more easily.

Installation

npm install whq-google-map

Usage

import GoogleMap from 'whq-google-map'

// new GoogleMap(options)

const mapCanvas = document.querySelector('.map-canvas')
const contactMapStyles = [...]

const myMap = new GoogleMap({
    apiKey: [YOUR API KEY],
    coords: { lat: 100, lng: -100 },
    element: mapCanvas,
    markerIcon: 'img/map-marker.png',
    zoom: 16,
    styles: contactMapStyles
})

myMap.init()

Options

Option Type Description
apiKey String Your Google Maps API key.
coords String Object with lat and long properties.
element Node The map canvas element.
markerIcon String Optional.
Path to a custom marker icon. PNGs work the best cross-browser.
zoom Integer Optional.
Custom zoom level.
Default: 4
styles Array Optional.
Array of custom styles.

The package whq-google-map contains the following files

Loading the files please wait ....