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 🙏

© 2026 – Pkg Stats / Ryan Hefner

oltool

v0.0.5

Published

openlayerTool

Readme

openlayer工具

介绍

openlayers常用工具封装

使用

    import olTool from 'olTool' 
    const OlTool = new olTool({
        minZoom: 5,
        maxZoom: 20,
        initialZoom: 6,
        minVisbleZoom: 5,
        minVisibleScale: 10000000, // 分级时,显示尺度
        minVisibleScale_: 10000000, // 未分级时,标注显示尺度(3000000)
        origin: [-180.0, 90.0],
        init_Center: [107.5, 30],
        full_Extent: { xmin: 73.498436, ymin: 21.142454, xmax: 135.086655, ymax: 53.561573 },
        init_Extent: { xmin: 90.51758618252902, ymin: 23.893409685015925, xmax: 121.95764914055758, ymax: 36.12653381334954 },
        isClassify: false, // 是否分级显示
        isTextVisble: true, // 是否显示站名
        resolutions: [
            0.7031250000029744,
            0.35156250000000011,
            0.17578125000000006,
            0.087890625000000028,
            0.043945312500000014,
            0.021972656250000007,
            0.010986328125000003,
            0.0054931640625000017,
            0.0027465820312500009,
            0.0013732910156250004,
            0.00068664550781250022,
            0.00034332275390625011,
            0.00017166137695312505,
            8.5830688476562527E-5,
            4.2915344238281264E-5,
            2.1457672119140632E-5,
            1.0728836059570316E-5,
            5.3644180297851579E-6,
            2.68220901489257E-6,
            1.3411118121060625E-6
        ],
        basemap_config: [{
            map_url: [{
            map_url: 'http://t0.tianditu.com/ter_c/wmts?tk=',
            type: 'tdt',
            name: '晕渲底图',
            zIndex: 0,
            id: 'ter_c'
            }, {
            map_url: 'http://t0.tianditu.com/cta_c/wmts?tk=',
            type: 'tdt',
            name: '标注图层',
            zIndex: 99,
            id: 'cta_c'
            }],
            url: 'images/yxt.png',
            name: '影像',
            visible: true,
            id: 'tdtDemLayer'
        }, {
            map_url: [{
            map_url: 'http://t0.tianditu.com/vec_c/wmts?tk=',
            type: 'tdt',
            name: '行政底图',
            zIndex: 0,
            id: 'vec_c'
            }, {
            map_url: 'http://t0.tianditu.com/cva_c/wmts?tk=',
            type: 'tdt',
            name: '标注图层',
            zIndex: 99,
            id: 'cva_c'
            }],
            url: 'images/xzt.png',
            name: '行政',
            visible: false,
            id: 'tdtVectorLayer'
        }, {
            map_url: [{
            map_url: 'http://t0.tianditu.com/img_c/wmts?tk=',
            type: 'tdt',
            name: '影像底图',
            zIndex: 0,
            id: 'img_c'
            }, {
            map_url: 'http://t0.tianditu.com/cia_c/wmts?tk=',
            type: 'tdt',
            name: '标注图层',
            zIndex: 99,
            id: 'cia_c'
            }],
            url: 'images/yxit.png',
            name: '影像',
            visible: false,
            id: 'tdtImageLayer'
        }]
    })
    OlTool.initMap( id )
    ...