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

@bar_jaw_test/test

v1.0.3

Published

OlzaLogistic JS widget to provide map with PP pins.

Downloads

3

Readme

Olza Logistic Logo

pp-api-widget

Olza Logistic's Pickup Point selection widget.


Usage

Widget layout

By default, Olza Widget injects its layout into your HTML page. If for any reason you'd like to keep its main container into specified place in your layout hierarchy, insert empty div named olza-widget:


<div id="olza-widget"></div>

Calling Pickup Point selector

Olza.Widget.pick(config);

where config is a dictionary of parameters overriding widget defaults, for example:

function pick() {
    const options = {
        url: '<URL>',
        accessToken: '<ACCESS-TOKEN>',
        country: 'cz',
        onSelect: function (item) {
            console.log(`Picked PP: ${JSON.stringify(item)}`);
        },
        speditions: ['zas', 'zas-econt-pp'],
    };
    Olza.Widget.pick(options);
}

Available options are:

| Parameter | Description | Default | Notes | |--------------------|---------------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------| | url | OlzaLogistic's API base URL | null | | | accessToken | OlzaLogistic's API access token. | null | | | country | Target country to use library for. | cz | | | language | Requested UI language | null | Will use browser defined language if not explicitly specified. | | latitude | Latitude of the initial map location | | | | longitude | Longitude of the initial map location | | | | zoom | Initial Leaflet map zoom level. | 12 | | | showOnMapZoomLevel | Zoom level used while "Show on map" button is clicked in PP details pane | 17 | | | speditions | List of requested speditions that are going to be used (passed all the filtering etc.). | [] | If empty list is provided, all available speditions will be used. | | onSelect | Called to pass user selected Pickup Point (as JSON object). | null | | | useBrowserLocation | If true, widget will try to use browser's geolocation to determine initial map location. | true | |

Notes

  • speditions is a list of spedition codes requested to be used. Final list may differ as not all
    requested speditions might be available at the time.

Dev notes

How to start development

  • Install devDependencies yarn install --production=false
  • Turn on files watching yarn watch
  • Make changes in files in src directory
  • Build new version yarn build

If you don't want to install node and yarn on your machine you can use docker-compose.yml from repository:

  • docker-compose up -d
  • docker-compose exec node yarn watch
  • docker-compose exec node yarn build

Flags

Country flags sourced from Flagpedia (docs).

Spedition imagery

Widget expects both map pin and spedition logos to be located in relative img/ sub folder and saved as PNG files. The file names must follow the convention <SPEDITION-CODE>.png for pin and <SPEDITION-CODE>-logo.png for spedition logo.

Logo size: 600x600 px