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

@space8/czm-plugin

v1.1.32

Published

czm-plugin is a JavaScript library based on cesium for creating 3D globes and 2D maps in a web browser

Downloads

181

Readme

czm-plugin

介绍

czm-plugin是一款基于Cesium拓展开发的一套插件,致力于三维地理空间数据的渲染。专为前端开发者提供简单、高效的SDK,让开 发者无需掌握复杂的计算机图形学和GIS基础便可完成GIS三维的相关功能开发,做到Write Less Do More。

安装教程

npm install @space8/czm-plugin

使用说明

useage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>czm-plugin示例</title>
    <style>
        html, body, #earth {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="earth"></div>
</body>
</html>
import {
    EarthV,
    TianDiTuLayer,
    TianDiTuType,
    ClockBoundary,
    EventHandler,
    MarkLayer,
    AnimationMarkLayer, ArcGISLayer, AnimationMarkLayer2, WMSLayer, PolygonLayer,
} from '@space8/czm-plugin';

/**
 * 初始化三维地球
 */
let earthV = new EarthV("earth");
/**
 * 添加天地图
 */
const tianDiTuLayer = new TianDiTuLayer({
  layerName: "tianditu",
  type: TianDiTuType.IMG_W
});
tianDiTuLayer.addTo(earthV);
webpack configuration
// The path to the czm-plugin
const czmPlugin = 'node_modules/@space8/czm-plugin/';
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

module.exports = {
    context: __dirname,
    entry: {
        app: './src/index.js'
    },
    output: {
        filename: 'app.js',
        // path: path.resolve(__dirname, 'build'),
        path: path.resolve(__dirname, 'publish'),
        sourcePrefix: ''
    },
    amd: {
        // Enable webpack-friendly use of require in czm-plugin
        toUrlUndefined: true
    },
    resolve: {
        alias: {
            cesium: path.resolve(__dirname, "node_modules/cesium/Source")
        },
        mainFiles: ['index', 'Cesium']
    },
    module: {
        rules: [{
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
        }, {
            test: /\.(png|gif|jpg|jpeg|svg|xml|json)$/,
            use: ['url-loader']
        }],
        unknownContextCritical: false,
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: 'src/index.html',
            filename: "index.html"
        }),
        // Copy czm-plugin Assets, Widgets, and Workers to a static directory
        new CopyWebpackPlugin({
            patterns: [
                {from: path.join(czmPlugin, "build/Workers"), to: 'Workers'},
                {from: path.join(czmPlugin, "build/ThirdParty"), to: 'ThirdParty'},
                {from: path.join(czmPlugin, 'build/Assets'), to: 'Assets'},
                {from: path.join(czmPlugin, 'build/Widgets'), to: 'Widgets'}
            ]
        }),
        new webpack.DefinePlugin({
            CESIUM_BASE_URL: JSON.stringify('')
        }),
        new NodePolyfillPlugin(),
    ],
    mode: 'development',
    devtool: 'source-map',
    // development server options
    devServer: {
        static: {
            directory: path.join(__dirname, 'publish'),
        },
        port: 8080,
    }
};

参与贡献

1.贵仁科技GIS三维组