Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@geoscene/core
Advanced tools
GeoScene API for JavaScript: A complete 2D and 3D mapping and data visualization API
ES 模块的缩小的、未构建的版本 GeoScene API for JavaScript 。
您可以通过 npm 安装这些模块,然后在 React、Vue.js 或 Angular 等框架中直接使用它们。或者,您也可以使用 Webpack 或 rollup.js 创建自己的自定义构建。
将模块安装到您的项目中:
npm install @geoscene/core
将 CSS 设置为与已安装的 API 模块相同的版本。 您可以通过运行验证已安装的 API 版本 npm list @geoscene/core
。 如果你正在使用本地版本的 assets,查看 管理本地 assets 部分。
示例显示为生产 API 版本导入 CSS 4.23.0
:
index.css
@import "https://js.geoscene.cn/4.23/@geoscene/core/assets/geoscene/themes/light/main.css";
对于大多数本地构建,API 的资产在运行时自动从 CDN 中提取,无需额外配置。 这些资产包括样式、图像、网络工作者、wasm 和本地化文件。
如果您需要在本地管理 assets,请将它们从 /node_modules/@geoscene/core/assets
复制到您的项目中,然后设置 config.assetsPath
以确保正确解析资产请求。 实现此目的的一种简单方法是配置在构建过程中运行的 npm 脚本。 例如,使用 npm 安装 ncp
并在 package.json 中配置一个脚本来复制该文件夹。
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.json
的 architect/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 用户可以使用 xcopy
或 ncp
适用于任何平台。
易智瑞信息技术有限公司版权所有 © 2022并保留所有权利。发行于中华人民共和国。
本材料在 GeoScene 主许可协议(MLA)下许可使用,并受该协议条款的约束。 只要遵守主许可协议中的条款并包括此版权声明,您即可在不进行修改的情况下 重新分发和使用这些代码。
FAQs
GeoScene Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
The npm package @geoscene/core receives a total of 3 weekly downloads. As such, @geoscene/core popularity was classified as not popular.
We found that @geoscene/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.