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

@geoscene/core

v4.27.4

Published

GeoScene Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

Downloads

436

Readme

@geoscene/core

ES 模块的缩小的、未构建的版本 GeoScene Maps SDK for JavaScript

特性

您可以通过 npm 安装这些模块,然后在 ReactVue.jsAngular 等框架中直接使用它们。或者,您也可以使用 Webpackrollup.js 创建自己的自定义构建。

API 包括 TypeScript类型定义。“.d.ts”声明文件与打包在一起。

开始

将模块安装到您的项目中:

npm install @geoscene/core

配置 CSS

将 CSS 设置为与已安装的 API 模块相同的版本。 您可以通过运行验证已安装的 API 版本 npm list @geoscene/core 。 如果你正在使用本地版本的 assets,查看 管理本地 assets 部分。

示例显示为生产 API 版本导入 CSS 4.27.0:

index.css

@import "https://js.geoscene.cn/4.27/@geoscene/core/assets/geoscene/themes/light/main.css";

配置 assets

对于大多数本地构建,API 的资产在运行时自动从 CDN 中提取,无需额外配置。 这些资产包括样式、图像、网络工作者、wasm 和本地化文件。

管理本地 assets

如果您需要在本地管理 assets,请将它们从 /node_modules/@geoscene/core/assets 复制到您的项目中,然后设置 config.assetsPath 以确保正确解析资产请求。 实现此目的的一种简单方法是配置在构建过程中运行的 npm 脚本。 例如,使用 npm 安装 ncp 并在 package.json 中配置一个脚本来复制该文件夹。

Important: 每次升级API时,请确保将新版本的 assets 重新复制到项目中。这确保了 assets 与API保持同步。

React 示例:

package.json

{
  "scripts": {
    "start": "ncp ./node_modules/@geoscene/core/assets ./public/assets && react-scripts start",
    "build": "ncp ./node_modules/@geoscene/core/assets ./public/assets && react-scripts build",
  }
}

App.js

import geosceneConfig from "@geoscene/core/config.js";
geosceneConfig.assetsPath = "./assets"; 

index.css

@import "@geoscene/core/assets/geoscene/themes/light/main.css";

对于 Angular,通过配置 angular.jsonarchitect/build/options/assets 部分来复制资产文件,例如:

angular.json

{
  "assets": [
    {
      "glob": "**/*",
      "input": "node_modules/@geoscene/core/assets",
      "output": "/assets/"
    }
  ]
}

app.component.ts

import geosceneConfig from "@geoscene/core/config.js";
geosceneConfig.assetsPath = "./assets"; 

app.component.css

@import "@geoscene/core/assets/geoscene/themes/light/main.css";

对于其他安装,请考虑使用此 npm 脚本作为起点:

package.json

{
  "script": {
    "copy": "cp -R ./node_modules/@geoscene/core/assets ./dist/assets"
  }
}

Windows 用户可以使用 xcopyncp 适用于任何平台。

资源

许可

易智瑞信息技术有限公司版权所有 © 2024并保留所有权利。发行于中华人民共和国。

本材料在 GeoScene 主许可协议(MLA)下许可使用,并受该协议条款的约束。 只要遵守主许可协议中的条款并包括此版权声明,您即可在不进行修改的情况下 重新分发和使用这些代码。

查看 https://links.geoscene.cn/legal/full-master-agreement 了解使用限制