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 🙏

© 2024 – Pkg Stats / Ryan Hefner

slpy

v1.1.1

Published

Slpy Maps and Search API

Downloads

97

Readme

Slpy JS

Slpy JS enables easy integration and setup of interactive slippy maps, geocoding search, autocomplete and autofill, satellite to street level imagery, and other complex location features. Powered by the Slpy API, and designed for your JavaScript compatible applications and websites.

Visit the Slpy Documentation site for more information on usage and features.

Version PRs

Features

  • 🗺️ Quick start for MapLibre and OpenLayers
  • 🎨 Customizable map design
  • 🖱️ Autofill addresss fields
  • 📍 Autocomplete dropdown and search box
  • 💻 Polyfill support for IE9+

Getting Started

Create an Account

  1. Create an account on the Slpy Sign Up page and generate an API Key on your account page.

Install Dependencies

  1. If you are using Slpy JS for displaying an interactive map, install either Maplibre GL JS - OR - OpenLayers with OL-Mapbox-Style.
npm install --save-dev maplibre-gl ol ol-mapbox-style

Or Slpy hosted scripts are available at

<!-- Maplibre GL JS -->
<script src="https://api.slpy.com/lib/mlgl/latest/maplibre-gl.js"></script>
<!-- OpenLayers and OL Mapbox Style -->
<script src="https://api.slpy.com/lib/ol/latest/ol.js"></script>
<script src="https://api.slpy.com/lib/olms/latest/olms.js"></script>

Installation

  1. You can include Slpy JS in your project through npm:
npm install slpy

Or using yarn:

yarn add slpy

Or a Slpy hosted script is available

<script src="https://api.slpy.com/lib/slpy/latest/slpy.js"></script>
  1. Include or import the Slpy CSS file
import 'slpy/dist/css/slpy-style.css'

For Maplibre GL JS

import 'maplibre-gl/dist/maplibre-gl.css'

For OpenLayers

import 'ol/ol.css'

Basic MapLibre Map (Module)

Once MapLibre is installed as a dependency or included as a script, use maplibreMap to load. Maplibre will be imported automatically.

import { slpy } from 'slpy';

const map = new slpy.maplibreMap({
  apiKey: 'your_api_key',  // your API Key from www.slpy.com
  target: 'map', // id of the HTML element to render the map
  center: [0, 0], // longitude and latitude of the center
  zoom: 3 // initial zoom level
});

Basic OpenLayers Map (Module)

Once OpenLayers and OL-Mapbox-Style are installed or included as a script, use openlayersMap to load. Dependencies will be imported automatically.

import { slpy } from 'slpy/dist/index.openlayers.js';

const map = new slpy.openlayersMap({
  apiKey: 'your_api_key',  // your API Key from www.slpy.com
  target: 'map', // id of the HTML element to render the map
  center: [0, 0], // longitude and latitude of the center
  zoom: 3 // initial zoom level
});

Basic Map JS (HTML)

<script src="https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css" rel="stylesheet" />

<script src="https://api.slpy.com/lib/slpy/latest/slpy.js"></script>
<link href="https://api.slpy.com/lib/slpy/latest/slpy-style.css" rel="stylesheet">

<div id="map" style="width:100%; height:400px;"></div>
<script>
const map = new slpy.maplibreMap({
  apiKey: 'your_api_key',  // your API Key from www.slpy.com
  target: 'map', // id of the HTML element to render the map
  center: [0, 0], // longitude and latitude of the center
  zoom: 3 // initial zoom level
});
</script>

Basic Address Autocomplete

<form id="form-element-id">
	<input name="ra" autocomplete="section-residential shipping address-line1">
</form>

<script>
slpy.addressAutocomplete( 'form-element-id', {
  apiKey: 'your-api-key',
  country: 'US',
} );
</script>

Documentation

For detailed usage and API documentation, please visit the Slpy Documentation.

Examples

Browser Support

Slpy JS is compatible with all modern web browsers. For Internet Explorer, partial support is available through a polyfilled version at "/dist/slpy.polyfilled.js" in combination with OpenLayers for raster maps. More information is a available on the Slpy Browser Compatibility page.

Contributing

We welcome contributions from the community. If you're interested in contributing, please see our contributing guidelines.