Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计提醒

arcgis-portal-contentarcgis 门户内容

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

776

周安装

32

GitHub Stars

13

下载量

253
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:arcgis-portal-content(arcgis 门户内容)
来源仓库:https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context
仓库路径:skills/arcgis-portal-content
安装命令:
npx skills add https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context --skill arcgis-portal-content
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context --skill arcgis-portal-content

简介

用于管理门户地图资源和 WebMap 结构配置。

  • 支持 PortalItem 查询、WebScene 保存等云端协作功能。
  • 集成 PortalQueryParams 实现高级内容检索逻辑。
  • 适用于企业级地图服务的内容分发和版本管理工作流。
  • arcgis-portal-content 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ArcGIS Portal Content

Use this skill for saving maps, managing bookmarks, slides, working with portal items, and configuring WebMap/WebScene structure.

Import Patterns

Direct ESM Imports

import WebMap from "@arcgis/core/WebMap.js";
import WebScene from "@arcgis/core/WebScene.js";
import Portal from "@arcgis/core/portal/Portal.js";
import PortalItem from "@arcgis/core/portal/PortalItem.js";
import PortalQueryParams from "@arcgis/core/portal/PortalQueryParams.js";

Dynamic Imports (CDN)

const WebMap = await $arcgis.import("@arcgis/core/WebMap.js");
const Portal = await $arcgis.import("@arcgis/core/portal/Portal.js");
const [PortalItem, PortalQueryParams] = await $arcgis.import([
  "@arcgis/core/portal/PortalItem.js",
  "@arcgis/core/portal/PortalQueryParams.js",
]);

WebMap Structure

WebMap Properties

import WebMap from "@arcgis/core/WebMap.js";

const webMap = new WebMap({
  // From portal item
  portalItem: {
    id: "WEBMAP_ID",
    portal: { url: "https://www.arcgis.com" },
  },
});

// Or create from scratch
const webMap = new WebMap({
  basemap: "topo-vector",
  ground: "world-elevation",
  layers: [featureLayer, graphicsLayer],
  tables: [tableLayer],
  initialViewProperties: {
    center: [-118.805, 34.027],
    zoom: 13,
  },
  bookmarks: [bookmark1, bookmark2],
});

WebMap from JSON

const webMap = WebMap.fromJSON({
  operationalLayers: [
    {
      id: "layer1",
      layerType: "ArcGISFeatureLayer",
      url: "https://services.arcgis.com/.../FeatureServer/0",
      title: "My Layer",
      visibility: true,
      opacity: 1,
    },
  ],
  baseMap: {
    baseMapLayers: [
      {
        id: "basemap",
        layerType: "VectorTileLayer",
        styleUrl:
          "https://basemaps-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/topographic",
      },
    ],
    title: "Topographic",
  },
  initialState: {
    viewpoint: {
      targetGeometry: {
        xmin: -118.9,
        ymin: 33.8,
        xmax: -118.1,
        ymax: 34.3,
        spatialReference: { wkid: 4326 },
      },
    },
  },
});

WebScene Structure

import WebScene from "@arcgis/core/WebScene.js";

const webScene = new WebScene({
  portalItem: { id: "WEBSCENE_ID" },
});

// Or create from scratch
const webScene = new WebScene({
  basemap: "satellite",
  ground: "world-elevation",
  layers: [sceneLayer, featureLayer],
  initialViewProperties: {
    viewpoint: {
      camera: {
        position: {
          x: -118.805,
          y: 34.027,
          z: 1500,
          spatialReference: { wkid: 4326 },
        },
        heading: 45,
        tilt: 65,
      },
    },
  },
  presentation: {
    slides: [slide1, slide2],
  },
});

Local vs Global Scene

// Global scene (default)
const globalScene = new WebScene({
  basemap: "satellite",
  ground: "world-elevation",
  viewingMode: "global",
});

// Local scene (with clipping)
const localScene = new WebScene({
  basemap: "satellite",
  ground: "world-elevation",
  viewingMode: "local",
  clippingArea: {
    type: "extent",
    xmin: -118.9,
    ymin: 33.8,
    xmax: -118.1,
    ymax: 34.3,
    spatialReference: { wkid: 4326 },
  },
  clippingEnabled: true,
});

Saving WebMaps

Save As New Item

const map = new WebMap({
  portalItem: { id: "EXISTING_WEBMAP_ID" },
});

// Update map properties from view before saving
await map.updateFrom(view);

const savedItem = await map.saveAs({
  title: "My New WebMap",
  snippet: "Description of the map",
  tags: ["tag1", "tag2"],
});

console.log(
  "Saved to:",
  savedItem.portal.url + "/home/item.html?id=" + savedItem.id,
);

Save Existing WebMap

await map.updateFrom(view);
await map.save();

Map Component Save Example

<arcgis-map item-id="YOUR_WEBMAP_ID">
  <arcgis-zoom slot="top-left"></arcgis-zoom>
</arcgis-map>

<script type="module">
  const viewElement = document.querySelector("arcgis-map");
  await viewElement.viewOnReady();

  document.getElementById("saveBtn").onclick = async () => {
    await viewElement.map.updateFrom(viewElement.view);
    await viewElement.map.save();
  };
</script>

Saving WebScenes

const scene = new WebScene({
  portalItem: { id: "EXISTING_WEBSCENE_ID" },
});

await scene.updateFrom(sceneView);
await scene.saveAs({
  title: "My New WebScene",
  snippet: "3D scene description",
});

Bookmarks

Bookmarks Component

<arcgis-map item-id="YOUR_WEBMAP_ID">
  <arcgis-expand slot="top-right" expanded>
    <arcgis-bookmarks
      drag-enabled
      show-add-bookmark-button
      show-edit-bookmark-button
      hide-time
    >
    </arcgis-bookmarks>
  </arcgis-expand>
</arcgis-map>

<script type="module">
  const bookmarks = document.querySelector("arcgis-bookmarks");

  bookmarks.addEventListener("arcgisSelect", (event) => {
    console.log("Selected:", event.detail.bookmark.name);
  });
</script>

Create Bookmarks Programmatically

import Bookmark from "@arcgis/core/webmap/Bookmark.js";

const bookmark = new Bookmark({
  name: "My Location",
  viewpoint: view.viewpoint.clone(),
});

map.bookmarks.add(bookmark);

// Go to bookmark
view.goTo(bookmark.viewpoint);

WebScene Slides

Create Slide from Current View

import Slide from "@arcgis/core/webscene/Slide.js";

const slide = await Slide.createFrom(sceneView);
slide.title = { text: "Downtown View" };

// Add to presentation
scene.presentation.slides.add(slide);

Apply Slide to View

const slide = scene.presentation.slides.getItemAt(0);

slide.applyTo(sceneView, {
  maxDuration: 3000,
  easing: "in-out-coast-cubic",
});

Remove Slide

scene.presentation.slides.remove(slide);

Portal Items

Load Portal Item

import PortalItem from "@arcgis/core/portal/PortalItem.js";

const item = new PortalItem({ id: "ITEM_ID" });
await item.load();

console.log("Title:", item.title);
console.log("Type:", item.type);
console.log("Owner:", item.owner);
console.log("Created:", item.created);

Query Portal Items

import Portal from "@arcgis/core/portal/Portal.js";
import PortalQueryParams from "@arcgis/core/portal/PortalQueryParams.js";

const portal = new Portal({ authMode: "immediate" });
await portal.load();

const queryParams = new PortalQueryParams({
  query: `owner:${portal.user.username} type:"Web Map"`,
  sortField: "modified",
  sortOrder: "desc",
  num: 20,
});

const result = await portal.queryItems(queryParams);
result.results.forEach((item) => {
  console.log(item.title, item.id);
});

Update Portal Item

const item = new PortalItem({ id: "ITEM_ID" });
await item.load();

item.title = "Updated Title";
item.snippet = "Updated description";
item.tags = ["new", "tags"];

await item.update();

Portal Groups

Query Groups

const portal = new Portal();
await portal.load();

const groups = await portal.queryGroups({ query: "title:GIS" });
groups.results.forEach((group) => {
  console.log(group.title, group.id);
});

Query Group Content

const group = (await portal.queryGroups({ query: `id:GROUP_ID` })).results[0];
const content = await group.queryItems();
content.results.forEach((item) => {
  console.log(item.title);
});

Portal User Information

const portal = new Portal({ authMode: "immediate" });
await portal.load();

console.log("Username:", portal.user.username);
console.log("Full name:", portal.user.fullName);
console.log("Email:", portal.user.email);
console.log("Role:", portal.user.role);
console.log("Org name:", portal.name);

Portal Folders

import PortalFolder from "@arcgis/core/portal/PortalFolder.js";

// Get user folders
const folders = await portal.user.fetchFolders();
folders.forEach((folder) => {
  console.log(folder.title, folder.id);
});

// Query items in a specific folder
const queryParams = new PortalQueryParams({
  query: `owner:${portal.user.username}`,
  sortField: "modified",
  num: 20,
});
queryParams.folder = folder;

const result = await portal.queryItems(queryParams);

Common Pitfalls

  1. Authentication required for saving: Saving requires user authentication. Ensure OAuth is set up before calling save() or saveAs().
  2. Forgetting updateFrom before save: Always call updateFrom(view) before saving to capture the current view state: // Anti-pattern: saving without updating await map.save(); // May save stale viewpoint // Correct: update from view first await map.updateFrom(view); await map.save();
  3. Enterprise portal URL: Enterprise portals need explicit portal URL: const portal = new Portal({url: "https://your-portal.com/portal",});
  4. Ownership restrictions: You can only update portal items you own. Use saveAs() to create a copy you own.
  5. Slide thumbnails: Generated automatically from Slide.createFrom() but may take time to render.

Complete Save Example

<!DOCTYPE html>
<html>
  <head>
    <script src="https://js.arcgis.com/5.0/"></script>
    <script
      type="module"
      src="https://js.arcgis.com/5.0/map-components/"
    ></script>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
      }
    </style>
  </head>
  <body>
    <arcgis-map item-id="YOUR_WEBMAP_ID">
      <arcgis-zoom slot="top-left"></arcgis-zoom>
      <arcgis-expand slot="top-right" expanded>
        <arcgis-bookmarks
          drag-enabled
          show-add-bookmark-button
          show-edit-bookmark-button
        >
        </arcgis-bookmarks>
      </arcgis-expand>
    </arcgis-map>

    <script type="module">
      const viewElement = document.querySelector("arcgis-map");
      await viewElement.viewOnReady();

      // Save map on button click
      document.getElementById("saveBtn").onclick = async () => {
        await viewElement.map.updateFrom(viewElement.view);
        await viewElement.map.save();
      };
    </script>
  </body>
</html>

Reference Samples

  • webmap-save - Saving a WebMap to portal
  • webmap-basic - Loading a WebMap from portal
  • webmap-swap - Swapping between WebMaps
  • webscene-save - Saving a WebScene to portal
  • webscene-basic - Loading a WebScene from portal
  • webscene-slides - Managing WebScene slides
  • webscene-slide-tour - Slide tour through a WebScene
  • bookmarks - Working with map bookmarks
  • widgets-bookmarks - Bookmarks widget usage
  • basemaps-portal - Loading basemaps from portal
  • layers-portal - Loading layers from portal items
  • portalitem-dragndrop - Drag and drop portal items

Related Skills

  • See arcgis-authentication for OAuth and API key setup.
  • See arcgis-core-maps for map and view creation.
  • See arcgis-layers for layer configuration.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

27.27%
按下载量换算69

trae

22.27%
按下载量换算56

Codex

17.81%
按下载量换算45

Claude Code

11.54%
按下载量换算29

Antigravity

7.98%
按下载量换算20

Gemini CLI

3.57%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills