npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gmaps-marker

v1.0.8

Published

Create simple Google Maps with a clickable marker.

Readme

Google Maps Marker

A light and simple library to display Google Maps with a custom marker. This marker is clickable and display the text you want in an Info window.

Getting started

$ npm install --save gmaps-marker
const gmapMarker = require('gmaps-marker')
gmapMarker.init(domElement, params)

Don't forget to add this google script tag with your own API key before all your scripts

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=XXX"></script>

Parameters via javascript or data

You can pass parameters via javascript or via html data attributes. It can be helpfull.

Settings

| Parameter | type | default | description | data | | --- | --- | --- | --- | --- | | center : lat | int | 0 | Latitude of the marker | data-lat | | center : lng | int | 0 | Longitude of the marker | data-lng | | style | json | '' | Style of your Google Map, you can get it on websites like this | No data | | zoom | int | 10 | Zoom level | data-zoom | | icon | string | '' | URL of your custom marker | data-icon | | info : content | string | '' | Content of the info window | No data : Write content in the dom element | | info : opened | boolean | false | Info window opened by default or not | data-opened |

Example with jascript method

HTML :

The content of your dom element will be included in the marker info window.

<div id="gmap"><h2>Info window content</h2><span>You can put what you want here !</span></div>

JAVASCRIPT :

Here, we define the marker position with center. The style of the map is some JSON that you can get on websites like this. The info object define that the info window will be opened on init.

gmapMarker.init('#gmap', {
    center: {
        lat: 45, 
        lng: 2.5
    },
    style: [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}],
    zoom: 8,
    info: {
        opened: true
    }
});