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 🙏

© 2025 – Pkg Stats / Ryan Hefner

storelocator

v1.0.510

Published

serves a google maps store locator

Readme

Project status

npm npm downloads

build build push package

check types lint test

code coverage

deploy documentation website documentation website

Use case

A webcomponent to serve a store locator via google maps.

Installation

Classical dom injection

You can simply download the compiled version as zip file here and inject it after needed dependencies:

<!--Inject downloaded file:
<script src="index.js"></script>
-->
<!--Or integrate via cdn:-->
<script
    src="https://torben.website/storelocator/data/distributionBundle/index.js"
></script>

The compiled bundle supports AMD, commonjs, commonjs2 and variable injection into given context (UMD) as export format: You can use a module bundler if you want.

Package managed and module bundled

If you are using npm as package manager you can simply add this tool to your package.json as dependency:

...
"dependencies": {
    ...
    "storelocator": "latest",
    ...
},
...

After updating your packages you can simply depend on this script and let a module bundler do the hard stuff or access it via an exported variable name in given context.

...
import storeLocatorAPI from 'storelocator'

// Default tag name is "store-locator".
storelocatorAPI.register(/*'my-store-locator-tag-name'*/)
...

Then inject component in html:

<store-locator></store-locator>

Examples

Adding some style to our store locator examples

store-locator {
    font-family: Roboto, Arial, sans-serif;

    display: block;

    width: 100%;
    height: 400px;

    margin: 0px;
    padding: 0px
}

.web-component-template {
    display: none;
}

store-locator > div {
    height: 100%;
}

.store-locator__input {
    margin-top: 9px;
    margin-left: 9px;

    width: 230px;
}

store-locator .gm-style-iw > div {
    width: 225px;
    height: 60px;
    padding: 5px;
}

Simple example

Download, register component and use new component.

<script
    src="https://torben.website/storelocator/data/distributionBundle/index.js"
></script>

<script>
    console.info('Register "store-locator" tag name.')

    storelocator.index.api.register()
</script>

<store-locator
    configuration="{
        applicationInterface: {
            // NOTE: You should use your own google maps application interface
            // key.
            key: 'AIzaSyBAoKgqF4XaDblkRP4-94BITpUKzB767LQ'
        }
    }"
>
    <input>
</store-locator>

Advanced example with all available (default) options

<store-locator
    configuration="{
        applicationInterface: {
            // NOTE: You should use your own google maps application interface
            // key.
            key: 'AIzaSyBAoKgqF4XaDblkRP4-94BITpUKzB767LQ'
        },
        ipToLocationApplicationInterface: {
            bounds: {
                northEast: {latitude: 55.12, longitude: 14.89},
                southWest: {latitude: 47.32, longitude: 5.50}
            },
            key: '11a62990a1424e894da6eec464a747e6'
        },

        defaultMarkerIconFileName:
            'https://via.placeholder.com/50/0099ff/ffffff.png',
        // Automatically generated stores with option: {stores: bounds}
        stores: [
            {
                address:
                    'Elgendorfer Str. 57, 56410 Montabaur, Deutschland',
                eMailAddress: '[email protected]',
                id: 1,
                latitude: 50.4356,
                longitude: 7.81226,
                name: '1 & 1 Telecom GmbH',
                phoneNumber: '+49 721 9600'
            },
            {
                address:
                    'Freiheitsstr.1a, 53842 Troisdorf, Deutschland',
                eMailAddress: '[email protected]',
                id: 2,
                latitude: 50.82791,
                longitude: 7.1219600000000005,
                name: '1A-Bike&Parts GmbH',
                phoneNumber: '02241 / 91 18 09 3',
                websiteURL: 'http://www.1a-bike.bike'
            },
            {
                address:
                    'Niederrheinische Str. 27, 34626 Neukirchen, Deutschland',
                eMailAddress: '[email protected]',
                id: 3,
                latitude: 50.871640000000006,
                longitude: 9.337940000000001,
                name: '1a Fahrradservice',
                phoneNumber: '+49 (6694) 7878',
                websiteURL: 'http://www.1a-fahrradservice-diegelmann.de'
            },
            {
                address:
                    'Dener Strasse 73, 48653 Coesfeld, Deutschland',
                eMailAddress: '[email protected]',
                id: 4,
                latitude: 51.93271000000001,
                longitude: 9.337940000000001,
                name: '2-Rad-Baumeister',
                phoneNumber: '+49 (2541) 2509',
                websiteURL: 'www.2rad-baumeister.de'
            },
            {
                address:
                    'Friedrichstr. 100, 47475 Kamp - Lintfort, Deutschland',
                eMailAddress: '[email protected]',
                id: 5,
                latitude: 51.508750000000006,
                longitude: 6.553020000000001,
                name: '2 - Rad Behringer',
                phoneNumber: '02842 / 42 471',
                websiteURL: 'www.zweirad-behringer.de'
            },
            {
                address:
                    'Werster Str. 86, 32549 Bad Oeynhausen, Deutschland',
                eMailAddress: '[email protected]',
                id: 6,
                latitude: 52.215630000000004,
                longitude: 8.785,
                name:
                    '2Rad Berger Fahrradhandel & Tankstelle Marcus Berger',
                phoneNumber: '+49 (5731) 28930',
                websiteURL: 'www.2radberger.de'
            },
            {
                address: 'Rauchstr. 16, 34454 Bad Arolsen, Deutschland',
                eMailAddress: '[email protected]',
                id: 7,
                latitude: 51.38242,
                longitude: 9.01524,
                name: '2Rad Br\u00fcne',
                phoneNumber: '05691 / 2220',
                websiteURL: 'http://2rad-bruene.de'
            },
            {
                address: 'Schneiderstr.40, 46244 Bottrop, Deutschland',
                id: 8,
                latitude: 51.57477,
                longitude: 6.90406,
                name: '2 - Rad B\u00fcning',
                phoneNumber: '02045 / 57 38',
                websiteURL: 'http://www.2-rad-buening.de'
            },
            {
                address: 'Butenwall 63, 46325 Borken, Deutschland',
                eMailAddress: '[email protected]',
                id: 9,
                latitude: 51.846050000000005,
                longitude: 6.8543,
                name: '2Rad Busch',
                phoneNumber: '+49 (2861) 2692',
                websiteURL: 'www.2rad-busch.de '
            },
            {
                address:
                    'Herzebrockerstrasse 12, 33378 Rheda-Wiedenbrück, Deutschland',
                eMailAddress: '[email protected]',
                id: 10,
                latitude: 51.85799,
                longitude: 8.28283,
                name: '2-rad Butschko',
                phoneNumber: '05242 / 4 31 61',
                websiteURL: 'http://www.zweirad-butschko.de'
            }
        ],

        limit: {
            northEast: {latitude: 55.12, longitude: 14.89},
            southWest: {latitude: 47.32, longitude: 5.50}
        },
        map: {minZoom: 5, zoom: 9},

        search: {}
    }"
>
    <input
        bind-property-title="configuration.name"
        class="store-locator__input"
        placeholder="Please provide some search words"
        slot="input"
    />

    <a
        class="store-locator__link"
        href="https://www.google.com"
        slot="link"
    >Legal notes example</a>
</store-locator>