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

chenkai-linematerial

v1.0.2

Published

cesium line-strip material line-material cesium-material cesium-linematerial

Readme

GIS CESIUM 动态线条材质 闪烁,图片,高亮

动态效果材质

动态效果材质

视频

动态效果材质

引入依赖

import * as Cesium from 'cesium'
// 闪烁条纹材质,材质图片条纹材质,渐变高亮条纹材质
import { LineFlickerMaterial, Spriteline1Material, GradientHilightMaterial } from 'LineMaterial'

使用方式

  • 1.加载虚拟数据以展示材质。青岛高速路网geojson。(文件目录example/public/qingdaoRoad.geojson)
  • 2.材质使用方式,new 材质名(配置项) onMounted中,或自定义的加载函数中
const viewer = ref(null)
onMounted(() => {
  // 初始化视图viewer
  viewer.value = new Cesium.Viewer('cesiumContainer', {
    terrain: Cesium.Terrain.fromWorldTerrain(),
    animation: false,
    baseLayerPicker: false,
    vrButton: false,
    geocoder: false,
    homeButton: false,
    timeline: false,
    sceneModePicker: false,
    infoBox: false,
    navigationHelpButton: false
  });
  // 加载虚拟数据 将qingdaoRoad.geojson文件复制到目录/public/qingdaoRoad.geojson
  // 加载文件目录中的数据
  Cesium.GeoJsonDataSource.load("/qingdaoRoad.geojson").then(function(dataSource) {
    viewer.value.dataSources.add(dataSource); // 
    const entities = dataSource.entities.values;
    for (let i = 0; i < entities.length; i++) {
      let entity = entities[i];
      entity.polyline.width = 3.0;
      // 设置材质
      entity.polyline.material = new LineFlickerMaterial({
        // 材质颜色
        color: Cesium.Color.YELLOW,
        // 设置随机变化速度
        speed: 20 * Math.random(),
      })
    }
  });
})
  • 3.材质配置项 闪烁材质效果
new LineFlickerMaterial({
  // 材质颜色
  color: Cesium.Color.YELLOW,
  // 设置随机变化速度
  speed: 20 * Math.random(),
})

闪烁材质效果 图片条纹材质效果

new Spriteline1Material({
  duration: 1000, // 动画时长
  image: '/gradientline.png' // 当作纹理的图片 /example/public/gradientline.png
});

图片条纹材质效果

高亮渐变效果

new GradientHilightMaterial({
  color: new Cesium.Color(0.2, 1.0, 0.4, 0.8), // 材质新颜色
  speed: 15 * Math.random(), // 高亮运动速度
  percent: 0.25, // 颜色区域比例
  gradient: 0.01 // 渐变色渐变梯度
})

高亮渐变效果