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

cesium-heatmap-es6

v0.8.0

Published

1.[《117颗星 manuelnas/CesiumHeatmap》](https://github.com/manuelnas/CesiumHeatmap) 基于heatmap.min.js,通过绘制Entity(矩形)实体实现,364行代码,有三维效果 2. [《32颗星 postor/cesiumjs-heat 》](https://github.com/postor/cesiumjs-heat) 基于heatmap.min.js,使用SingleTileImageryProvider图层实现

Downloads

166

Readme

参考源码

1.《117颗星 manuelnas/CesiumHeatmap》 基于heatmap.min.js,通过绘制Entity(矩形)实体实现,364行代码,有三维效果 2. 《32颗星 postor/cesiumjs-heat 》 基于heatmap.min.js,使用SingleTileImageryProvider图层实现,根据镜头移动具有重绘功能,239行代码,无三维效果 3. 《16颗星 wangzhongliang/CesiumHeatmap》 使用Primitive图元实现,提供了两种方式,优点在于计算范围的方法。 方式一基于heatmap.min.js,157行代码,无三维效果; 方式二基于webgl-heatmap.js,128行代码,无三维效果;

特点

  1. 提供三种绘制方式,实体(可贴模型,有三维效果)、图元、图层
  2. 提供重绘,通过摄像头的高度进行重绘
  3. 提供heatmap.js的所有配置参数入口
  4. 源码ts编写,发布支持es6和umd两种模式
  5. 支持npm安装

效果图

效果图

在这里插入图片描述 在这里插入图片描述

插件使用方法

安装

npm install cesium-heatmap-es6

文档

自行打开docs文件夹

umd模式

<script type="text/javascript" src="./CesiumHeatmap/dist/cesium-heatmap-es6.umd.js"></script>
 const defaultDataValue = [10, 500]
        const defaultOpacityValue = [0, 1]
  const points = []
        fetch("/datas/geojson/busstop2016.geojson", {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            },
        }).then((response) => {
            response.json().then((data) => {
                if (data)
                    data.features.forEach(function (feature) {
                        const lon = feature.geometry.coordinates[0]
                        const lat = feature.geometry.coordinates[1]
                        points.push({
                            x: lon,
                            y: lat,
                            value: 100 * Math.random()
                        })
                    })
                const earthHeatMap = new CesiumHeatmap(viewer,
                    {
                        zoomToLayer: true,
                        points,
                        heatmapDataOptions: { max: defaultDataValue[1], min: defaultDataValue[0] },
                        heatmapOptions: {
                            maxOpacity: defaultOpacityValue[1],
                            minOpacity: defaultOpacityValue[0]
                        }
                    }
                )
            })
        })

es6模式

 const defaultDataValue = [10, 500]
        const defaultOpacityValue = [0, 1]
import { CesiumHeatmap, HeatmapPoint } from "cesium-heatmap-es6"

 const points: HeatmapPoint[] = []
        fetch("/datas/geojson/busstop2016.geojson", {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            },
        }).then((response) => {
            response.json().then((data) => {
                if (data)
                    data.features.forEach(function (feature) {
                        const lon = feature.geometry.coordinates[0]
                        const lat = feature.geometry.coordinates[1]
                        points.push({
                            x: lon - 0.05,
                            y: lat - 0.04,
                            value: 100 * Math.random()
                        })
                    })
                cesiumHeatmap = new CesiumHeatmap(viewer,
                    {
                        zoomToLayer: true,
                        points,
                        heatmapDataOptions: { max: defaultDataValue[1], min: defaultDataValue[0] },
                        heatmapOptions: {
                            maxOpacity: defaultOpacityValue[1],
                            minOpacity: defaultOpacityValue[0]
                        }
                    }
                )
            })
        })

源码使用方法

依赖安装

npm run a

项目运行

npm start

项目打包

npm run build

发布

npm run release