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

@yandex/ymaps3-tiles-generator

v0.0.2

Published

Yandex Maps JS API 3.0 Tile generator CLI utility

Downloads

3

Readme

Yandex Tile generator CLI utility

npm version npm

This tool will help you in splitting a large image into smaller tiles for use on a Yandex map with accurate scale.

Your image will be scaled automatically for each level of zoom (scheme is presented below). At maximum zoom level, the image will show pixel-to-pixel detail. If you would like to see the image at a higher level of zoom, you can use the maxZoom option to enlarge it. Additionally, you can choose to restrict the minimum zoom level for tile generation by setting the minZoom option.

tiling scheme

By default, we do not center the image and do not generate empty tiles. If you need it, specify the shouldCenter and withEmptyTiles options respectively.

The utility also generates a params.json file with presets for correct display of your image on a map. You can see an example of using this utility with @yandex/ymaps3-cartesian-projection package.

NOTE: For more information on how to run the examples locally, please see the CONTRIBUTING.md

Install

Install Tile generator CLI to be used in your project with

npm install --save-dev @yandex/ymaps3-tiles-generator

And then you should be able to run the CLI with

npx ymaps3-tiles-generator --help

Usage

You can use it via terminal:

Options:
  -s, --source, --src                  Source image path     [string] [required]
  -d, --destination, --dst             Destination tiles folder path
                                                   [string] [default: "./tiles"]
      --pathTemplate, --path           Template pathname for the generated tile
                                       files
                                     [string] [default: "{{z}}/{{y}}-{{x}}.png"]
      --minZoom, --min                 Minimum zoom level for tile generation
                                                                        [number]
      --maxZoom, --max                 Maximum zoom level for tile generation
                                                                        [number]
      --tileSize, --size               Width and height tile size
                                                         [number] [default: 256]
  -c, --shouldCenter, --center         Should center image be in tail grid
                                                      [boolean] [default: false]
  -e, --withEmptyTiles, --emptyTiles   Should generate background empty tiles
                                       around the image
                                                      [boolean] [default: false]
  -b, --backgroundColor, --background  Background color for completely or
                                       partially empty tiles
                                                 [string] [default: "#00000000"]
  -v, --version                        Show version number             [boolean]
  -h, --help                           Show help                       [boolean]

License: Apache-2

Or you can also use it in code:

import {generateTiles} from '@yandex/ymaps3-tiles-generator';

generateTiles(source, destination, {shouldCenter: true});