Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gmaps-lib

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmaps-lib

Library for gmaps

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

gmaps-lib v0.0.4

Library for gmaps

Install via npm:

npm i gmaps-lib --save

js

import gmaps from 'gmaps-lib';

Usage

//config
const config = {
    key:'AIzaSyAd1xMYT1bt99qtFWQEzXiRBvORDWHgPtk',
    //libs:['geometry','places'],

    icons:{
        main: {
            url: '/path/to/image',
        },
        main_active: {
            url: '/path/to/image',
        }
    },
    infoBubble:{
        shadowStyle: 0,//0-2
        padding: 0,
        backgroundColor: '#fff',
        borderRadius: 0,
        arrowSize: 10,
        borderWidth: 0,
        //borderColor: '#2c2c2c',
        disableAutoPan: true,
        hideCloseButton: true,
        arrowPosition: 50,//position in %
        backgroundClassName: 'b-map-info-window__shadow',
        arrowStyle: 0,//0-4
        maxWidth:300,
        minWidth:300
    }
}
//init
gmaps.apiLoader(config.key,config.libs)
    .then(resp=>{
        const map = new gmaps.Map(node,{
            center:{
                lat:40.714,
                lng:-74.005
            },
            zoom: 8
        },config.infoBubble);

        map.markerAdd([
            {lat:41.714,lng:-73.005},
            {lat:40.714,lng:-72.005},
            {lat:40.714,lng:-74.005}
        ],{
            icon:config.icons.main
        });

        map.vpOnMarkers();

        map.onChangeActiveMarker = (newIdx,oldIdx)=>{
            const marker = map.markerList[newIdx];
            map.ibOpenOne(marker,'className');
        };
    });

FAQs

Package last updated on 06 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc