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

leaflet.projwmts

v1.0.0

Published

Leaflet wmts layer with projection

Downloads

515

Readme

leaflet.projwmts

Leaflet wmts layer with projection

Usage

Download or clone this repo, then build it with:

npm install
gulp build

Example

to run example localy with live-server:

npm serve

if everything is ok, new browser windows should be opened with directory listing, then go to

examples/wmts.html

or

examples/wmts_ortho.html

In examples EPSG:2180 is used, but it should work with diffrent CRS.

To properly configure wmts projection you have to define crs first like:

var crs = new L.Proj.CRS(
    "EPSG:2180",
    "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 units=m +no_defs",
    {}
);

then you can pass it to wmts layer, you have to copy tileSize, origin, scales and tilematrixSet values from service capabilities (url + '?service=WMTS&request=GetCapabilities') :

L.tileLayer.projwmts('https://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/G2_MOBILE_500', {
        crs: crs,
		format: 'image/png',
		tileSize: 512,
		version: '1.0.0',
		transparent: true,
        origin:[850000.0,100000.0],
        scales:[30238155.714285716,15119077.857142858,7559538.928571429,3779769.4642857146,1889884.7321428573,944942.3660714286,472471.1830357143,236235.59151785716,94494.23660714286,47247.11830357143,23623.559151785714,9449.423660714287,4724.711830357143,1889.8847321428573,944.9423660714286,472.4711830357143],
        tilematrixSet: 'EPSG:2180',
        opacity:1.0,
        crossOrigin:true,
        minZoom:5
    })

If you are using map service from diffrent domain then remember to set in layer options

crossOrigin: true