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

chbim-plugins

v0.0.107

Published

一个简单的组件库

Downloads

1,241

Readme

使用指南

  1. 此插件和 CHBIM 平台强绑定
  2. node 版本>=16.14.2

安装

npm i chbim-plugins

引入

import "chbim-plugins/style.css";
import { ChbimPlugins } from "chbim-plugins";
......
......
......
app.use(ChbimPlugins);

使用

在需要使用的.vue 文件里面引入

import {
  BimTerrainProvider,             // 地形
  BimElevationImage,              // 瓦片
  BimModel,                       // 模型
  BimVector,                      // 矢量
  BimEntity,                      // 注记
  PanoramicView,                  // 全景图
  ......
} from "chbim-plugins";

添加模型为例:

/* data 为模型树的扁平化json */
window.bimModel = new BimModel(data);

/* 给地图添加模型
** id => 模型id
** fn => 自定义注册事件
*/
window.bimModel.add(id,fn).then((e) => {
   if (e.type == "error") {
     console.error('失败')
   }
 }).catch((e) => {
   console.error('失败')
 })

API

window.bimElevationImage 影像

add( id || xyzParameter,isGisTkone,fn)添加影像

| 类参数名 | 类型 | 默认参数 | 描述 | | ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | id | String | “ ” | 需要添加的影像 id | | xyzParameter | Object | { } | 三方影像数据 {imageXyzId:影像id,url:影像路由,zIndex:影像层级,minimumLevel:服务支持的最小层级,maximumLevel:服务支持的最大层级,chinaCRS:标识瓦片的国内坐标系(用于自动纠偏或加偏)} chinaCRS 默认 GCJ02 | | isGisTkone | Boolean | true | 是否开启 Tkone 验证,三方影像不需要开启验证 | | fn | Object | { } | 例如:绑定 click 事件 { click: (e) => { console.log(e) } } |

remove( id )添加影像

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ----------------- | | id | String | “ ” | 需要移除的影像 id |

query( id )查询影像的数据

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------- | | id | String | “ ” | 需要查询的模型 id,返回模型数据 |

window.bimModel 模型

add( id,fn,list )添加模型

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------------------------ | | id | String | “ ” | 需要添加的模型 id | | fn | Object | { } | 例如:绑定 click 事件 { click: (e) => { console.log(e) } } | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

remove( id,list )移除模型

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------- | | id | String | “ ” | 需要移除的模型 id | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

selected( id )选中模型

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------- | -------- | ------------------------------------------------------------ | | id | String | “ ” | 需要选中的模型 id | | fn | Object | { } | 例如:绑定 click 事件 { click: (e) => { console.log(e) } } | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } | | flyTo | Boolean | true | 默认会自动飞行,模型选中变红,设置false不会飞行 |

query( id )查询模型的数据

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------- | | id | String | “ ” | 需要查询的模型 id,返回模型数据 |

queryModel( id )查询 map 上模型的实体

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------- | | id | String | “ ” | 需要查询的模型 id,返回模型实体 |

editColor( id,newColor,list )模型染色

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------- | | id | String | “ ” | 模型 id | | newColor | String | “ ” | css 颜色值 | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

editOpacity( id,opacity)模型染色

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------ | | id | String | “ ” | 模型 id | | opacity | String | “ ” | 透明度值 0~1 |

window.bimVector 矢量

add( id,list )添加矢量

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------- | | id | Object | “ ” | 需要添加的矢量 id | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

remove( id,list )移除矢量

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------- | | id | String | “ ” | 需要移除的矢量 id | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

selected( id )添加矢量

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------ | | id | Object | “ ” | 需要选中的矢量 id ,选中会飞行到选中的矢量 |

query( id )添加矢量

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | -------------------------------- | | id | Object | “ ” | 需要选中的矢量 id ,返回矢量数据 |

queryVector( id )添加矢量

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | -------------------------------- | | id | Object | “ ” | 需要选中的矢量 id ,返回矢量实体 |

window.bimEntity 标绘

add( id,entityId,list )添加标绘

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ----------------------------------------------- | | id | Object | “ ” | 需要添加的标绘 id | | entityId | String | null | 临时添加的标绘是不带 id 的,需要自定义的一个 id | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

remove( id,list )移除标绘

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | ------------------------------------------- | | id | String | “ ” | 需要移除的标绘 id | | list | Object | { } | 字段目前用于处理分屏数据 { isClone:true } |

query( id )添加标绘

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | -------------------------------- | | id | Object | “ ” | 需要选中的矢量 id ,返回矢量数据 |

queryEntity( id )添加标绘

| 类参数名 | 类型 | 默认参数 | 描述 | | -------- | ------ | -------- | -------------------------------- | | id | Object | “ ” | 需要选中的矢量 id ,返回矢量实体 |

版本控制

该项目使用 Git 进行版本管理。