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

@xh-gis/widgets

v1.0.10

Published

XH GIS React Widgets - 基于 Engine 的 React 组件

Readme

@xh-gis/widgets

基于 @xh-gis/engine 的 React GIS 组件库。

📦 安装

npm install @xh-gis/widgets @xh-gis/engine

📋 依赖要求

  • React: >=16.8.0
  • @xh-gis/engine: ^1.0.0
  • CesiumJS: 1.108.0

🔗 相关链接

  • 在线沙盒(GitHub Pages): https://shen-96.github.io/xh-gis/

🚀 使用

三维地球组件

import React from 'react';
import { Earth } from '@xh-gis/widgets';

function App() {
  const handleInit = (core) => {
    console.log('地球初始化完成', core);
    // 在这里可以使用 core 进行各种 GIS 操作
  };

  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <Earth
        onInit={handleInit}
        infoLine={true}
        timeLine={false}
        toolBox={true}
      />
    </div>
  );
}

export default App;

二维地图组件

import React from 'react';
import { Map } from '@xh-gis/widgets';

function App() {
  const handleInit = (core) => {
    console.log('地图初始化完成', core);
  };

  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <Map
        onInit={handleInit}
        infoLine={true}
        timeLine={true}
        timeLineProps={{
          systemTime: true,
          shouldAnimate: false
        }}
      />
    </div>
  );
}

export default App;

🌟 组件功能

核心组件

  • Earth: 三维地球组件
  • Map: 二维地图组件

功能组件

  • TimeLine: 时间轴控制组件
  • FootLine: 状态信息栏组件
  • Toolbar: 工具栏组件
  • PlotTools: 标绘工具集

⚙️ 组件属性

Earth / Map 组件

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | onInit | (core) => void | - | 初始化完成回调,必填 | | infoLine | boolean | true | 是否显示信息栏 | | timeLine | boolean | false | 是否显示时间轴 | | timeLineProps | object | {} | 时间轴组件属性 | | toolBox | boolean | false | 是否显示工具栏 |

TimeLineProps

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | systemTime | boolean | false | 是否显示系统时间 | | shouldAnimate | boolean | false | 是否自动播放动画 |

🎨 样式

组件自带默认样式,你也可以通过 CSS 类名自定义样式:

.xh-gis-viewer {
  /* 视图容器样式 */
}

.xh-gis-viewer-scene {
  /* 场景容器样式 */
}

.xh-gis-popup-container {
  /* 弹窗容器样式 */
}

📖 API 文档

详细的 API 文档请参考主项目文档。

📄 许可证

MIT License