Compare commits

..
Author SHA1 Message Date
Antigravity AI 390518be0f fix(security): harden endpoints against SSRF, DNS rebinding, open redirects, and error leaks 2026-04-18 16:45:51 +12:00
Antigravity AI e07bc60672 fix(marketplace): apply demo default config to dynamic plugins [Patch] 2026-04-18 16:11:31 +12:00
Antigravity AI d75618f9aa fix(core): allow marketplace bearer token admin access on demo [Patch] 2026-04-18 15:54:23 +12:00
Silvertakana aa34e1c49d Merge pull request #32 from silvertakana/add-claude-github-actions-1776483677184
Add Claude Code GitHub Workflow
2026-04-18 15:41:48 +12:00
Silvertakana 2f618ce2cf "Update Claude Code Review workflow" 2026-04-18 15:41:21 +12:00
Silvertakana 085f4aa90c "Update Claude PR Assistant workflow" 2026-04-18 15:41:19 +12:00
Silvertakana c1ddb91268 Merge pull request #31 from silvertakana/feature/30-enable-demo-admin-privileges
feat(core): enable admin functionality on demo instance
2026-04-18 15:39:54 +12:00
Antigravity AI b3bc62ad8e feat(core): enable admin functionality on demo instance [Minor]
- allow demo-admin to bypass plugin installation blockers [Minor]

- allow demo-admin to use timeline history playback mode [Minor]
2026-04-18 15:21:01 +12:00
Silvertakana 32a4df4952 Merge pull request #29 from silvertakana/feature/plugin-extraction
feat(plugins): decentralize plugin architecture and marketplace updates
2026-04-18 14:31:46 +12:00
Antigravity AI 3ac36446bf chore(ci): add prisma generate to pipeline [Patch] 2026-04-18 14:04:51 +12:00
Antigravity AI ac95a64115 feat(plugins): implement marketplace updates and fix SDK global injection [Minor]
- add /check-updates mechanism to check with marketplace [Minor]
- inject zustand into WWV_HOST to prevent plugin crashes [Patch]
- fix next.config.ts sentry schema [Patch]
2026-04-18 13:39:46 +12:00
Antigravity AI 1d07698df7 feat(plugins): surface dynamic plugin loading failures to UI toast 2026-04-17 19:43:21 +12:00
Antigravity AI 583622f091 fix(plugins): reject fallback unknown-package manifests in validator 2026-04-17 19:41:35 +12:00
Antigravity AI bfdbd0313d feat(marketplace): add explicit server-side error logging for rejected manifests 2026-04-17 17:03:07 +12:00
Antigravity AI a70f93af0a fix(plugins): allow CDNs for dynamic plugin bundles and add marketplace debug logs 2026-04-17 16:59:15 +12:00
Antigravity AI 26970e6adc build: remove plugin packages from core workspace 2026-04-17 13:41:11 +12:00
Antigravity AI 63bc49949a refactor: decouple frontend from specific plugin logic 2026-04-17 13:04:49 +12:00
Antigravity AI ce45f2d4b6 fix(osm): force IPv4 resolution in proxy to bypass docker IPv6 dropouts 2026-04-16 20:17:37 +12:00
Antigravity AI bec1080cb8 chore(osm): instrument osm proxy error handler for docker debugging 2026-04-16 20:06:37 +12:00
Antigravity AI ed4826484c fix(osm): replace native Next.js fetch with node https client to bypass IPv6 timeout crashes in docker environment 2026-04-16 19:50:37 +12:00
Antigravity AI 77e6bf1d55 fix(ws): normalize engine URL to always include /stream path and wss:// protocol 2026-04-16 19:21:45 +12:00
Antigravity AI fa6413e953 fix(build): sync pnpm-lock.yaml after dependency updates to fix frozen lockfile crash [Patch] 2026-04-16 18:26:43 +12:00
Antigravity AI 53a9931e94 feat(plugins): refactor all plugins to fetch directly from data engine
Updated wildfires, surveillance-satellites, satellite, iranwarlive,
international-sanctions, maritime, military-aviation, gps-jamming,
cyber-attacks, civil-unrest, and earthquakes to bypass Next.js rewrites.
2026-04-16 17:23:20 +12:00
Antigravity AI 055ead345a feat(config): remove legacy REST proxy, point plugins directly at engine
Remove /api/external/ rewrite from next.config.ts.
Update Aviation plugin fetch() to call engine REST API directly
using NEXT_PUBLIC_DEFAULT_ENGINE_URL.
2026-04-16 17:21:22 +12:00
Antigravity AI 89c247e913 feat(ui): update DataBusSubscriber for multi-engine WsClient
Resolve engine URL per-plugin via resolveEngineUrl() before
subscribing. Remove eager wsClient.connect() — connections
are now lazy on first subscription.
2026-04-16 17:20:38 +12:00
Antigravity AI df7df20c46 feat(ws): refactor WsClient to multi-engine connection pool
Supports connecting to multiple Data Engines simultaneously.
Each plugin resolves its own engine URL. Connections are lazily
opened on first subscription and cleaned up after a 30s grace
period when all plugins unsubscribe.
2026-04-16 17:20:11 +12:00
Antigravity AI b738072e05 feat(data): add resolveEngineUrl utility for multi-engine support 2026-04-16 17:19:42 +12:00
Antigravity AI 414ac3b194 feat(sdk): add streamUrl to ServerPluginConfig and DataSourceConfig 2026-04-16 17:19:20 +12:00
Antigravity AI f3b48ac302 refactor(data-engine): extract wwv-data-engine into standalone repo [Minor]
- Bump version to 1.11.0 [Minor]
- Remove wwv-data-engine code, docker-compose and package.json scripts [Patch]
2026-04-16 15:13:59 +12:00
SilvertakanaandAntigravity AI bea39455e6 feat(sanctions,conflict-zones): enable selection and hover intel for sanctioned countries and conflict zones [Minor] (#28)
- Attach _wwvEntity to Resium Entity refs via bindWwvEntity() so InteractionHandler picks them [Minor]
- Build synthetic GeoEntity payloads from static ConflictZone data for conflict-zones plugin [Minor]
- Add sanctions-specific hover fields (country, severity, OFAC count) to EntityInfoCard [Minor]
- Add conflict zone hover intel (escalation score, status, trend) to EntityInfoCard [Minor]
- Bump wwv-plugin-international-sanctions 1.0.0 → 1.1.0 [Minor]
- Bump wwv-plugin-conflict-zones 1.0.0 → 1.1.0 [Minor]
- Bump root 1.9.1 → 1.10.0 [Minor]

Closes #27

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 15:01:17 +12:00
Antigravity AI 1a984251b6 chore(core): update configurations and roadmap [Patch]
- set default edition back to local in .env [Patch]

- add AI & Sharing feature stage to ROADMAP [Patch]

- configure workspace limits in tsconfig and rootDir for osm-search [Patch]

- add superpowers documentation for expanding chips and plugin versioning [Patch]
2026-04-16 01:26:00 +12:00
SilvertakanaandAntigravity AI 67ca2abdbc feat: configure demo defaults via env vars (#26)
* feat(core): configure default demo plugins via env vars [Minor]

- parse NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS in AppShell [Minor]

- inject defaultEnabled in layersSlice initLayer [Patch]

- document demo defaults in .env.example [Patch]

* fix(core): enable plugin polling on boot and fix gps ID string [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 01:20:05 +12:00
SilvertakanaandAntigravity AI b10e7d0a7f fix(core): resolve generic TS errors and update type definitions across plugins [Patch] (#24)
- add npx prisma generate to CI action before type checks [Patch]

- fix missing globSync import in workspace type tests [Patch]

- fix GlobeView undefined indexing for entity rendering [Patch]

- fix OSMSearchPlugin zoom property to flyToBaseDistance [Patch]

- allow getSidebarComponent to accept an optional plugin prop [Patch]

- map categories for embassies and spaceports [Patch]

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 00:57:03 +12:00
SilvertakanaandAntigravity AI 6be56b9966 feat: Expand OSM Search Plugin with curated chips and live Taginfo autocomplete (#23)
* feat(osm-search): expand quick preset tags with OSINT categories

* feat(osm-search): add live Taginfo autocomplete for unlisted tags

* chore: bump version to 1.2.0 for osm autocomplete feature

* fix(osm-search): align tsconfig to prevent TS6059 in CI

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 00:23:44 +12:00
SilvertakanaandAntigravity AI 4951a2d047 feat(osm-search): implement OSM Search plugin with Bellingcat-style proximity (#21)
* feat(osm): setup plugin shell and state

* feat(osm): implement locking b-box overlay

* feat(api): overpass dumb proxy

* feat(osm): implement sidebar and search query builder

* feat(osm): register osm search plugin

* feat(osm-search): implement OSM Search plugin with Bellingcat-style proximity [Minor]

- implement @worldwideview/wwv-plugin-osm-search package [Minor]
- add Next.js proxy route for Overpass API with mirror fallback [Patch]
- implement real-time bounding box selection with dynamic updates [Patch]
- implement advanced proximity intersection mode using 'around' queries [Minor]
- fix core rendering issues (visibility, depth-test, eyeOffset) [Patch]
- refactor viewer initialization for instant plugin loading [Patch]
- align Cesium/Resium versions and fix JSDOM localStorage tests [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-15 17:04:05 +12:00
SilvertakanaandAntigravity AI 3fa1aeb80c chore: update repo tooling (#19)
* chore(core): add ci workflow and update gitignore [Patch]

- add github actions CI pipeline [Patch]

- update gitignore for scripts and IDEs [Patch]

* chore(core): add worktree testing script [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-15 01:06:52 +12:00
SilvertakanaandAntigravity AI c6b27a6079 feat: Conditional loading of Google 3D Tiles via custom API key (#15)
* feat(core): conditionally load Google 3D Tiles via custom API key [Minor]

- change default baseLayerId to bing-aerial [Patch]
- useViewerInit skips Google 3D layer unless key present [Minor]
- add reload prompt to ApiKeysTab on Google Maps key save [Patch]

* fix(map): implement persistent user layer intent and ui fallback highlighting

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-15 00:56:10 +12:00
SilvertakanaandAntigravity AI c8c619210f chore: update repo tooling and worktree testing (#17)
* chore(core): add ci workflow and update gitignore [Patch]

- add github actions CI pipeline [Patch]

- update gitignore for scripts and IDEs [Patch]

* chore(core): add worktree testing script [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-15 00:13:07 +12:00
SilvertakanaandAntigravity AI 01f923b806 chore: change pull_request to pull_request_target for fork PR security scopes (#16)
Co-authored-by: Antigravity AI <[email protected]>
2026-04-14 22:25:06 +12:00
111r1ck 487cb46f03 feat: implement USGS earthquakes layer pipeline (#12) 2026-04-14 22:12:01 +12:00
d05f93e610 chore: add agentic Claude workflow comment to globals.css (#7)
* chore: add agentic Claude workflow comment

Add a marker comment at the top of src/app/globals.css documenting
the active agentic Claude workflow as of April 2026.

Co-Authored-By: Claude Haiku 4.5 <[email protected]>

* chore: duplicate agentic Claude workflow comment at top of globals.css

Co-authored-by: Silvertakana <[email protected]>

* fix(data-engine): restore Prisma schema URL and fix TypeScript strict mode error [Patch]

- Restore url = env("SUPABASE_DATABASE_URL") to prisma/schema.prisma (regressed in 76243e0)
- Delete invalid prisma.config.ts that Prisma cannot parse
- Fix TS18046 strict mode error in seeders/cyberAttacks.ts by narrowing unknown error type
- Bump version to 1.2.1

---------

Co-authored-by: Antigravity AI <[email protected]>
Co-authored-by: Claude Haiku 4.5 <[email protected]>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Silvertakana <[email protected]>
2026-04-14 18:13:12 +12:00
Silvertakana 701b7b3b23 Merge pull request #5 from silvertakana/add-claude-github-actions-1776077011251
Add Claude Code GitHub Workflow
2026-04-14 11:51:37 +12:00
Antigravity AI 1eff015bbb Add symlink from claude.md to agents.md 2026-04-13 22:49:26 +12:00
Silvertakana 84129f1d9e "Claude Code Review workflow" 2026-04-13 22:43:36 +12:00
Silvertakana 60dbc5af66 "Claude PR Assistant workflow" 2026-04-13 22:43:34 +12:00
Antigravity AIandClaude Sonnet 4.6 8abc2ea2ef chore(repo): add /tmp/ to .gitignore for credential safety [Patch]
- prevent accidental commits of temporary credential files stored in /tmp/

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-12 22:39:42 +12:00
Antigravity AIandClaude Sonnet 4.6 76243e08c0 feat(core): custom entity camera tracking, shared plugin libs, GDELT civil unrest [Minor]
- add HeadingPitchRoll-based camera tracking with smooth zoom easing for locked entities [Minor]
- add high-res playback timing in AnimationLoop with store-throttled UI updates [Minor]
- add wwv-lib-aviation, wwv-lib-facilities, wwv-lib-incidents shared base class libraries [Minor]
- refactor plugins to extend shared base classes (airports, aviation, military, facilities) [Patch]
- migrate civil unrest seeder from ACLED to GDELT API [Minor]
- expand international sanctions seeder with full entity coverage [Patch]
- fix all workspace:* dependency references across monorepo package.json files [Patch]
- fix WebGL vertex buffer rewrite at 60fps by removing per-frame trail position reassignment [Patch]
- update AGENTS.md with dev commands, Docker volumes, and Claude Code context [Patch]
- remove database-incident-recovery-procedures skill [Patch]

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-12 22:37:31 +12:00
Antigravity AI 57d6bbbe02 fix(data-engine): revert ACLED API base URL to correct endpoint [Patch]
* Reverted ACLED API base URL to api.acleddata.com
* Kept OAuth token logic
* Version bumped to 1.1.5
2026-04-09 23:16:58 +12:00
Antigravity AI e1910011aa fix(data-engine): update ACLED seeder to use OAuth flow and bump version to 1.1.4 [Patch]
* Replaced ACLED_API_KEY with ACLED_PASSWORD in .env.example
* Refactored fetchAllACLEDEvents to request OAuth tokens since API keys are deprecated
* Updated ACLED base URL to the latest endpoint
2026-04-09 23:05:44 +12:00
Antigravity AI f81d9315e0 chore(civil-unrest): revert data engine polling schedule to daily 2026-04-09 22:55:28 +12:00
Antigravity AI 48cf43e68d chore(civil-unrest): adjust data engine polling to every 12 hours 2026-04-09 22:51:36 +12:00
Antigravity AI f30a539ebf chore(civil-unrest): increase frontend polling interval to 12 hours 2026-04-09 22:49:36 +12:00
Antigravity AI 57a602eb60 chore(civil-unrest): bump version to 1.1.0 for ACLED integration 2026-04-09 22:38:51 +12:00
Antigravity AI a2c8dd2f55 feat(civil-unrest): update frontend plugin for real ACLED data fields 2026-04-09 22:38:24 +12:00
Antigravity AI f272a9a617 feat(civil-unrest): enable ACLED civil unrest seeder 2026-04-09 22:37:54 +12:00
Antigravity AI 8fe71c637d feat(civil-unrest): replace mock seeder with ACLED API integration 2026-04-09 22:37:27 +12:00
Antigravity AI aee5154eaf feat(civil-unrest): add ACLED API env vars to .env.example 2026-04-09 22:36:38 +12:00
Antigravity AI ae8c422c2f fix(globe): Resolve 3D model entity LOD highlighting and label visibility
fix(data-engine): Prevent core engine crash when Supabase Postgres is unreachable (fallback to SQLite cache)
2026-04-09 19:15:37 +12:00
Antigravity AI e61928b2a1 docs(agents): add database incident recovery skill and migration rules 2026-04-09 18:34:58 +12:00
Antigravity AI 7749804365 chore(repo): hygiene, issue templates, and security scrubbing
- fix: scrub hardcoded AUTH_SECRET from public .env file
- docs: revamp README.md with OSINT and plugin quickstart guides
- feat: add GitHub Issue Templates (Bug, Feature, Plugin)
- chore: establish /local-scripts/ sandbox and remove root clutter
- chore: enforce rule 5.8 for Workspace Hygiene in AGENTS.md
- chore: bump version to 1.6.6
2026-04-09 18:31:09 +12:00
Antigravity AI c115058008 feat: add AdUnit component, undersea cable API route, GitHub issue templates, and update documentation 2026-04-09 16:07:30 +12:00
Antigravity AI 86c97ec191 fix(ads): add test mode attribute to bypass live bidding delays 2026-04-09 12:27:34 +12:00
Antigravity AI b5b925dd06 fix(globe): gracefully respond to Google 3D Tiles 404 errors by adding fallback to OsmBuildings
perf(config): drastically reduce Google Maps Tile API costs by caching more and bumping tile load tolerances
2026-04-09 12:25:05 +12:00
Antigravity AI 7488677f7a fix(wwv-data-engine): fix TS18046 error in strict mode and fastify typings 2026-04-09 00:09:03 +12:00
Antigravity AI 14a8bf5369 fix(core): disable satellite clustering and fix ws snapshot parsing 2026-04-08 23:28:21 +12:00
Antigravity AI 96e4a1c591 feat(gps-jamming): implement h3 hexagon grid visualization 2026-04-08 23:26:31 +12:00
Antigravity AI 6cb6dfd1d6 fix(maritime, cables): resolve trail rendering and missing generic paths 2026-04-08 23:25:26 +12:00
Antigravity AI c31871b321 feat(surveillance-satellites): UI parity and cone rendering implementation
- feat(wwv-plugin-sdk): add disableClustering entity option [Minor]

- feat(surveillance-satellites): implement dynamic SVGs, depth culling suppression, and filter engine definitions for UI parity [Minor]

- feat(globe): enable frustum cone sensor footprint hook for surveillance-satellite plugin class [Minor]
2026-04-08 23:20:41 +12:00
Antigravity AI 245118412f feat(cyber-attacks): rewrite plugin for AlienVault OTX threat intelligence 2026-04-08 22:58:39 +12:00
Antigravity AI a75a4f0f9a feat(data-engine): add cyber attacks history route for timeline playback 2026-04-08 22:56:28 +12:00
Antigravity AI f8664d8255 feat(data-engine): replace mock cyber attacks with AlienVault OTX feed 2026-04-08 22:54:14 +12:00
Antigravity AI dad91079b2 feat(data-engine): add geoip-lite helper and db index for cyber attacks 2026-04-08 22:47:34 +12:00
Antigravity AI 273112424c chore(ads): add public ads.txt file and CSS for AdSense requirement
- chore(ads): add Google AdSense publisher verification file
- fix(ui): adjust DemoAdStrip rendering styles
- chore(release): bump package version to 1.5.4
2026-04-06 22:19:05 +12:00
Antigravity AI 9cc51f483a fix(globe): resolve ship trail culling logic and primitive processor bugs
- fix(maritime): fix ship trail rendering and missing paths
- refactor(core): optimize chunked processor evaluation loops
- chore(release): bump package version to 1.5.3
2026-04-06 22:19:04 +12:00
Antigravity AI 0adef65616 docs(agents): strictly update versioning workflow constraints
- Require SemVer level tracking per individual change
- chore(release): bump package version to 1.5.2
2026-04-06 22:19:03 +12:00
Antigravity AI 5b2b8a0a8d fix(feedback): increase screenshot capture delay to prevent native UI ghosting 2026-04-06 19:57:29 +12:00
Antigravity AI f33e7efb8d feat(diagnostics): add multi-screenshot and global log catcher to feedback system 2026-04-06 11:10:44 +12:00
Antigravity AI 425dcbbc8e fix(camera): bypass auth on demo mode proxy and fix thumbnail mixed-content 2026-04-06 10:56:12 +12:00
Antigravity AI 484104a2b0 feat: add user feedback popup dialog to DataConfigPanel
Added a new FeedbackDialog component with state managed via uiSlice. Also updated AGENTS.md to enforce SemVer during our agentic workflow commits.
2026-04-06 10:22:06 +12:00
Antigravity AI 7e34ab6da0 fix(data-engine): resolve SQLite query timeout and 500 error in aviation/maritime routes
Removed expensive SQLite history trails from lookback REST paths since the frontend only uses lookback for freshness filtering on the Redis snapshot. Added ts-only indexes for playback queries and a daily data retention pruning job to prevent unbounded table growth.
2026-04-06 10:20:58 +12:00
Antigravity AI 5b45d79790 fix(deploy): map wwv-data-engine to coolify proxy network 2026-04-06 01:44:19 +12:00
Antigravity AI 7684d23398 fix(deploy): fix Coolify Next.js env var inlining, CSP, and Analytics 2026-04-06 01:33:20 +12:00
Antigravity AI a5610f0c8d feat(core): plugin stability fixes, UI enhancements, and ad integration 2026-04-05 21:03:06 +12:00
Antigravity AI 4d178544e5 fix(layout): adjust mobile header logo and search bar shrink behavior 2026-04-05 19:16:42 +12:00
Antigravity AI 8a58f4a732 fix(ads): handle unfilled layout, remove extra label, and add adsense verification tag 2026-04-05 19:02:52 +12:00
Antigravity AI 026eaae074 fix(components): track missing properties directory 2026-04-05 14:34:13 +12:00
Antigravity AI 6515b43711 fix(build): remove rootDir from plugin tsconfig to resolve TS6059 2026-04-05 14:24:49 +12:00
Antigravity AI 94a0ca4731 feat(demo): implement structural AdSense sidebar for demo environments 2026-04-05 13:50:18 +12:00
Antigravity AI de60ed3ffe perf(build): optimize Next.js docker build memory limits 2026-04-05 12:21:50 +12:00
Antigravity AI f5898b253a fix: Sync pnpm-lock.yaml and bypass Prisma CLI interactive prompts in Docker 2026-04-05 11:25:32 +12:00
silvertakana 561a44fe77 fix(build): ensure prisma client is generated in wwv-data-engine production stage 2026-04-04 13:00:54 +13:00
silvertakana b431fc526a fix(build): exclude plugin backends and data engine from next js typescript compilation 2026-04-04 12:26:28 +13:00
silvertakana 3deefc9607 fix(build): remove disabled mock plugins from transpilePackages 2026-04-04 10:03:16 +13:00
silvertakana 20363d509b feat(plugins): disable mock data plugins for live demo, bump to 1.2.0 2026-04-03 20:48:02 +13:00
silvertakana 134c3a5443 chore: bump version to 1.1.0 and restrict backend scripts to wwv-data-engine 2026-04-03 17:43:53 +13:00
silvertakana ab4cb2553a feat(plugins): implement international sanctions plugin and seeder 2026-04-03 17:42:20 +13:00
silvertakana 3bc3b3461f feat(plugins): implement cyber attacks plugin and seeder 2026-04-03 17:36:14 +13:00
silvertakana 11a75b6458 feat: implement military aviation plugin and data engine integration with adsb.fi polling and storage 2026-04-02 23:10:39 +13:00
silvertakana 62b8436353 feat(websocket): instantly push live cached snapshot to frontend upon successful subscription 2026-04-02 22:18:29 +13:00
silvertakana 875eda7ea2 fix(globe): resolve dynamic spiderifier clustering flicker and add mobile sizing responsive layout 2026-04-02 22:18:21 +13:00
silvertakana 82246daab0 fix(data-engine): properly copy seedData into production image 2026-04-02 21:38:04 +13:00
silvertakana 7513ff9dfa fix(data-engine): move fallback seed out of docker ignored namespace to enable self healing in coolify 2026-04-02 21:29:34 +13:00
silvertakana 96b032c2d0 perf(redis): fix maritime interval leak and batch snapshots to 15s 2026-04-02 21:12:12 +13:00
silvertakana de4f77d250 fix: exposing port 5001 for wwv-data-engine 2026-04-02 20:46:31 +13:00
silvertakana 7c59ba4dc3 fix(deploy): resolve docker context bloat and fix data engine ESM imports 2026-04-02 20:25:44 +13:00
silvertakana 951e070466 fix(redis): remove HSET pipelining for setLiveSnapshot 2026-04-02 18:12:11 +13:00
silvertakana adadce06b1 fix: remove prisma/config wrapper dependency to prevent Next standalone docker container from crashing 2026-04-02 15:32:35 +13:00
silvertakana 2341409bb4 fix: remove dotenv/config from prisma config causing container runtime crashes 2026-04-02 15:12:01 +13:00
silvertakana 7fee8e9fcf chore: remove accidentally tracked node_modules from workspace packages 2026-04-02 14:52:21 +13:00
silvertakana 682c21296c fix(docker): remove redundant node_modules copy, fix prisma generate env, fix hydrate script typings 2026-04-02 13:46:01 +13:00
silvertakana aec6f20edc chore: optimize dockerfiles for faster deployments via layer caching and BuildKit 2026-04-02 12:31:14 +13:00
silvertakana c89b55884f chore: migrate data engine to port 5001 and expose via docker-compose 2026-04-02 11:49:21 +13:00
silvertakana ded3ae9416 fix(docker): inject pnpm workspaces to build step 2026-04-01 22:55:39 +13:00
silvertakana 0808326967 feat: consolidate backends into dual-tier data engine 2026-04-01 22:43:58 +13:00
silvertakana 889bd5aade fix(iranwarlive): switch default api fetch url to use public tracking domain directly 2026-04-01 16:54:12 +13:00
silvertakana a17aafa6f6 feat(deployment): prefix iranwarlive routes and shift internal port to 5001 2026-04-01 16:21:39 +13:00
silvertakana 18da3a492c fix(deployment): resolve backend port collision by proxying traffic through next.js rewrites 2026-04-01 15:49:55 +13:00
silvertakana 2fd3f84b2f fix: add jose as explicit dependency for Docker build 2026-04-01 14:43:40 +13:00
silvertakana 68d350572f fix: use Next.js-provided webpack instance instead of direct import 2026-04-01 14:36:42 +13:00
silvertakana 7660e707f7 fix: commit missing IranWarLive backend files for deployment 2026-04-01 14:25:34 +13:00
silvertakana f510c7de34 feat: enhance globe visuals, clustering, and add IranWarLive plugin
Changes include:
- Style spiderifier background circles and fix clipping
- Implement horizon occlusion mapping for datapoints
- Stabilize spiderifier grouping persistence and smooth zooming scaling behavior
- Format intel panel timestamps and selection box UI
- Add backend and plugin for IranWarLive data scraping and historical events
2026-03-31 23:10:07 +13:00
silvertakana 35e9e7d70d fix(video): add balticlivecam.com as known video platform provider 2026-03-31 22:37:06 +13:00
silvertakana 74f3793313 fix(globe): make dynamic stack clustering update instantly on zoom without debounce 2026-03-31 13:34:12 +13:00
silvertakana 913e25ccac Feat: Add multi-touch pinch-to-zoom and pan support for mobile devices 2026-03-31 13:26:42 +13:00
silvertakana 2ec151c68b Feat: Add zoom/pan support for popped-out images 2026-03-31 13:19:23 +13:00
silvertakana cf49eef883 Style: Overlay popout button on top of intel images 2026-03-31 13:14:47 +13:00
silvertakana b56dacf04f Feat: Add support for popping out photos in IntelTab to floating windows 2026-03-31 13:05:26 +13:00
silvertakana 22bb77492e Fix: Make DataConfig panels scrollable 2026-03-31 12:27:41 +13:00
silvertakana ca1447f26a feat(globe): Dynamic camera-distance based icon clustering 2026-03-30 23:05:29 +13:00
silvertakana 7f1bf00ef7 feat: display timestamp, type, and casualties in entity hover card 2026-03-30 19:36:54 +13:00
silvertakana aeb9ddb96b fix: immediately request scene render when selection anchor state changes 2026-03-30 19:32:37 +13:00
silvertakana 3852e1175d feat: hide boxed reticle when camera is locked to entity 2026-03-30 19:21:39 +13:00
silvertakana 1474e28de0 feat: add boxed reticle effect for selected entities 2026-03-30 19:16:40 +13:00
silvertakana 8a5ace61b2 feat(security): apply marketplace admin registry remediations
- Use timingSafeEqual for demo admin secret (C1)
- Add isDemoAdmin session check to mutating marketplace routes (H2)
- Overwrite plugin trust blindly during install to prevent bypass (M2)
- Add rate limiting and CORS to disabled-builtins endpoint (H1)
- Reduce marketplace JWT expiry to 4h and implement JTI checking (H3)
- Drop private IP space from grant-token redirect allowlist (M3)
- Demote Bearer token parsing strictly to startsWith+slice (L4)
- Strip dataSource.headers on load endpoint for anon demo traffic (M4)
- Document LB trust considerations for IP rate limiting header extraction (M1)
2026-03-30 14:42:24 +13:00
silvertakana 932713e7a2 docs: sync public docs to current implementation
- SETUP.md: npm  pnpm, remove internal .agents/ from folder tree, replace webpack HMR note with DB tip
- ARCHITECTURE.md: fix 'Abstration' typo
- creating-a-plugin.md: replace 'edit knownPlugins.ts' step (internal) with correct npm submission flow, npm  pnpm commands, update flow diagram to match actual marketplace arch
2026-03-30 14:17:15 +13:00
silvertakana 50228a43c8 chore: update Dockerfiles to use pnpm for installation 2026-03-29 22:33:00 +13:00
silvertakana 326c69e92f fix(globe): default all entities to depth-tested (disableDepthTestDistance: 0) 2026-03-28 18:49:29 +13:00
silvertakana e3225d4dab fix(globe): enable depthTestAgainstTerrain and use disableDepthTestDistance: 0 for aviation 2026-03-28 18:37:23 +13:00
silvertakana 23d1538ea2 fix(globe): enable depth testing for airplanes to prevent rendering through globe 2026-03-28 18:27:52 +13:00
silvertakana 5f89715ee6 fix(plugins): enable click-to-filter for aviation and wildfire bands 2026-03-26 23:13:35 +13:00
silvertakana 22f22ead37 feat(plugins): implement getLegend in maritime, military-aviation, and wildfire plugins 2026-03-26 22:56:12 +13:00
silvertakana 5eff117972 feat(ui): implement legend API and interactive layer filtering via Intel Tab 2026-03-26 22:50:47 +13:00
silvertakana b92e5b3683 feat: add satellite tracking plugin 2026-03-26 22:24:04 +13:00
silvertakana b79f0f025d docs: update all setup instructions to use npm run setup 2026-03-26 17:45:42 +13:00
silvertakana f40615ee21 feat: add npm run setup to auto-generate .env.local for local hosting
- scripts/setup.mjs: generates .env.local from .env.example with a
  randomly generated AUTH_SECRET; skips if .env.local already exists
- package.json: adds 'setup' script as the first command new users run
- .gitignore: un-ignores scripts/setup.mjs while keeping rest of /scripts/ private
2026-03-26 17:41:59 +13:00
silvertakana 222ae0950e fix: make env_file optional for Coolify Docker Compose deployments 2026-03-26 17:30:33 +13:00
silvertakana afe89f8c0e fix: add VOLUME declaration for /app/data for Coolify/Dockerfile deployments 2026-03-26 17:29:02 +13:00
silvertakana 867e495353 fix: pass AUTH_SECRET to Docker and always run migrations on startup
- docker-compose.yml: inject AUTH_SECRET (fail-fast), WWV_DEMO_ADMIN_SECRET,
  and WWV_BRIDGE_TOKEN from host environment so JWT sessions survive restarts
- docker-entrypoint.sh: always run prisma migrate deploy (idempotent) instead
  of skipping when the DB file already exists; removes dead DB_PATH variable
- .env: document AUTH_SECRET as required for Docker deployments
- .env.example: add AUTH_SECRET field with generation instructions
2026-03-26 17:20:10 +13:00
silvertakana 6263f7766b fix(favicon): use Next.js native app/icon.svg to fix Docker cache 2026-03-26 17:00:25 +13:00
silvertakana d65600786f fix(docker): future-proof Prisma + Next.js standalone setup
- Add prisma package to serverExternalPackages in next.config.ts
- Replace manual node_modules cherry-picking with full production install
- Copy pre-built node_modules from deps stage and prune dev dependencies
- Ensures all Prisma CLI runtime dependencies are always available
2026-03-26 16:42:03 +13:00
silvertakana a3a04d84c0 fix: Resolve React update depth sequence errors 2026-03-26 15:36:31 +13:00
silvertakana f295609ea2 feat: Update header styling to match new design requirements 2026-03-26 15:36:31 +13:00
silvertakana 80064996e9 chore: Install favicon and update logos 2026-03-26 15:36:31 +13:00
silvertakana 973bef6386 UI: add hover delay to Tooltip component 2026-03-26 15:27:17 +13:00
silvertakana 4e2287aa5f UI: use React Portal Tooltip component for unverified plugin icon to fix clipping 2026-03-26 15:25:56 +13:00
silvertakana 17b8c7bb62 UI: add fast custom CSS tooltip to unverified plugin warning icon 2026-03-26 15:22:30 +13:00
silvertakana d10c68004a feat(docker): add persistent volume for sqlite db to retain installed plugins across restarts 2026-03-26 14:14:10 +13:00
silvertakana 10830efca5 UI: clean up plugin badges by showing simple warning icon for unverified plugins and removing category badge 2026-03-26 14:11:52 +13:00
silvertakana c3d9b2b536 feat: Introduce camera stream playback with mixed-content proxying and add a new volcanoes plugin. 2026-03-24 11:21:15 +13:00
silvertakana 3a04c64e79 perf(cesium): enable requestRenderMode, camera.changed sync, scratch allocs, GPU label fading
P0: Enable requestRenderMode for idle GPU savings (~50-90%)
P0: Switch camera sync from postRender to camera.changed w/ percentageChanged
P1: Stabilize sceneSettings with useMemo to prevent React re-renders
P1: Scratch HPR/Matrix4 in ModelManager and useModelRendering
P1: Add translucencyByDistance to labels for GPU-side fading
P2: Scratch Cartesian2 in searchPinAnimation
2026-03-22 14:38:33 +13:00
silvertakana eea424a826 fix: use dynamic lucide icon resolution for all 1700+ icons 2026-03-19 18:14:43 +13:00
silvertakana 4edcce2468 feat: add 5 static OSM plugins (volcanoes, airports, seaports, lighthouses, spaceports) 2026-03-19 16:00:22 +13:00
silvertakana d54d9a480c feat: skip auth on demo edition for marketplace/load so all visitors see installed plugins 2026-03-19 15:53:47 +13:00
silvertakana b7d76b5e58 fix: run prisma migrations at build time, remove runtime entrypoint 2026-03-19 15:36:59 +13:00
silvertakana e83e45e8b9 fix: use forwarded host headers for login redirect behind reverse proxy 2026-03-19 15:32:34 +13:00
silvertakana 86b7550c38 fix: skip database query on demo edition in setup-status 2026-03-19 15:15:29 +13:00
silvertakana 09b4b44c3e fix: pass --url flag to prisma migrate deploy to bypass TS config loading 2026-03-19 15:01:29 +13:00
silvertakana c6b26d20bc fix: add DATABASE_URL env and prisma deps to Docker runner stage 2026-03-19 14:40:52 +13:00
silvertakana 36ee84857b feat: DOD Phase 1 rendering optimizations
- Add color cache (getCachedColor) to eliminate per-entity Color.fromCssColorString allocations
- Add scratch Cartesian3 position to avoid heap alloc per entity in renderSingleEntity
- Add stable array cache (getStableAnimatables) to eliminate Array.from per render cycle
- Add renderEntity memoization (renderOptionsCache) for static entity options
- Refactor animation loop into dynamic/static batching for branchless iteration
- Extract modules: renderCaches.ts, animationHelpers.ts, primitiveOps.ts, renderOptionsCache.ts
- All files under 150 lines per project guidelines
2026-03-19 14:37:21 +13:00
silvertakana 25b19ec635 fix: update CSP headers to allow camera stream feeds from arbitrary origins
- Added http: https: to img-src for MJPEG camera streams and preview images
- Added http: https: to connect-src for HLS stream fetches
- Added media-src directive for video element sources
- Added frame-src directive for YouTube, Twitch, Vimeo, and other embed providers
- Fixes CSP violations that blocked camera plugin after npm plugin migration
2026-03-19 14:30:01 +13:00
silvertakana 614d3af796 fix: add error handling to setup-status and fix Dockerfile for Prisma 2026-03-19 14:28:12 +13:00
silvertakana bc05d93ce8 fix: add error handling to setup-status and fix Dockerfile for Prisma 2026-03-19 14:21:06 +13:00
silvertakana c0789f831c fix: externalize native modules and add prisma generate to Docker build 2026-03-18 23:11:16 +13:00
silvertakana 3be23a3ebc fix: resolve TypeScript build errors (NextRequest type, return type, Suspense boundary) 2026-03-18 23:05:53 +13:00
silvertakana abd40ede1b Merge branch 'main' of https://github.com/silvertakana/worldwideview 2026-03-18 22:54:07 +13:00
silvertakana c7d980390d feat: Add NEXT_PUBLIC_WWV_EDITION environment variable to configure the application edition. 2026-03-18 22:53:29 +13:00
Silvertakana aab5e39aa3 Merge feature/marketplace-integration into main
Merge feature/marketplace-integration into main - includes marketplace plugins, bug fixes, core globe rendering, and entity management
2026-03-18 22:50:53 +13:00
silvertakana 05bc8856f6 fix: report pluginManagementEnabled flag instead of spoofing edition 2026-03-18 22:43:27 +13:00
silvertakana 562a53e853 fix: report edition as local when demo admin is configured so marketplace allows connection 2026-03-18 22:26:37 +13:00
silvertakana 419744e64b fix: universal plugin management flag enable when demo admin secret is configured 2026-03-18 22:20:27 +13:00
silvertakana b008537694 fix: allow NextAuth to populate session on demo so auth() returns admin session 2026-03-18 22:16:11 +13:00
silvertakana 11919731d2 fix: skip unverified plugin dialog on demo admin already approved by installing 2026-03-18 22:13:20 +13:00
silvertakana 2a285312b0 feat: show ADMIN badge in header when demo admin is logged in, text input on demo login 2026-03-18 22:11:06 +13:00
silvertakana 027672d885 fix: use text input on demo login so admin username works without email validation 2026-03-18 22:08:50 +13:00
silvertakana e016342dea feat: session-based demo admin login via /login with admin credentials 2026-03-18 22:07:30 +13:00
silvertakana a56e2b6340 feat: allow operator plugin management on demo via admin secret header 2026-03-18 22:02:42 +13:00
silvertakana b1fa384476 fix: re-stamp trust at load time against live registry
Plugins installed while verified had stale trust values in the DB.
The load route now re-checks the registry so revoked plugins correctly
trigger the unverified warning dialog.
2026-03-18 18:31:57 +13:00
silvertakana efa886ad3e feat: signal pending state for unverified plugin installs
install-redirect returns ?pending=pluginId for unverified plugins
instead of ?installed, so the marketplace can show correct status.
2026-03-18 18:26:24 +13:00
silvertakana 3d25b2642a feat: enhance layer item UI with trust badges, category badges, and proper icon rendering
- Extract LayerItem component from LayerPanel for modularity
- Use PluginIcon component for proper Lucide SVG icon rendering (fixes raw text like 'Atom' showing instead of icon)
- Add trust badges (Official/Verified/Unverified) matching marketplace design
- Add category badges matching marketplace PluginCard style
- Move layer-item CSS from globals.css to dedicated LayerItem.css
2026-03-18 18:07:33 +13:00
silvertakana ca7125f3ac feat: server-side trust stamping and unverified plugin warning dialog 2026-03-18 17:13:04 +13:00
silvertakana c247e3dde0 fix: bypass auth on demo edition no login required
- proxy.ts: early return NextResponse.next() when isDemo
- auth.config.ts: authorized() returns true when isDemo
- Demo instance is now fully public as designed in the architecture
2026-03-18 16:45:27 +13:00
silvertakana a25d7ce09b feat: block demo instance from marketplace plugin operations
- Guard install-redirect, install, uninstall, grant-token routes with
  isPluginInstallEnabled check (returns 403 on demo edition)
- Expose edition field in setup-status endpoint for marketplace detection
2026-03-18 16:40:42 +13:00
silvertakana 1bbd97b382 security: remove legacy bridge token, add rate limiting to all marketplace endpoints 2026-03-18 16:05:51 +13:00
silvertakana 5999ef7d8d fix: align MilitaryPlugin ID with marketplace/npm name (military-aviation) 2026-03-18 15:45:47 +13:00
silvertakana a764eefcd8 fix: respect callbackUrl on login for marketplace redirect flow 2026-03-18 15:39:06 +13:00
silvertakana f2bd3fecfe feat: allow uninstalling built-in plugins via marketplace
- Add disableBuiltinPlugin/getDisabledBuiltinIds to repository
- Uninstall endpoint inserts 'disabled' marker for built-ins
- Status endpoint filters out disabled built-ins
- New /api/marketplace/disabled-builtins endpoint
- AppShell skips registering disabled built-in plugins
2026-03-18 15:35:24 +13:00
silvertakana ee5702f21e fix: report built-in plugins as installed in marketplace status endpoint 2026-03-18 15:21:27 +13:00
silvertakana c4e9dd3951 perf: optimize animation loop for 17k+ static entities
- Remove redundant JS frustum culling (Cesium handles natively via GPU)
- Static entities (no speed/heading) only horizon-culled every 30 frames
- Dynamic entities (aviation) still update per frame
- Cache animatables array to avoid per-frame allocation
- Use distanceSquared to avoid sqrt in hot path
2026-03-18 12:58:13 +13:00
silvertakana 2e928d2d64 feat: add changelog sections to all plugin READMEs, bump versions for npm publish 2026-03-18 12:48:32 +13:00
silvertakana 8ec9465274 feat: add lucide icon name lookup to PluginIcon + update scaffold script 2026-03-18 12:45:50 +13:00
silvertakana de40d79662 fix: resolve ghost data points by switching to synchronous entity rendering
The async chunked processor (renderEntitiesChunked) spread entity processing
across multiple requestAnimationFrame frames. When plugin polling triggered a
re-render mid-flight, the old run was cancelled but stale primitives remained
in the shared map, causing brief ghost point flashes.

Switch to synchronous renderEntities so all entities are processed atomically
in a single frame, eliminating the race condition.
2026-03-18 12:38:21 +13:00
silvertakana 853c173c37 feat: add embassies plugin (17266 diplomatic missions from OSM) 2026-03-18 12:06:22 +13:00
silvertakana fcef4d46fa rename: wwv-plugin-military wwv-plugin-military-aviation 2026-03-18 11:51:16 +13:00
silvertakana 3e8a54a541 feat: add nuclear facilities plugin (758 global sites from OSM) 2026-03-18 11:44:19 +13:00
silvertakana 5c97ceaa64 feat: add wwv-plugin-military-bases package for marketplace listing 2026-03-18 11:39:55 +13:00
silvertakana 9312c40862 feat: Add core globe rendering and entity management, implement login actions, update CSP, and ignore agents directory. 2026-03-18 11:19:15 +13:00
silvertakana 52a08dfd7b fix: correct GitHub username in package URLs (silveittakana -> silvertakana) and bump to v1.0.3 2026-03-18 11:17:52 +13:00
silvertakana fe1c80e798 docs: add README files to all plugin packages, bump to v1.0.2 2026-03-17 19:05:10 +13:00
silvertakana bce7da4006 chore: enhance plugin descriptions and metadata, bump to v1.0.1 2026-03-17 18:54:39 +13:00
silvertakana 534ccc03af docs: rewrite npm-plugin-publishing skill with OIDC, ops guide, troubleshooting 2026-03-17 18:13:55 +13:00
silvertakana 0736b7a051 chore: gitignore packages dist, remove tracked build artifacts 2026-03-17 18:12:22 +13:00
silvertakana c706d83009 chore: add tsconfig.json to plugin packages, update package.json for npm publish 2026-03-17 18:11:54 +13:00
silvertakana 6b3f351d38 ci: switch to OIDC trusted publishing, remove NPM_TOKEN dependency 2026-03-17 16:50:41 +13:00
silvertakana 62c333e99a chore: remove old plugin folders, fix FrustumRenderer import path 2026-03-17 16:43:50 +13:00
silvertakana e46096dd87 feat: restructure plugins into npm workspace monorepo with wwv-plugin-sdk 2026-03-17 16:37:04 +13:00
silvertakana 48c4045f84 feat: add rate limiting to sensitive API endpoints (keys, proxy, install, auth) 2026-03-17 16:32:04 +13:00
silvertakana c656c86baa fix: JWT user binding (sub/iss/aud), CSP headers, token via URL fragment 2026-03-17 16:25:44 +13:00
silvertakana 975c4b1d38 fix: security hardening - SSRF protection, auth gates, manifest validation, domain fixes 2026-03-17 16:17:04 +13:00
silvertakana 38fc546b12 fix: correct domain allowlists (.io → .dev), harden CORS fallback, fix test env vars 2026-03-17 13:30:17 +13:00
silvertakana 66f9d705d7 feat: add edition detection module (local/cloud/demo) 2026-03-17 12:41:37 +13:00
silvertakana 652aa3f94f chore: remove stale MVP files (Task, Implementation Plan, temp scripts) 2026-03-16 17:59:03 +13:00
silvertakana e6995e3a17 Merge branch 'main' of https://github.com/silvertakana/worldwideview into feature/marketplace-integration 2026-03-16 17:28:36 +13:00
silvertakana ba8d031d19 feat: track camera source type in analytics (default/traffic/url/file) 2026-03-16 15:26:46 +13:00
silvertakana 4d33d434c0 feat: add Umami analytics tracking across all UI components
- Add analytics utility (src/lib/analytics.ts) with null-safe trackEvent wrapper
- Add TypeScript declarations for window.umami (src/types/umami.d.ts)
- Migrate script tag to next/Script for hydration-safe loading
- Track 21 custom events across the platform:
  - UI: region-select, time-window-change, search-query, search-select,
    layer-toggle, panel-tab-switch, discord-link-click, view-mode-change,
    imagery-layer-change, filter-change, filter-clear, favorite-select,
    favorite-remove, panel-toggle
  - Behavioral: camera-move-end (2s debounce), platform-boot (with duration),
    entity-select, geojson-import, video-feed-open
  - Errors: plugin-error (centralized via PluginManager.onError)
2026-03-16 14:52:26 +13:00
silvertakana 350f70c34f Merge branch 'main' into feature/marketplace-integration
merge gitignore
2026-03-16 14:33:19 +13:00
silvertakana 0c54d6ca1d chore: gitignore generated prisma client and local database 2026-03-16 14:32:43 +13:00
silvertakana 9a92640469 Merge branch 'main' into feature/marketplace-integration
analytics
2026-03-16 14:27:41 +13:00
Silvertakana 44c05efd95 Update analytics script source to secure URL 2026-03-16 14:17:12 +13:00
Silvertakana b19ec0af6e Add script tag for umami tracking 2026-03-16 10:55:29 +13:00
silvertakana 0a3d7c96ea fix: grant-token endpoint + manage page token detection + load route filtering
- Add GET /api/marketplace/grant-token: issues marketplace JWT for users
  configuring instance URL from Manage page (no install required)
- Update GET /api/marketplace/load: skip trust:'built-in' plugins (already
  in AppShell) and invalid/empty manifests from legacy installs
- Fix CORS on GET /api/auth/setup-status (needed by marketplace Test Connection)
- Fix AUTH_SECRET variable name in marketplaceToken.ts (was NEXTAUTH_SECRET)
- Fix btoa Unicode error in InstallButton (unescape+encodeURIComponent)
- Fix bundle plugin manifests missing entry field in getInstallManifest()
- Add top-level try/catch in install-redirect route for better error handling
- Update artifacts/marketplace design doc to reflect current implementation
2026-03-15 19:36:10 +13:00
silvertakana 665ad5317c feat: marketplace token-on-redirect for cross-origin Manage page auth
- Add lib/marketplace/marketplaceToken.ts: issueMarketplaceToken() and
  verifyMarketplaceToken() using jose JWT signed with NEXTAUTH_SECRET,
  30-day expiry, scope:'marketplace' claim (stateless, no DB needed)
- Update lib/marketplace/auth.ts: validateMarketplaceAuth now accepts
  session OR marketplace JWT OR legacy bearer token (in that order)
- Update api/marketplace/install-redirect/route.ts: issue JWT on
  successful install and append ?token=<jwt> to redirect URL
- Add marketplaceToken.test.ts: 5 tests covering round-trip, tamper,
  wrong secret, and wrong scope (node environment for jose compat)
2026-03-15 18:15:10 +13:00
silvertakana 5ca9be2070 fix: proxy.ts uses getToken instead of Auth.js wrapper
- Renamed export to 'proxy' for Next.js 16 convention
- Uses getToken() from next-auth/jwt for session checks
- Avoids Auth.js authorized callback overriding setup/login exemptions
- Verified with curl: /setup=200, /=307/setup, status-api=needsSetup:true
2026-03-15 17:13:36 +13:00
silvertakana e6dc172871 feat: multi-account auth system (Auth.js v5 + Prisma)
- User model with bcrypt-hashed passwords and admin/user roles
- Auth.js v5 with Credentials provider + JWT sessions
- First-run /setup page creates admin account
- /login page with email+password
- proxy.ts middleware: redirects to /setup or /login for unauthenticated users
- API routes exempt (bridge uses token auth)
- AUTH_SECRET added to env
2026-03-15 16:52:14 +13:00
silvertakana 74d61f3e8c fix: add error logging to useMarketplaceSync for debuggability
- Log manifest count received from bridge
- Per-plugin try/catch with console.error instead of silent swallow
- Confirmed military-bases plugin hot-loads correctly
2026-03-15 16:07:19 +13:00
silvertakana 875e12cb22 fix: install route upserts instead of rejecting 409
- upsertPlugin: creates or updates installed plugin record
- Fixes re-install with updated manifest after prior empty-config install
- Updated tests for upsert behavior (14/14 pass)
2026-03-15 15:57:03 +13:00
silvertakana c773eacceb feat: hot-reload marketplace plugins + military bases GeoJSON data
- useMarketplaceSync hook: syncs installed plugins on window focus
- Replaces inline marketplace loading in AppShell
- public/data/military_bases.geojson for test plugin
2026-03-15 15:38:32 +13:00
silvertakana 91123ecc1b fix: add CORS support to bridge API routes + unit tests
- cors.ts: shared utility with origin allowlist, preflight handler, response wrapper
- Updated install, uninstall, status, and load routes with OPTIONS + withCors
- cors.test.ts: 7 tests covering headers, preflight, and response wrapping
- All 14 marketplace tests pass
2026-03-15 15:26:38 +13:00
silvertakana 51b7fe01d5 feat: add marketplace bridge API for one-click install
- POST /api/marketplace/install  record plugin install in Prisma DB
- GET /api/marketplace/status  list installed marketplace plugins
- POST /api/marketplace/uninstall  remove installed plugin record
- Token-based auth via WWV_BRIDGE_TOKEN env var
- Repository with full unit test coverage
2026-03-13 21:34:32 +13:00
silvertakana f98615e198 test: add unit tests for aviation Prisma repository 2026-03-13 21:07:10 +13:00
silvertakana 0d795bf5e8 feat: add Prisma ORM with SQLite for local database
- Add Prisma 7 with better-sqlite3 adapter
- Define schema: AviationHistory, InstalledPlugin, Setting
- Create data access layer (repository pattern)
- Migrate aviation history queries from Supabase to Prisma
- Auto-migrate on npm run dev via predev script
- Database auto-creates at data/wwv.db on first run
2026-03-13 21:04:14 +13:00
silvertakana 76b7fea27b feat: add plugin loader router to PluginManager 2026-03-13 19:01:21 +13:00
silvertakana 2e93b45927 feat: add StaticDataPlugin loader for GeoJSON plugins 2026-03-13 18:48:48 +13:00
silvertakana 8b7b4204b4 feat: add plugin.json manifests for all built-in plugins 2026-03-13 18:46:35 +13:00
silvertakana 5d62ce138a feat: add DeclarativePlugin loader for JSON-only plugins 2026-03-13 18:46:32 +13:00
silvertakana 706fde7610 feat: add plugin manifest types and validation 2026-03-13 18:43:39 +13:00
silvertakana 7db1980e0f fix: prevent Docker build failure during Next.js build traces
- Remove CopyPlugin from next.config.ts (was copying Cesium assets during
  webpack build, causing Next.js to trace thousands of files and OOM/timeout)
- Add outputFileTracingExcludes for public/cesium/**
- Copy Cesium assets via copy-cesium.mjs after build in Dockerfile instead
2026-03-13 15:35:23 +13:00
silvertakana 60a584d03f feat: Add military_bases.geojson containing global military installation data. 2026-03-13 11:45:21 +13:00
silvertakana 9f9e0fb81a style: use brighter military aircraft colors for visibility 2026-03-13 11:45:02 +13:00
silvertakana 665893ef80 feat: add military flight tracking plugin via adsb.fi 2026-03-13 11:28:51 +13:00
silvertakana f5ea9d6432 feat: add Discord invite link to Data Layers tab in left sidebar 2026-03-12 20:58:16 +13:00
silvertakana f4c420a665 feat: add alpha stage badge to header 2026-03-12 20:55:03 +13:00
silvertakana 6c6f44cc7e feat: Add stream utility functions for URL detection, YouTube embedding, and error messaging. 2026-03-12 19:28:07 +13:00
silvertakana c4f32ece18 feat: Introduce GlobeView component with Google 3D Tiles and integrate various camera data sources including GDOT, Caltrans, and TFL. 2026-03-12 19:04:47 +13:00
silvertakana 6cfef39e1b feat: add QUINTIC_IN_OUT easing to all camera flyTo calls for smoother start/end 2026-03-12 19:01:12 +13:00
silvertakana bccdc6aa26 feat: Add HLS stream playback support for traffic cameras (GDOT) 2026-03-11 19:42:53 +13:00
silvertakana fcdea75bdc feat: migrate to filtered GeoJSON camera feed and remove insecam system 2026-03-11 17:43:42 +13:00
silvertakana 9748d02820 feat: Add GeoJSON importer with dynamic per-import plugin registration 2026-03-11 16:20:40 +13:00
silvertakana 39c7324872 docs: add CONTRIBUTING.md, CODE_OF_CONDUCT.md, and GitHub issue/PR templates 2026-03-11 14:07:33 +13:00
silvertakana 53f4a02d07 feat: reactivate insecam with Supabase cache and stale-while-revalidate 2026-03-10 15:48:23 +13:00
silvertakana 3f6c9bf7c7 feat: Add core application UI components including AppShell, SearchBar, and FloatingWindow, alongside search history, API key management, and globe interaction hooks. 2026-03-10 11:50:07 +13:00
silvertakana 3df54a8c47 feat: Add location pin animation after search camera fly-to 2026-03-10 11:27:05 +13:00
silvertakana 1d90209d51 perf: replace requestIdleCallback with rAF and remove distance sort for instant point rendering 2026-03-10 11:20:19 +13:00
silvertakana f64d5a61ba feat: Add loading indicator spinner for data layers 2026-03-10 11:12:24 +13:00
silvertakana c995716d02 fix: increase data point tap size (8px desktop, 12px mobile) 2026-03-10 11:03:58 +13:00
silvertakana 899d23e2e5 feat: Integrate CesiumJS for 3D globe visualization and add supporting search and place detail functionalities. 2026-03-10 10:57:22 +13:00
silvertakana 59b0c638c7 feat(camera): add default source type that auto-loads cameras.json 2026-03-10 10:47:06 +13:00
silvertakana 9e8ea82480 fix: rotate credential immediately on any API failure, not just 429 2026-03-09 19:23:45 +13:00
silvertakana 3c516ff021 feat: expand search to support addresses, institutions, and landmarks 2026-03-09 19:22:10 +13:00
silvertakana e77626d84d feat: mobile HUD layout + borders imagery optimization
Mobile layout:
- Compact 'WWV' logo with persistent centered search bar
- Region + time bar attached flush below header (no gap)
- Collapsible camera stats notch (LAT/LON/ALT/HDG/FPS)
- Sidebar boot animation disabled on mobile (no flash-on-load)

Borders optimization:
- Replace Entity-based GeoJSON borders (200+ entities) with
  Bing Maps AERIAL_WITH_LABELS_ON_DEMAND imagery overlay
- GPU-rasterized tiles with near-zero CPU overhead
- Auto-disabled when using Google 3D Tiles mode
2026-03-09 18:57:48 +13:00
silvertakana 5f85a1d9e8 Merge branch 'main' of https://github.com/silvertakana/worldwideview 2026-03-09 18:31:10 +13:00
silvertakana 4845b72cc8 feat: add mobile-friendly responsive layout
- Add useIsMobile hook (768px breakpoint via matchMedia)
- Add exclusive mobile panel state (openMobilePanel) to uiSlice
- Condense header on mobile: logo + expandable search + LIVE badge
- Create MobileHudBar: scrollable region presets + time windows
- PanelToggleArrows: fixed to screen edges, exclusive toggle on mobile
- LayerPanel/DataConfigPanel: slide-in 80vw panels on mobile
- Hide CameraStatsPanel on mobile
- Comprehensive mobile CSS: 44px touch targets, compact timeline
- AppShell: conditionally render mobile components
2026-03-09 18:30:54 +13:00
Silvertakana 3522c7646f Merge pull request #1 from silvertakana/vercel/set-up-vercel-web-analytics-fo-4673vj
Set up Vercel Web Analytics for Next.js
2026-03-09 18:12:57 +13:00
Vercel 97188a9c64 Set up Vercel Web Analytics for Next.js
Implemented Vercel Web Analytics for Next.js App Router Project

Changes Made:
=============

1. Installed @vercel/analytics package
   - Added @vercel/analytics ^1.6.1 to dependencies in package.json
   - Updated package-lock.json with new dependency tree

2. Modified src/app/layout.tsx
   - Added import statement: `import { Analytics } from "@vercel/analytics/next";`
   - Added <Analytics /> component inside the <body> tag, after {children}
   - Preserved all existing code structure, including suppressHydrationWarning and CesiumJS styles

Implementation Details:
======================

This is an App Router Next.js project (using the app directory structure), so the Analytics component was added to the root layout file (src/app/layout.tsx) as per Vercel's official documentation.

The Analytics component was placed after {children} in the body tag to ensure:
- It doesn't interfere with page content rendering
- Analytics scripts load after the main content
- Follows Vercel's recommended placement pattern

Verification:
============

✓ Build completed successfully (npm run build)
✓ All tests passed (npm test) - 30 tests across 5 test suites
✓ TypeScript compilation successful
✓ No linting errors introduced

The implementation follows Next.js 16.1.6 best practices and preserves all existing functionality while adding comprehensive web analytics tracking.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-03-09 04:56:30 +00:00
silvertakana 90b9c029df feat: sci-fi HUD boot-up with optimized camera fly-in
- Implement staged HUD entrance animations (Header, Sidebars, Timeline)
- Add BootOverlay with orbital ring animation and flickering text
- Optimize LOD loading: camera starts at 10k km to pre-load tiles, then teleports to 60k km for smooth fly-in
- Fix panel toggle positioning by switching to pure opacity fades for controls with complex transforms
- Ensure UI toggles work post-boot by removing animation classes via 'boot-done' state
2026-03-09 17:01:03 +13:00
silvertakana c2722856d8 fix: add viewer.isDestroyed() guards to prevent hot-reload TypeError 2026-03-09 16:56:28 +13:00
silvertakana 1505b0902b fix: correct backward 3D model orientation and enable position interpolation for promoted models 2026-03-09 16:09:15 +13:00
silvertakana 83752b96c9 chore: add clientId to all credential rotation log messages 2026-03-09 15:57:04 +13:00
silvertakana 9db38cb0de fix: safer credential parsing (split on first colon only) 2026-03-09 15:54:58 +13:00
silvertakana 522e976739 feat: multi-account OpenSky credential rotation
- New credentials.ts: pool manager that parses OPENSKY_CREDENTIALS env
  var (comma-separated clientId:clientSecret pairs), tracks per-credential
  tokens and credits, auto-rotates when credits drop below threshold or
  on 429 responses. Falls back to legacy OPENSKY_CLIENTID/CLIENTSECRET.
- Simplified auth.ts to thin wrapper over credential pool
- Removed single-credential fields from state.ts (now per-credential)
- rate-limit.ts stores credits per-credential via pool
- polling.ts rotates credentials on 429
- Updated .env.example with OPENSKY_CREDENTIALS documentation
- Added credentials.test.ts (8 tests) and updated rate-limit.test.ts
2026-03-09 15:42:54 +13:00
silvertakana 19b521c5ca fix: hide entities during chunked loading to prevent terrain bleed-through
Entities were visible through the ground during async chunked rendering
because they were created with show:true (default) while the animation
loop (which handles horizon culling) only starts after loading completes.

Now primitives are created with show:false and the animation loop sets
show:true once they pass frustum + horizon culling checks.
2026-03-09 15:17:43 +13:00
silvertakana e8e2311422 feat(camera): disable insecam data source option 2026-03-09 15:13:13 +13:00
silvertakana 41e2413af4 feat: add OpenSky rate-limit header parsing and credit-aware adaptive polling
- New rate-limit.ts module: parses X-Rate-Limit-Remaining and
  X-Rate-Limit-Retry-After-Seconds headers, computes adaptive backoff
  based on remaining credits
- Updated state.ts: added creditsRemaining/retryAfterSec fields,
  changed base poll interval from 10s to 15s
- Updated polling.ts: integrates rate-limit header parsing on every
  response, uses server retry-after for 429 backoff, uses credit-aware
  adaptive scheduling
- Added rate-limit.test.ts: 9 unit tests covering header parsing,
  backoff computation, and edge cases
2026-03-09 15:12:59 +13:00
silvertakana a3e19cecef deploy: add Dockerfile for standalone Next.js deployment 2026-03-08 22:21:00 +13:00
silvertakana 62daafc4a0 chore: production disk sustainability - standalone output, remove fs cache 2026-03-08 19:29:54 +13:00
silvertakana 3f17dd21f8 docs: use actual github repository url 2026-03-08 14:05:35 +13:00
silvertakana 400ac5aa13 fix: match trail and camera lock-on to extrapolated aircraft position
- dataSlice: refresh selectedEntity when polling data arrives
- useSelectionAnchor: use CallbackProperty to read extrapolated posRef
  from animatables map so viewer.trackedEntity follows smoothly
- SelectionHandler: extend trail to extrapolated posRef tip
- GlobeView: pass animatablesMapRef to selection anchor and trail
2026-03-07 23:19:02 +13:00
silvertakana 83d329e407 feat(camera): add 3D frustum wireframe rendering for camera view cones
- frustumGeometry.ts: pure math module with haversine projection for
  4 corner points of the camera view pyramid
- FrustumRenderer.ts: Cesium Entity polyline management (4 side edges)
- useFrustumRendering.ts: React hook bridging renderer with viewer
- GlobeView.tsx: wire frustum hook into rendering pipeline
- cameraMapper.ts: default camera altitude to 8m above ground
- vitest.config.ts: include plugin tests in vitest glob
- 12 unit tests passing for geometry + cardinal direction parsing
- Architecture supports future ground-surface projection
2026-03-07 19:34:07 +13:00
505 changed files with 1064211 additions and 9213 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
# Database Migrations & Schema Modification Rules
## 1. Defensive Migrations
When making database schema changes, you must ensure that generated migrations are resilient against environmental discrepancies.
- **Review Generated SQL**: Always review the `.sql` files generated by `npx prisma migrate dev`.
- **Add "IF EXISTS" clauses**: SQLite and Prisma can sometimes produce brittle drop statements (`DROP INDEX "my_index"`). To prevent migrations from crashing if a state desynchronization occurs (e.g., the index was already dropped or never created), manually edit the migration file to use `DROP INDEX IF EXISTS "my_index";` or `DROP TABLE IF EXISTS "table_name";`.
- **Data Preservation**: When dropping columns or renaming, SQLite does not cleanly support it and requires table recreation. Carefully review the `INSERT INTO "new_table" SELECT ...` clauses to ensure data is correctly mapped.
## 2. Managing Failed Migrations
If a migration fails in production:
- **Never blindly mark as resolved**: Do not run `prisma migrate resolve --applied <migration_name>` unless you have explicitly verified that the database schema precisely matches the expected state.
- If you use `resolve --applied`, Prisma will permanently skip that migration in the future, leaving your database structurally out of sync with your Prisma Client.
## 3. Backups Before DDL
Never perform direct DDL operations (ALTER, DROP, CREATE) on a production database (via Prisma or direct SQLite access) without first confirming an automated backup exists, or manually taking a backup of the `wwv.db` file.
-95
View File
@@ -1,95 +0,0 @@
---
trigger: model_decision
description: This is an explanation of the purpose of the project
---
WorldWideView is best described as a modular, real‑time geospatial intelligence engine built on top of a CesiumJS 3D globe, designed to ingest live data streams, transform them through a plugin system, and render them as high‑performance visual layers. The repository you have open shows a Next.js application with a generalized plugin architecture and a Cesium viewer at its core .
🌍 What WorldWideView fundamentally is
WorldWideView is a real‑time situational awareness platform. It takes raw, fast‑moving geospatial signals—like aircraft positions, maritime AIS, satellite orbits, or any other sensor feed—and turns them into interactive, cinematic layers on a 3D globe. The system is built to be:
Modular, so each data source is a plugin.
High‑performance, using Cesium primitives instead of entities.
Extensible, allowing new data types without rewriting the core.
Real‑time, updating the globe smoothly as new data arrives.
Visual, using icons, arrows, and 3D models to represent moving objects.
It’s essentially your own open, customizable version of tools like SkyGlass, ADSBexchange 3D, or WorldView (Bilawal Sidhu’s demo), but engineered for long‑term scalability.
🧩 Core components of the system
Plugin system (your recent commits)
Your latest commit message—“generalize plugin system, remove aviation special treatment” —shows that the architecture now treats every data source as a plugin. This means:
Each plugin defines how it fetches, parses, and visualizes data.
The core engine doesn’t care whether the plugin is aviation, maritime, satellites, or something else.
You can add new intelligence layers without touching the core.
This is a major architectural milestone.
Cesium rendering engine
The project initializes a Cesium globe inside a Next.js app. Cesium handles:
Globe rendering
Camera control
Terrain and imagery layers
Worker‑based geometry processing
High‑performance primitives for thousands of objects
Your open tabs (Cesium picking performance, CZML, map type switching) show you’re actively tuning this layer.
Real‑time data ingestion
The system is designed to ingest live feeds such as:
ADS‑B aircraft positions
AIS maritime positions
Satellite TLE propagation
Custom sensor networks
Each plugin transforms raw data into Cesium‑ready primitives.
Visual representation
Your recent work on low‑poly aircraft icons and arrow models shows the platform is moving toward:
Lightweight, directional markers
Orientation‑aware icons
Smooth fly‑to tracking
Cinematic camera behavior
This is what gives the platform its “WorldView‑like” feel.
🚀 What makes WorldWideView unique
1. It’s modular from the ground up
Most geospatial dashboards hard‑code aviation or maritime logic. You’ve removed that. Any data source can become a plugin.
2. It’s built for performance
You’re migrating from Cesium Entities to Primitives, optimizing picking, and reducing GPU stalls—this is what allows thousands of objects to render smoothly.
3. It’s designed for real‑time intelligence
Not just visualization—actual situational awareness. The architecture supports:
live updates
event‑driven pipelines
time‑dynamic objects
replay capability (future feature)
4. It’s open and extensible
Unlike proprietary tools, your system can be extended by anyone who writes a plugin.
-12
View File
@@ -1,12 +0,0 @@
---
description: cesium
---
https://cesium.com/
https://cesium.com/platform/cesiumjs/
https://cesium.com/platform/cesiumjs/ion-sdk/
https://sandcastle.cesium.com/?id=czml
https://cesium.com/learn/cesiumjs-learn/
https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera/
https://cesium.com/learn/cesiumjs-learn/cesiumjs-geometry-appearances/
https://cesium.com/learn/cesiumjs-learn/cesiumjs-flight-tracker/
+1
View File
@@ -0,0 +1 @@
.agents
+25
View File
@@ -0,0 +1,25 @@
node_modules
**/node_modules
**/dist
**/.next
.git
# Database files at ANY depth
/data
packages/*/data
**/*.db
**/*.sqlite
**/*.sqlite3
**/*-journal
**/*.db-wal
**/*.db-shm
# Environment files
.env*
!*.env.example
# Non-build directories
artifacts/
performance/
tmp/
*.geojson
+15
View File
@@ -0,0 +1,15 @@
DATABASE_URL=file:./data/wwv.db
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=iranwarlive,satellite,gps_jamming
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
# Auth Secret (REQUIRED for Docker — generate with: openssl rand -hex 32)
# Must be stable across container restarts to preserve sessions.
# [WARNING] NEVER commit real secrets here. Real secrets must ONLY go into .env.local!
AUTH_SECRET=changeme_d64c1f35b447da89cf6ed5a0988da1379b21904edb91a87c3f5a63942e3d23a4_changeme
+50 -4
View File
@@ -1,15 +1,61 @@
# Environment Variables Example
# ============================================================
# .env — committed to git (non-secret defaults)
# ============================================================
# This file is tracked by git. Only put non-secret values here.
# Prisma reads DATABASE_URL from this file.
# Cesium Ion Access Token (Required for terrain and default imagery)
# Get your token at https://ion.cesium.com/
# Database (SQLite for local — zero config; PostgreSQL for cloud)
DATABASE_URL=file:./data/wwv.db
# ============================================================
# .env.local — NOT committed (secrets & API keys)
# ============================================================
# Copy everything below into a new file called .env.local
# .env.local is gitignored and overrides .env values.
# Auth Secret (REQUIRED — generate with: openssl rand -hex 32)
# Must remain stable across restarts to preserve sessions and tokens.
# For Docker: also set this in the host environment or a .env file
# at the project root so docker-compose can inject it.
AUTH_SECRET=
# Cesium Ion Access Token (optional — get one free at https://ion.cesium.com/)
NEXT_PUBLIC_CESIUM_ION_TOKEN=
# Bing Maps API Key (Optional, for high-res imagery)
# Get your key at https://www.bingmapsportal.com/
NEXT_PUBLIC_BING_MAPS_KEY=
# Supabase Configuration (Required for persistence and historical data)
# Supabase Configuration (Optional — cloud-only features)
# Found in your Supabase Project Settings > API
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_DATABASE_URL=
# OpenSky Network — multi-account credential rotation
# Comma-separated clientId:clientSecret pairs.
# Example: OPENSKY_CREDENTIALS=acct1-id:acct1-secret,acct2-id:acct2-secret
OPENSKY_CREDENTIALS=
# ACLED API — Civil Unrest & Conflict data (free for non-commercial use)
# Register at https://developer.acleddata.com/ to obtain credentials.
# Data is updated weekly (Mondays) with global protest, riot, and violence events.
ACLED_EMAIL=
ACLED_PASSWORD=
# Marketplace Bridge Token — shared secret for marketplace → WWV install requests
# Generate any random string, then set the same value in the marketplace instance config.
WWV_BRIDGE_TOKEN=
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
# Demo Admin Secret (demo edition only)
# Allows operator plugin management on the demo instance via x-wwv-admin-secret header.
# Generate any random string. Only set this on the demo deployment.
# WWV_DEMO_ADMIN_SECRET=
+29
View File
@@ -0,0 +1,29 @@
---
name: Bug Report
about: Create a report to help us improve WorldWideView
title: '[BUG] '
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots/Logs**
If applicable, add screenshots or console output to help explain your problem.
**Environment (please complete the following information):**
- OS: [e.g. Windows, macOS]
- Browser [e.g. chrome, safari, firefox]
- WorldWideView Edition [e.g. local, demo, cloud]
+19
View File
@@ -0,0 +1,19 @@
---
name: Core Feature Request
about: Suggest an idea for the core WorldWideView engine
title: '[FEATURE] '
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Note:** If this is about adding a new data source (like mapping vessels or plotting weather), please use the **Plugin Proposal** template instead! This template is for core engine features (like camera logic, filtering, or rendering pipeline upgrades).
+25
View File
@@ -0,0 +1,25 @@
---
name: Plugin Proposal
about: Suggest a new real-time data source plugin
title: '[PLUGIN] '
labels: plugin-idea, help-wanted
assignees: ''
---
**What data source do you want to add?**
Please provide a brief description of the intelligence data (e.g., Global Earthquakes, Shipping Vessels, Weather Radar, Local Train Networks).
**Is there an available API?**
Please link to any public or authenticated APIs that provide this data.
*(e.g., USGS Earthquake API: https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php)*
**What should the plugin render?**
- What kind of marker? (e.g., dots, icons, 3D models)
- Does it require historical tracking (paths), or just current position?
**Would you be interested in building this?**
- [ ] Yes, I'd like to try building it!
- [ ] No, just putting the idea out there.
*(Looking to build it yourself? Check out the [Build a Plugin in 5 Minutes](https://github.com/silvertakana/worldwideview#build-a-plugin-in-5-minutes) guide in the README!)*
+44
View File
@@ -0,0 +1,44 @@
## Summary
<!-- A short description of what this PR does and why. -->
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] New plugin
- [ ] Refactor / code quality
- [ ] Documentation
- [ ] Performance improvement
## Related Issue
Closes #<!-- issue number -->
## Changes Made
<!-- List the key changes. Be specific about files and modules affected. -->
-
-
## Testing
- [ ] I ran `npm test` and all tests pass
- [ ] I manually tested this in the browser against a live data source
- [ ] I added or updated tests for my changes
## Plugin Checklist (if applicable)
- [ ] Plugin is registered with `PluginRegistry`
- [ ] Plugin does not import or depend on core rendering logic directly
- [ ] Plugin cleans up Cesium primitives on unmount/disable
- [ ] No hardcoded credentials or API keys committed
## Screenshots / Recordings
<!-- If this changes the UI or globe rendering, include a screenshot or screen recording. -->
## Notes for Reviewer
<!-- Any context that would help the reviewer understand the approach or trade-offs. -->
+59
View File
@@ -0,0 +1,59 @@
name: CI
on:
pull_request:
branches: [main]
jobs:
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx prisma generate
- run: pnpm exec tsc --noEmit
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx prisma generate
- run: pnpm test
build:
name: Build
runs-on: ubuntu-latest
needs: [typecheck, test]
env:
DATABASE_URL: file:./data/wwv.db
AUTH_SECRET: ci-placeholder-secret-not-used-in-tests
NEXT_PUBLIC_WWV_EDITION: local
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx prisma generate
- run: pnpm build
+44
View File
@@ -0,0 +1,44 @@
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"
jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
+50
View File
@@ -0,0 +1,50 @@
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr *)'
+38
View File
@@ -0,0 +1,38 @@
name: Publish Plugin to NPM
on:
push:
tags:
- "wwv-plugin-*-v*" # e.g. wwv-plugin-aviation-v1.0.1
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for OIDC trusted publishing (no NPM_TOKEN needed)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Detect package name from tag
id: pkg
run: |
TAG="${{ github.ref_name }}"
# Strips the -vX.Y.Z suffix: "wwv-plugin-aviation-v1.0.1" → "wwv-plugin-aviation"
PKG=$(echo "$TAG" | sed 's/-v[0-9].*//')
echo "package=$PKG" >> $GITHUB_OUTPUT
echo "Publishing: $PKG"
- name: Build package
run: npm run build -w packages/${{ steps.pkg.outputs.package }}
- name: Publish to NPM (OIDC)
run: npm publish packages/${{ steps.pkg.outputs.package }} --access public --provenance
+42 -1
View File
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
node_modules/
/.pnp
.pnp.*
.yarn/*
@@ -17,12 +17,37 @@
/.next/
/out/
# agents
/.agents/
# claude code IDE config
/.claude/
/.cline/
# performance
/performance/
# artifacts
/artifacts/
# scripts (tracked, but temporary scratchpads should go in /local-scripts/)
# local database
/data/
packages/*/data/
*.db
*.sqlite
*.sqlite3
*.db-shm
*.db-wal
# temporary files and credentials
/tmp/
# generated prisma client
/src/generated/
# production
/build
@@ -38,6 +63,7 @@ yarn-error.log*
# env files (can opt-in for committing if needed)
.env*
!.env
# vercel
.vercel
@@ -45,3 +71,18 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
# Plugin build artifacts
packages/*/dist/
# Reference Reference Codebases
/worldmonitor/
# Developmental scripts & temporary sandbox
/local-scripts/
# git worktrees
/.worktrees/
# proprietary extracted services
packages/wwv-data-engine/
+36
View File
@@ -0,0 +1,36 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "pnpm run dev",
"cwd": "${workspaceFolder}"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack://_N_E/*": "${webRoot}/*"
}
},
{
"name": "WWV Data Engine: debug",
"type": "node-terminal",
"request": "launch",
"command": "pnpm --filter wwv-data-engine run dev",
"cwd": "${workspaceFolder}"
},
{
"name": "Full Stack: debug",
"type": "node-terminal",
"request": "launch",
"command": "pnpm run dev:all",
"cwd": "${workspaceFolder}"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "npm: dev:all",
"type": "npm",
"script": "dev:all",
"problemMatcher": [],
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "new"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
+345
View File
@@ -0,0 +1,345 @@
# WorldWideView — Agent Rules
## 1. Project Identity
WorldWideView is a **real-time geospatial intelligence engine** that visualizes live global data on an interactive 3D globe. Built with **Next.js 16**, **CesiumJS**, **React 19**, and **Zustand**, it renders everything from live aircraft and maritime vessels to conflict events, satellites, and environmental data — all through a modular plugin architecture.
### Target Inspiration
Our primary design, feature-set, and operational layout goal is to mimic the structure and capabilities of `www.worldmonitor.app`.
- **Reference Codebase**: [GitHub - koala73/worldmonitor](https://github.com/koala73/worldmonitor)
---
## 2. Tech Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, `output: "standalone"`) |
| Language | TypeScript 5, strict mode |
| 3D Engine | CesiumJS + Resium (Google Photorealistic 3D Tiles) |
| State | Zustand (slice-based: globe, layers, timeline, UI, filters, data, config, favorites, geojson) |
| Event Bus | Custom typed `DataBus` (pub/sub singleton) |
| Styling | Vanilla CSS — **no Tailwind** |
| Database | SQLite via Prisma (local), PostgreSQL (cloud) |
| Auth | NextAuth v5 beta (Credentials provider, JWT sessions) |
| Package Manager | pnpm (monorepo with `pnpm-workspace.yaml`) |
| Testing | Vitest + jsdom + React Testing Library |
| Deployment | Docker multi-stage build → Coolify |
| Analytics | Vercel Analytics / custom `trackEvent` |
---
## 3. Directory Structure
```
worldwideview/
├── src/
│ ├── app/ # Next.js App Router (pages, API routes, layouts)
│ │ ├── api/ # Server-side API routes (auth, aviation, camera, etc.)
│ │ ├── login/ # Login page
│ │ ├── setup/ # First-time setup page
│ │ └── globals.css # Root stylesheet
│ ├── components/
│ │ ├── common/ # Shared UI: BootOverlay, FloatingWindow, PluginIcon
│ │ ├── layout/ # AppShell, Header, SearchBar, DataBusSubscriber
│ │ ├── panels/ # LayerPanel, EntityInfoCard, FilterPanel, GraphicsSettings
│ │ ├── timeline/ # Timeline component
│ │ ├── marketplace/ # Plugin install/unverified dialogs
│ │ ├── ui/ # Tooltip, ReloadToast
│ │ └── video/ # Floating video manager
│ ├── core/
│ │ ├── data/ # DataBus, PollingManager, CacheLayer, SmartFetcher
│ │ ├── filters/ # filterEngine (applies plugin filters to entities)
│ │ ├── globe/ # GlobeView, EntityRenderer, AnimationLoop, StackManager,
│ │ │ │ CameraController, InteractionHandler, SelectionHandler,
│ │ │ │ ModelManager, ImageryProviderFactory
│ │ │ └── hooks/ # useCameraActions, useEntityRendering, useModelRendering, etc.
│ │ ├── hooks/ # useBootSequence, useIsMobile, useMarketplaceSync
│ │ ├── plugins/ # PluginManager, PluginRegistry, PluginManifest,
│ │ │ │ loadPluginFromManifest, validateManifest, InstalledPluginsLoader
│ │ │ └── loaders/ # DeclarativePlugin, StaticDataPlugin, mapJsonToEntities
│ │ └── state/ # Zustand store + slices (config, data, globe, layers, timeline, ui, etc.)
│ ├── lib/ # auth, db, rateLimit, analytics, AIS stream, marketplace APIs
│ ├── plugins/ # GeoJSON plugin registrations
│ ├── styles/ # HUD animations CSS
│ ├── types/ # GeoJSON types, Umami types
│ └── generated/ # Prisma generated client (gitignored)
├── packages/ # pnpm monorepo workspace packages
│ ├── wwv-plugin-sdk/ # Plugin SDK: type definitions, manifest schema
│ ├── wwv-plugin-aviation/
│ ├── wwv-plugin-maritime/
│ ├── wwv-plugin-wildfire/
│ ├── wwv-plugin-borders/
│ ├── wwv-plugin-camera/
│ ├── wwv-plugin-military-aviation/
│ ├── wwv-plugin-satellite/
│ ├── wwv-plugin-iranwarlive/ # Includes standalone backend/ microservice
│ └── wwv-plugin-{airports,embassies,lighthouses,nuclear,seaports,spaceports,volcanoes}/
├── prisma/ # schema.prisma, migrations/
├── public/ # Static assets, Cesium workers, plugin GeoJSON data
├── scripts/ # Build scripts (copy-cesium, scaffold-osm-plugin, setup)
├── data/ # SQLite database (gitignored, Docker volume)
├── Dockerfile # Multi-stage production build
├── docker-compose.yml # Main app + microservice backends
└── .agents/ # Agent documentation, rules, skills, workflows
```
---
## 4. Architecture Patterns
### 4.1 Plugin System (Core Abstraction)
Every data source is a **plugin** implementing the `WorldPlugin` interface from `@worldwideview/wwv-plugin-sdk`. The lifecycle utilizes a real-time WebSocket Firehose pipeline:
```text
PluginRegistry.register() → PluginManager.registerPlugin()
→ plugin.initialize(context)
Visibility Toggle → DataBusSubscriber subscribes to layer via WsClient
→ Engine responds with instantaneous websocket snapshots over /stream
→ WsClient pipes to DataBus.emit("dataUpdated", WsStreamPayload)
→ Store → EntityRenderer → Globe
```
Four plugin architectures exist:
1. **Static** — GeoJSON file in `public/data/`, loaded by `StaticDataPlugin`
2. **Active Proxied** — Next.js API routes in `src/app/api/` as CORS proxy
3. **Microservice** — Standalone Fastify container with SQLite (e.g., `iranwarlive-backend`)
4. **Dynamic CDN Loaded (Bundle)** — Externally developed plugins dynamically imported at runtime via ES module CDNs (e.g., `unpkg.com` version-pinned URLs). Handled by `loadBundlePlugin` using `import(/* webpackIgnore: true */ entry)`.
Plugin types are re-exported from SDK through `src/core/plugins/PluginTypes.ts` and `PluginManifest.ts` — **source of truth is always `@worldwideview/wwv-plugin-sdk`**.
### 4.2 State Management
Zustand store with **nine slices**: `globe`, `layers`, `timeline`, `ui`, `filter`, `data`, `config`, `favorites`, `geojson`. Each slice is in its own file under `src/core/state/`.
- Access via `useStore` hook or `useStore.getState()` outside React
- Plugin settings stored in `configSlice.dataConfig.pluginSettings`
- Polling intervals stored in `configSlice.dataConfig.pollingIntervals`
### 4.3 Data Pipeline
```text
Engine push /stream → DataBusSubscriber WsClient router
→ WsClient.handleMessage() → DataBus.emit("websocketData")
→ DataBusSubscriber → _hydrateSnapshot() → Store.entitiesByPlugin
→ GlobeView (memoized visible entities)
→ EntityRenderer (billboard/point primitives)
→ AnimationLoop (horizon culling, hover/selection)
→ StackManager (co-located entity grouping)
```
### 4.4 Rendering Pipeline
- **Primitive-based**: Uses `PointPrimitiveCollection`, `BillboardCollection`, `LabelCollection` — NOT Cesium Entity API
- **Chunked processing**: Large datasets (10k+) rendered via `ChunkedProcessor`
- **LOD system**: Model-type entities promoted to 3D models at close range (`useModelRendering`)
- **Horizon culling**: Manual dot-product calculation against Earth radius (NOT depth testing)
- **Stack/Spiderifier**: `StackManager` groups co-located entities; `stackAnimation` handles expansion
### 4.5 Edition System
Three editions controlled by `NEXT_PUBLIC_WWV_EDITION`:
- **`local`** — Self-hosted, full features, auth enabled
- **`cloud`** — Managed cloud instance, full features
- **`demo`** — Public demo, auth disabled, optional admin via `WWV_DEMO_ADMIN_SECRET`
Feature flags derived from edition in `src/core/edition.ts`.
---
## 5. Critical Conventions
### 5.1 File Size
**Max 150 lines per file.** If a file grows beyond this, modularize it. Extract helpers, split components, use hooks.
### 5.2 Import Aliases
- `@/*` → `./src/*`
- `@worldwideview/wwv-plugin-sdk` → `./packages/wwv-plugin-sdk/src`
- Each plugin has its own alias in `tsconfig.json`
### 5.3 CSS Rules
- **Vanilla CSS only** — no Tailwind, no CSS-in-JS
- Global styles in `src/app/globals.css`
- Component-scoped styles use CSS Modules (`.module.css`) or co-located `.css` files
- HUD animations in `src/styles/hud-animations.css`
### 5.4 Rendering Entity Rules
When returning `CesiumEntityOptions` from `renderEntity()`:
- **Points**: Use `type: "point"` with `color`, `size`, `outlineColor`, `outlineWidth`
- **Billboards**: Use `type: "billboard"` with `iconUrl`, `color`, `iconScale`
- **NEVER mix**: Do not use `size`/`outlineWidth`/`outlineColor` on billboard entities — causes GPU clipping
### 5.5 Plugin Registration
Built-in plugins are instantiated in `AppShell.tsx` and registered via `PluginRegistry` → `PluginManager`. Marketplace-installed plugins are loaded from the database via `InstalledPluginsLoader`.
### 5.6 Workspace Rules
- Always run `pnpm install` from project root after creating new packages
- Plugin packages go in `packages/wwv-plugin-<name>/`
- Microservice backends go in `packages/wwv-plugin-<name>/backend/`
- Both globs (`packages/*` and `packages/*/backend`) are in `pnpm-workspace.yaml`
- Add new plugins to `transpilePackages` in `next.config.ts` and `paths` in `tsconfig.json`
### 5.7 AI Meta-Directives: Antigravity Standard (Claude Code)
> [!NOTE]
> This repository is orchestrated via the **Antigravity open standard** using **Claude Code** as the active agent. The entry point for Claude Code is `CLAUDE.md` at the project root.
> [!WARNING]
> - **Always** use standard `.md` file extensions for rules, skills, and workflows.
> - **Never** use proprietary `.mdc` extensions.
> - **Never** reference Cursor IDE rules; we use the open `.agents/` standard.
> - **MUST**: You MUST update Semantic Versioning numbering inside the relevant `package.json` file prior to executing any code commits, adhering strictly to the `[/commit]` workflow rules (`feat:` -> Minor, `fix/refactor/perf:` -> Patch).
> - **MUST Detail Commit Levels & Bumps**: On description changes or release notes, you must detail the level of commit (Major/Minor/Fix) for *each* individual change. If there are multiple accumulated changes, you MUST EITHER commit them individually and bump the version each time, OR commit them all at once and bump the version multiple times.
> - **MUST Explain Complex Concepts Simply**: Whenever providing a complicated technical explanation to the user, you MUST include a simple explanation below it. Use an analogy comparing the concept to something from everyday life to ensure the user easily understands it.
### 5.8 Workspace Hygiene
Whenever agents generate temporary debugging scripts, test REST endpoints via `.mjs`, or dump traces/JSON outputs, they **MUST** save these exclusively inside `/local-scripts/`. The root directory is strictly for production configuration files.
---
## 6. Environment Variables
| Variable | Required | Description |
|---|---|---|
| `DATABASE_URL` | Yes | SQLite: `file:./data/wwv.db` |
| `AUTH_SECRET` | Yes | JWT signing secret (generate with `openssl rand -hex 32`) |
| `NEXT_PUBLIC_CESIUM_ION_TOKEN` | No | Cesium Ion access token |
| `NEXT_PUBLIC_BING_MAPS_KEY` | No | Bing Maps imagery |
| `NEXT_PUBLIC_GOOGLE_MAPS_API_KEY` | No | Google 3D Tiles |
| `NEXT_PUBLIC_WWV_EDITION` | No | `local` / `cloud` / `demo` (default: `local`) |
| `OPENSKY_CREDENTIALS` | No | Comma-separated `id:secret` pairs for credential rotation |
| `WWV_BRIDGE_TOKEN` | No | Shared secret for marketplace → WWV install bridge |
| `WWV_DEMO_ADMIN_SECRET` | No | Demo edition admin password |
| `IRANWARLIVE_BACKEND_URL` | No | Override for IranWarLive microservice URL |
Secrets go in `.env.local` (gitignored). Non-secrets go in `.env` (committed).
---
## 7. Development Commands
```bash
pnpm install # Install all workspace dependencies
pnpm run setup # Generate .env.local with AUTH_SECRET (first-time setup)
pnpm dev # Next.js frontend only (auto-runs prisma migrate deploy + copy-cesium)
pnpm dev:all # Frontend + wwv-data-engine concurrently (normal development)
pnpm dev:backends # Run only the data engine in dev mode
pnpm build # Production build
pnpm test # Run all Vitest tests (scoped to src/lib, src/core, src/plugins)
pnpm db:reset # Reset and re-migrate the frontend SQLite database (destructive)
pnpm start:backends # Start all plugin microservice backends in parallel
pnpm clean:backends # Wipe all plugin SQLite databases
pnpm run scaffold-osm-plugin <name> # Generate a new plugin from scaffold
```
Frontend runs at `http://localhost:3000`.
---
## 8. Deployment
- **Docker**: Multi-stage Dockerfile using the Extractor Pattern (`deps` → `builder` → `runner`). The `node_modules` folders must be explicitly untracked in from `git` across the workspace to prevent corrupted BuildKit contextual cache overlaps during the `COPY . .` stage.
- **Standalone output**: `next.config.ts` uses `output: "standalone"`.
- **Cesium assets**: Copied to `public/cesium/` via `scripts/copy-cesium.mjs` at build time, excluded from output tracing.
- **Prisma Configuration**: `prisma.config.ts` must export a native javascript object instead of dynamically importing CLI wrapper binaries (`prisma/config` or `dotenv`). The standalone Next.js tracer strips CLI devDependencies during the build, which will cause fatal runtime container crashes if imported.
- **Microservices**: Separate containers defined in `docker-compose.yml`, proxied via `next.config.ts` rewrites.
- **Coolify**: Deployed via Dockerfile builder natively mapping environment variables continuously into the container shell. Persistent storage mount required at `/app/data` for the SQLite root node database.
- **Docker volumes**: Mount `/app/data` (frontend SQLite), `/app/packages/wwv-data-engine/data` (data engine SQLite), `/data` (Redis)
---
## 9. Testing Strategy
- **Framework**: Vitest with jsdom environment
- **Coverage**: `src/lib/**`, `src/core/**`, `src/plugins/**`
- **Run**: `pnpm test` (or `vitest run`)
- **Key test files**: `rateLimit.test.ts`, `edition.test.ts`, `demoAdmin.test.ts`, `DeclarativePlugin.test.ts`, `cors.test.ts`, `repository.test.ts`, `marketplaceToken.test.ts`
---
## 10. Security Headers
Configured in `next.config.ts` `headers()`:
- **CSP**: Restrictive with exceptions for CesiumJS (`unsafe-eval`, `unsafe-inline`), camera streams (`http: https:`), and analytics
- **X-Frame-Options**: DENY
- **X-Content-Type-Options**: nosniff
- **Referrer-Policy**: strict-origin-when-cross-origin
- **Permissions-Policy**: camera/microphone disabled, geolocation self-only
---
## 11. Related Repositories
| Repo | Purpose |
|---|---|
| `worldwideview` | Main application (this repo) |
| `worldwideview-marketplace` | Plugin marketplace web app |
| `worldwideview-web` | Marketing / landing page |
---
## 12. On-Demand Rules
Read the relevant rule file when working in that domain:
| Rule | When to use | Path |
|---|---|---|
| `monorepo-workflow` | pnpm commands, adding packages, workspace config | `.agents/rules/monorepo-workflow.md` |
| `plugin-architecture` | Creating/modifying plugins, lifecycle, registration | `.agents/rules/plugin-architecture.md` |
| `cesium-rendering` | Globe rendering, entity types, primitives, LOD, culling | `.agents/rules/cesium-rendering.md` |
| `state-management` | Zustand slices, store access, plugin settings | `.agents/rules/state-management.md` |
| `database-migrations` | Prisma schema changes, migrations, SQLite/Postgres | `.agents/rules/database-migrations.md` |
| `continuous-improvement` | When to create/update rules, skills, or workflows | `.agents/rules/continuous-improvement.md` |
| `context-and-memory` | How to orient and maintain project context between sessions | `.agents/rules/context-and-memory.md` |
---
## 13. Slash Commands / Workflows
Invoke by name. Read the skill/workflow file and follow its steps.
| Command | Description | File |
|---|---|---|
| `/commit` | **Required before every commit** — bump semver + conventional commit | `.agents/skills/commit/SKILL.md` |
| `/remember` | Save a lesson, constraint, or fact into `.agents/` permanent memory | `.agents/skills/remember/SKILL.md` |
| `/pr-review` | 6-role comprehensive pull request review | `.agents/skills/pr-review/SKILL.md` |
| `/update-context` | Sync `.agents/context/` with current project state | Global skill |
| `/local-dev` | Check, start, and troubleshoot local dev environment | `.agents/workflows/local-dev.md` |
| `/data-engine-cli` | Use the wwv-data-engine CLI wrapper | `.agents/workflows/data-engine-cli.md` |
| `/debugging-coolify` | Troubleshoot deployed apps on Coolify via MCP/SSH | `.agents/workflows/debugging-coolify.md` |
| `/five` | Five Whys root cause analysis | `.agents/workflows/five.md` |
| `/stitch-to-nextjs` | Generate UI with Stitch MCP, port into Next.js | `.agents/workflows/stitch-to-nextjs.md` |
| `/bing-news-hydration` | Hydrate event attributes with Bing RSS news | `.agents/workflows/bing-news-hydration.md` |
| `/generate-user-roadmap` | Generate updated user-facing roadmap | `.agents/workflows/generate-user-roadmap.md` |
---
## 14. Agent Skills Reference
Refer to these skill documents for specialized tasks:
### Project Skills (`.agents/skills/`)
| Skill | When to Use |
|---|---|
| `worldwideview-plugin-creation` | **Use when creating any plugin** — strict architectural checklist |
| `plugin-creation-master-guide.md` | Decision matrix for choosing plugin architecture |
| `osm-static-plugin-creation.md` | Creating static GeoJSON plugins from OpenStreetMap |
| `microservice-plugin-creation.md` | Building standalone Fastify microservice backends |
| `database-operations.md` | Prisma schema changes, migrations, database queries |
| `database-incident-recovery-procedures.md` | Authoritative protocol for safely restoring a broken production database |
| `index-documentation.md` | Maintaining project documentation index |
| `context7` | Fetch up-to-date library docs via Context7 API |
| `cesium-context7` | CesiumJS-specific documentation lookup |
### Global Skills
52 skills are available across all projects. See `.agents/global-skills-index.md` for the full list and invocation paths.
+55
View File
@@ -0,0 +1,55 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and maintainers of **WorldWideView** pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
---
## Our Standards
Examples of behaviour that contributes to a positive environment:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behaviour:
- The use of sexualised language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
---
## Enforcement Responsibilities
Maintainers are responsible for clarifying and enforcing our standards of acceptable behaviour and will take appropriate and fair corrective action in response to any behaviour that they deem inappropriate, threatening, offensive, or harmful.
Maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct.
---
## Scope
This Code of Conduct applies within all project spaces — GitHub issues, pull requests, discussions, and any other official channels.
---
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by opening a GitHub issue marked **[CoC]** or by contacting the maintainer directly via GitHub.
All complaints will be reviewed and investigated promptly and fairly. The maintainer is obligated to respect the privacy and security of the reporter.
---
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
+151
View File
@@ -0,0 +1,151 @@
# Contributing to WorldWideView
Thank you for your interest in contributing to **WorldWideView** — a modular, real-time geospatial intelligence engine!
This project is licensed under the [Elastic License 2.0](./LICENSE). By submitting a contribution, you agree that your code will be made available under those same terms.
---
## Table of Contents
- [Getting Started](#getting-started)
- [Development Setup](#development-setup)
- [Project Structure](#project-structure)
- [How to Contribute](#how-to-contribute)
- [Plugin Contributions](#plugin-contributions)
- [Code Standards](#code-standards)
- [Commit & Branch Conventions](#commit--branch-conventions)
- [Pull Request Process](#pull-request-process)
- [Running Tests](#running-tests)
---
## Getting Started
1. **Fork** the repository on GitHub.
2. **Clone** your fork locally:
```bash
git clone https://github.com/<your-username>/worldwideview.git
cd worldwideview
```
3. **Install dependencies**:
```bash
npm install
```
4. **Generate environment file** (auto-creates `.env.local` with `AUTH_SECRET`):
```bash
npm run setup
```
5. **Start the dev server**:
```bash
npm run dev
```
Visit `http://localhost:3000` to confirm everything is running.
---
## Development Setup
| Requirement | Version |
|-------------|---------|
| Node.js | 18+ |
| npm | 9+ |
See [`docs/SETUP.md`](docs/SETUP.md) for detailed environment setup, including Cesium Ion token configuration.
---
## Project Structure
```
src/
core/ # Core engine: state, data bus, plugin registry
plugins/ # Data source plugins (ADS-B, AIS, satellites, etc.)
components/ # React UI components
hooks/ # Custom React hooks
docs/ # Architecture and user guides
```
See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for a deep dive into the rendering pipeline and plugin lifecycle.
---
## How to Contribute
Ways you can help:
- 🐛 **Bug fixes** — Check the [issue tracker](https://github.com/silvertakana/worldwideview/issues)
- 🧩 **New plugins** — Add a new data source layer (see below)
- 📖 **Documentation** — Improve guides or add examples
- ⚡ **Performance** — Cesium primitive optimizations, GPU stall reduction
- 🧪 **Tests** — Expand Vitest coverage
For large features, **open an issue first** to discuss the design before writing code.
---
## Plugin Contributions
The core extension point of WorldWideView is its **plugin system**. Each plugin is a self-contained data layer that:
1. Fetches or subscribes to a data source
2. Transforms raw data into Cesium-ready primitives
3. Registers itself with the `PluginRegistry`
See [`docs/PLUGIN_GUIDE.md`](docs/PLUGIN_GUIDE.md) for a full walkthrough. New plugins are very welcome — if you have access to a live geospatial data feed, a plugin is the best way to contribute.
---
## Code Standards
This project follows these principles:
- **Single Responsibility Principle** — each file/module does one thing
- **DRY & SOLID** — avoid duplication, favour composition
- **Clean Architecture** — UI, logic, and data are separate concerns
- **Defensive Programming** — validate inputs, handle edge cases explicitly
- **File size** — keep files under 150 lines; split into modules if needed
Use TypeScript strictly. Avoid `any` unless absolutely unavoidable.
---
## Commit & Branch Conventions
**Branch naming:**
```
feat/short-description
fix/short-description
docs/short-description
refactor/short-description
```
**Commit messages** follow [Conventional Commits](https://www.conventionalcommits.org/):
```
feat: add maritime AIS plugin
fix: resolve camera snap on globe reset
docs: update plugin guide with lifecycle diagram
refactor: extract billboard factory from CesiumMap
```
---
## Pull Request Process
1. Ensure your branch is up to date with `main`.
2. Run tests and confirm they pass: `npm test`
3. Fill out the [PR template](.github/PULL_REQUEST_TEMPLATE.md) completely.
4. Request a review — PRs need at least one approval before merging.
5. Squash commits on merge if the history is noisy.
---
## Running Tests
```bash
npm test # Run all tests via Vitest
npm run test:ui # Open Vitest UI (interactive)
```
Tests live alongside source files in `__tests__/` directories or as `.test.ts` files.
+78
View File
@@ -0,0 +1,78 @@
# Stage 0: Extract package.json files for layer caching
FROM alpine AS extractor
WORKDIR /app
COPY . .
RUN find . -type f \! -name 'package.json' \! -name 'pnpm-workspace.yaml' \! -name 'pnpm-lock.yaml' -delete && \
find . -type d -empty -delete
# Stage 1: Install ALL dependencies (needed for build)
FROM node:22-alpine AS deps
RUN corepack enable pnpm
RUN apk add --no-cache python3 make g++
WORKDIR /app
# Copy only the extracted package.jsons
COPY --from=extractor /app ./
# Install dependencies with cache mount for pnpm store
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
# Stage 3: Build the application
FROM deps AS builder
# Copy full source code
COPY . .
RUN DATABASE_URL="file:./data/wwv.db" npx prisma generate
# Create an empty SQLite database with all tables applied
RUN mkdir -p ./data && DATABASE_URL=file:./data/wwv.db npx prisma migrate deploy
# Next.js inlines NEXT_PUBLIC_* vars at build time — must be declared as ARGs
ARG NEXT_PUBLIC_CESIUM_ION_TOKEN
ARG NEXT_PUBLIC_GOOGLE_MAPS_API_KEY
ARG NEXT_PUBLIC_BING_MAPS_KEY
ARG NEXT_PUBLIC_WWV_EDITION
ARG NEXT_PUBLIC_WS_ENGINE_URL
ARG NEXT_PUBLIC_ADSENSE_CLIENT_ID
ARG NEXT_PUBLIC_SUPABASE_URL
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
# Run Next.js build with Webpack cache mounted
RUN --mount=type=cache,target=/app/.next/cache NODE_OPTIONS="--max_old_space_size=3072" pnpm run build
RUN node scripts/copy-cesium.mjs
# Stage 4: Production runner
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
ENV DATABASE_URL=file:./data/wwv.db
ENV AUTH_TRUST_HOST=true
# Copy Prisma schema + migrations for runtime DB init
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
# Copy Prisma generated client
COPY --from=builder /app/src/generated ./src/generated
# Copy standalone server output
COPY --from=builder /app/.next/standalone ./
# We no longer copy proddeps/node_modules. Next.js standalone output
# already traces and copies all the exact node_modules needed for production.
# Copy static assets that standalone mode does NOT include
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
# Entrypoint: migrate DB on first run, then start server
COPY docker-entrypoint.sh ./docker-entrypoint.sh
RUN chmod +x ./docker-entrypoint.sh
# Declare /app/data as a persistent volume mount point.
VOLUME ["/app/data"]
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
-250
View File
@@ -1,250 +0,0 @@
# World Wide View — Implementation Plan
A next-generation, open-source geospatial intelligence platform combining **Worldview's cinematic CesiumJS 3D globe** with **Worldmonitor's data-rich ingestion engine**, built around a **modular plugin ecosystem**, and designed for both **community self-hosting** and **commercial SaaS deployment**.
## User Review Required
> [!IMPORTANT]
> **CesiumJS + Google 3D Tiles (Recommended)**: For a "low cost, fast, and efficient" setup that looks like Bilawal's "Worldview" videos, I recommend **CesiumJS with Google Maps Photorealistic 3D Tiles**.
> - **Cost**: Google Provides a **$200/month free credit**, which covers ~33,000 sessions (each session is 3 hours of 3D globe usage). This is essentially **$0 for small-to-medium volume**.
> - **Efficiency**: CesiumJS is built natively for 3D Tiles and time-dynamic data (CZML), making it the "fastest" path to build the cinematic features you want.
> - **Alternatives**: MapLibre GL JS is "lighter" for standard maps but lacks the high-end 3D terrain/building polish. Deck.gl is better suited for the dashboard overlays (which we can still integrate into Cesium).
> [!IMPORTANT]
> **Scope for this bootstrap**: This plan covers **Phase 1 — Foundation/MVP** only. This gets you a working 3D globe app with the plugin architecture, 3 live data layers, a timeline, cinematic camera, and a sidebar intelligence panel. Subsequent phases will be planned after Phase 1 ships.
> [!WARNING]
> **API keys required**:
> - **Google Maps Tile API Key** (Required for Photorealistic 3D Tiles — Includes $200/mo credit).
> - **OpenSky Network** account (free at [opensky-network.org](https://opensky-network.org)).
---
## Proposed Changes
### Project Scaffolding
Summary: Initialize a Next.js (App Router) + TypeScript project with a modular architecture, designed from day one as a plugin ecosystem.
#### [NEW] [package.json](file:///c:/dev/World%20Wide%20View/package.json)
Root `package.json` with Next.js, React 18, TypeScript, CesiumJS, and Resium. Will include a custom `copy-cesium` script to move static assets to `/public/cesium` for Next.js compatibility.
#### [NEW] [next.config.mjs](file:///c:/dev/World%20Wide%20View/next.config.mjs)
Next.js config with path aliases, environment variable handling, and specific Webpack exclusions for CesiumJS Node.js dependencies.
#### [NEW] [tsconfig.json](file:///c:/dev/World%20Wide%20View/tsconfig.json)
TypeScript config with strict mode, path aliases for `@/core`, `@/plugins`, `@/components`.
#### [NEW] [.env.example](file:///c:/dev/World%20Wide%20View/.env.example)
Template with all required/optional environment variables documented.
---
### Directory Structure
```
c:\dev\World Wide View\
├── public/ # Static assets (including /cesium)
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── page.tsx # Main entry (Client component)
│ │ ├── layout.tsx # Root layout
│ │ ├── globals.css # Global styles
│ │ └── api/ # Next.js Route Handlers (Backend)
│ │ ├── aviation/route.ts# OpenSky proxy
│ │ ├── maritime/route.ts# AIS proxy
│ │ └── wildfire/route.ts# NASA FIRMS proxy
│ ├── core/ # Core platform code
│ │ ├── globe/ # CesiumJS globe wrapper (Dynamic Import)
│ │ │ ├── GlobeView.tsx # Main 3D globe component
│ │ │ ├── CameraController.ts # Cinematic camera system
│ │ │ ├── LayerRenderer.ts # Renders plugin data on globe
│ │ │ └── TimelineSync.ts # Syncs Cesium clock with UI
│ │ ├── plugins/ # Plugin system
│ │ │ ├── PluginManager.ts # Plugin lifecycle manager
│ │ │ ├── PluginTypes.ts # Plugin interface definitions
│ │ │ └── PluginRegistry.ts# Registration & discovery
│ │ ├── data/ # Data management
│ │ │ ├── DataBus.ts # Event bus for data flow
│ │ │ ├── CacheLayer.ts # In-memory + IndexedDB caching
│ │ │ └── PollingManager.ts# Manages refresh intervals
│ │ └── state/ # Global state management
│ │ └── store.ts # Zustand store
│ ├── plugins/ # Built-in data source plugins
│ │ ├── aviation/ # OpenSky / ADS-B
│ │ ├── maritime/ # AIS vessel tracking
│ │ └── wildfire/ # NASA FIRMS
│ ├── components/ # UI components
│ │ ├── layout/ # AppShell, Header, Sidebar
│ │ ├── panels/ # LayerPanel, IntelPanel, Detail
│ │ ├── timeline/ # Timeline scrubber
│ │ └── common/ # Loading, Toast, etc.
│ └── utils/ # Helpers
├── .env.example
├── package.json
├── tsconfig.json
└── next.config.mjs
```
---
### Core Globe Component
#### [NEW] [GlobeView.tsx](file:///c:/dev/World%20Wide%20View/src/core/globe/GlobeView.tsx)
- CesiumJS `Viewer` inside React using Resium
- WGS84 ellipsoid, terrain, imagery layers
- Request render mode for performance
- Integrates with `TimelineSync` for time-based filtering
#### [NEW] [CameraController.ts](file:///c:/dev/World%20Wide%20View/src/core/globe/CameraController.ts)
- Cinematic fly-to animations with easing (Worldview-style smooth transitions)
- 8 regional presets (Global, Americas, Europe, MENA, Asia, Africa, Oceania, LatAm)
- Orbit mode for idle/attract state
- URL state sync (lat, lon, zoom, heading, pitch)
#### [NEW] [LayerRenderer.ts](file:///c:/dev/World%20Wide%20View/src/core/globe/LayerRenderer.ts)
- Renders plugin data as Cesium entities (points, billboards, polylines, polygons)
- Smart clustering via `EntityCluster`
- Progressive disclosure (detail at higher zoom)
- Color/size coding based on data attributes
#### [NEW] [TimelineSync.ts](file:///c:/dev/World%20Wide%20View/src/core/globe/TimelineSync.ts)
- Bidirectional sync between Cesium clock and UI timeline
- Time window filtering (1h, 6h, 24h, 48h, 7d)
- Playback controls, speed multiplier
- Notifies plugins of current time window
---
### Plugin System
The heart of the modular architecture. Every data source implements a standard interface.
#### [NEW] [PluginTypes.ts](file:///c:/dev/World%20Wide%20View/src/core/plugins/PluginTypes.ts)
```typescript
export interface WorldPlugin {
id: string;
name: string;
description: string;
icon: string;
category: 'aviation' | 'maritime' | 'conflict' | 'natural-disaster' |
'infrastructure' | 'cyber' | 'economic' | 'custom';
version: string;
initialize(context: PluginContext): Promise<void>;
destroy(): void;
fetch(timeRange: TimeRange): Promise<GeoEntity[]>;
getPollingInterval(): number;
getLayerConfig(): LayerConfig;
renderEntity(entity: GeoEntity): CesiumEntityOptions;
// Optional UI hooks
getSidebarComponent?(): React.ComponentType;
getDetailComponent?(): React.ComponentType<{ entity: GeoEntity }>;
}
```
#### [NEW] [PluginManager.ts](file:///c:/dev/World%20Wide%20View/src/core/plugins/PluginManager.ts)
- Plugin lifecycle (register, initialize, enable, disable, destroy)
- Routes data from plugins → `LayerRenderer`
- Manages polling per plugin
- Emits events via `DataBus`
#### [NEW] [PluginRegistry.ts](file:///c:/dev/World%20Wide%20View/src/core/plugins/PluginRegistry.ts)
- Static registry of built-in plugins + dynamic registration API
---
### Built-in Plugins (3 for MVP)
#### [NEW] Aviation — [src/plugins/aviation/](file:///c:/dev/World%20Wide%20View/src/plugins/aviation/)
- **Source**: OpenSky Network REST API
- **Rendering**: Aircraft billboards with heading rotation, altitude coloring
- **Polling**: 10s | **Backend proxy**: `/api/aviation`
#### [NEW] Maritime — [src/plugins/maritime/](file:///c:/dev/World%20Wide%20View/src/plugins/maritime/)
- **Source**: Public AIS feeds
- **Rendering**: Ship icons, color-coded by vessel type
- **Polling**: 60s | **Backend proxy**: `/api/maritime`
#### [NEW] Wildfire — [src/plugins/wildfire/](file:///c:/dev/World%20Wide%20View/src/plugins/wildfire/)
- **Source**: NASA FIRMS (VIIRS thermal hotspots)
- **Rendering**: Heat-colored point clusters (FRP intensity)
- **Polling**: 5min | **Backend proxy**: `/api/wildfire`
---
### UI Components
Dark, cinematic, premium interface — glassmorphism panels floating over the globe.
#### [NEW] [AppShell.tsx](file:///c:/dev/World%20Wide%20View/src/components/layout/AppShell.tsx)
Full-viewport layout with globe as background, floating glassmorphism header, collapsible sidebars, bottom timeline.
#### [NEW] [Header.tsx](file:///c:/dev/World%20Wide%20View/src/components/layout/Header.tsx)
Branding, Cmd+K search, region presets, time window selector, settings.
#### [NEW] [LayerPanel.tsx](file:///c:/dev/World%20Wide%20View/src/components/panels/LayerPanel.tsx)
Toggleable plugin layers grouped by category with entity counts.
#### [NEW] [Timeline.tsx](file:///c:/dev/World%20Wide%20View/src/components/timeline/Timeline.tsx)
Horizontal time scrubber, playback controls, event density sparkline.
#### [NEW] [index.css](file:///c:/dev/World%20Wide%20View/src/styles/index.css)
Dark-mode-first design system: deep navy/charcoal palette, glassmorphism, Inter + JetBrains Mono typography, smooth micro-animations.
---
### Backend API (Next.js Route Handlers)
#### [NEW] [src/app/api/](file:///c:/dev/World%20Wide%20View/src/app/api/)
Next.js Route Handlers utilizing Web Standard Request/Response APIs. Handles rate limiting, server-side data fetching (proxying), and caching (via Next.js `fetch` cache or in-memory). This replaces the need for a separate Express server.
#### [NEW] Route files
- `src/app/api/aviation/route.ts` — OpenSky proxy
- `src/app/api/maritime/route.ts` — AIS proxy
- `src/app/api/wildfire/route.ts` — NASA FIRMS proxy
---
### State Management
#### [NEW] [store.ts](file:///c:/dev/World%20Wide%20View/src/core/state/store.ts)
Zustand store with slices: `globe`, `layers`, `timeline`, `ui`, `data`.
---
## Verification Plan
### Automated Tests
**Build verification:**
```bash
cd "c:\dev\World Wide View"
npm run build
```
**Type checking:**
```bash
cd "c:\dev\World Wide View"
npx tsc --noEmit
```
### Browser Verification
1. Open `http://localhost:5173` → CesiumJS globe renders with terrain, header/sidebar/timeline visible
2. Enable aviation layer → aircraft icons appear, clicking shows detail
3. Enable wildfire layer → fire hotspots render as colored points
4. Scrub timeline → data filters by time window
5. Click region presets → smooth cinematic fly-to animations
### Manual Verification
1. Run `npm run dev` — starts the Next.js integrated development server
2. Verify 3D globe renders with terrain and satellite imagery (ensuring SSR is properly disabled for the globe component)
3. Toggle layers via layer panel
4. Drag timeline to filter events
5. Test camera preset fly-tos
6. Resize browser — panels collapse gracefully
> [!TIP]
> First run requires `VITE_CESIUM_TOKEN` in `.env` (free from [cesium.com/ion](https://cesium.com/ion)). App shows a warning if missing but still renders a basic globe.
+70 -17
View File
@@ -1,38 +1,91 @@
# WorldWideView
<div align="center">
**WorldWideView** is a modular, real-time geospatial intelligence engine built on top of a CesiumJS 3D globe. It is designed to ingest live data streams, transform them through a generalized plugin system, and render them as high-performance visual layers.
# WorldWideView 🌍
As a real-time situational awareness platform, it turns raw geospatial signals—such as aircraft positions, maritime AIS, or satellite orbits—into interactive, cinematic layers on a high-fidelity 3D globe.
**The Open-Source, Plugin-Driven Geospatial Intelligence Engine**
## Key Philosophies
[![License: Elastic 2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
- **Modular Intelligence**: Every data source is a plugin. The core engine is data-agnostic.
- **High-Performance Rendering**: Engineered for scale using Cesium primitives to handle 100,000+ objects smoothly.
- **Situational Awareness**: Designed for real-time updates and cinematic visualization (orientated icons, smooth tracking).
- **Extensible & Open**: Add new intelligence layers without touching the core architecture.
*A modular situational awareness platform designed to ingest live data streams and render them as interactive, cinematic layers on a high-fidelity CesiumJS 3D globe.*
## Quick Start
<!-- 📸 Replace with a high-res GIF or screenshot of the platform running with multiple layers enabled -->
![WorldWideView Interface](docs/assets/screenshot.png)
</div>
---
## ⚡ Build a Plugin in 5 Minutes
WorldWideView’s architecture means **everything is a plugin**. The core engine is completely data-agnostic. Rather than touching complex 3D rendering code, you can build a plugin that simply pipes a REST API into GeoJSON, and the engine handles the rest!
Ready to add a new intelligence layer (like Earthquakes, Weather, or Satellites)? We have a scaffold generator ready for you:
```bash
git clone https://github.com/your-repo/worldwideview.git
# 1. Generate the boilerplate plugin from a template
pnpm run scaffold-osm-plugin my-new-data-source
# 2. Add your data fetching logic in the generated files
# 3. Reload the dev server and watch it map on the globe!
```
📖 **[Read the Full Plugin Guide](docs/PLUGIN_GUIDE.md)** for a deep dive into hooking up websockets or static datasets.
---
## 🚀 Installation & Setup (Local Development)
```bash
git clone https://github.com/silvertakana/worldwideview.git
cd worldwideview
npm install
npm run dev
pnpm install
pnpm run setup # generates .env.local with AUTH_SECRET
pnpm run dev:all # starts the app, data engine, and marketplace concurrently
```
Visit `http://localhost:3000` to see the live globe.
## Fair-Use Notice
---
This application may contain copyrighted material the use of which has not always been specifically authorized by the copyright owner. Such material is made available for educational purposes, situational awareness, and to advance understanding of global events. It is believed that this constitutes a "fair use" of any such copyrighted material as provided for in section 107 of the US Copyright Law.
## 🐋 Production Deployment (Docker & Coolify)
## Key Documentation Sections
WorldWideView uses a multi-stage Dockerfile designed for standalone output, natively supporting deployment via Coolify or standard Docker Compose. The `docker-compose.yml` spins up the front-end application alongside the high-performance Data Engine and Redis cache.
```bash
# Start the core app, Redis cache, and Data Engine microservice in production mode
docker compose up -d
```
**Persistent Storage Requirements:**
When deploying to production, ensure you mount the following volumes to prevent data loss:
- Mount `/app/data` to persist the core SQLite database.
- Mount `/app/packages/wwv-data-engine/data` to persist the custom plugin microservices SQLite layer.
- Mount `/data` to persist the standalone Redis container.
---
## 🧠 Core Architecture & Philosophies
- **Dynamic, Decentralized Plugins**: The plugin ecosystem uses a decentralized architecture fetching ES module CDN bundles (e.g., from unpkg) at runtime. The core engine is a lightweight shell that loads data providers dynamically via the marketplace.
- **High-Performance Rendering**: Engineered for scale using raw Cesium primitives to smoothly handle upwards of 100,000+ objects simultaneously without GPU stalls.
- **Cinematic Situational Awareness**: Implements horizon culling, smooth camera tracking, orientation-locked billboarding, and stack spiderification for dense locations.
---
## 📚 Documentation Index
- **[Setup & Installation Guide](docs/SETUP.md)**: Detailed environment and local development setup.
- **[Architecture (Engineering Depth)](docs/ARCHITECTURE.md)**: Deep dive into the Cesium rendering pipeline, event data bus, and performance optimizations.
- **[Plugin System Guide](docs/PLUGIN_GUIDE.md)**: How to build and register custom data layers.
- **[Contributions Guide](CONTRIBUTING.md)**: How to help out, coding standards, and commit conventions.
- **[User Guide](docs/USER_GUIDE.md)**: Application features and navigation tips.
---
For a full list of resources, see the **[Documentation Index](docs/index.md)**.
## 🤝 Contributing & Community
We are actively looking for contributors to help build new data plugins and optimize the core 3D engine!
- Found a bug or have an idea? Search the [Issue Tracker](https://github.com/silvertakana/worldwideview/issues) and submit a report.
- Want to build something? Check out our **[Pinned Plugin Wishlist](https://github.com/silvertakana/worldwideview/issues)** for great first issues!
> **Fair-Use Notice:** This application may contain copyrighted material the use of which has not always been specifically authorized by the copyright owner. Such material is made available for educational purposes, situational awareness, and to advance understanding of global events under "fair use" (Section 107 of the US Copyright Law).
+161
View File
@@ -0,0 +1,161 @@
# WorldWideView — Implementation Roadmap
Each stage is **self-contained and demo-able**. Any stage can be shipped independently.
---
## Stage 1: Plugin SDK & Manifest Schema ✅
**Demo:** "Here's the schema that defines a plugin. Our existing aviation plugin has a manifest file."
- [x] `plugin.json` manifest files for each existing plugin
- [x] Manifest validation logic (`validateManifest()`)
- [x] `type` field on `WorldPlugin` interface (`"data-layer" | "extension"`)
- [x] `capabilities` field on `WorldPlugin` interface
- [x] `@worldwideview/wwv-plugin-sdk` npm package — shared types published to npm
---
## Stage 2: Marketplace Browse UI (Static Catalog) ✅
**Demo:** "Open the marketplace, see all available plugins with categories and search."
- [x] `worldwideview-marketplace` repo (Next.js)
- [x] Browse page — grid of plugin cards with icons, descriptions, categories
- [x] Search + category filter
- [x] Plugin detail page (readme, version history, install count)
---
## Stage 3: Prisma ORM & Local Database ✅
**Demo:** "Run `pnpm run dev` on a fresh clone. SQLite auto-creates. App works with zero config."
- [x] Prisma (`prisma` + `@prisma/client`)
- [x] Schema: `InstalledPlugin`, `Setting`, `User`, `AviationHistory`, `NpmCache`
- [x] SQLite default: `DATABASE_URL=file:./data/wwv.db`
- [x] `predev` script: `prisma migrate deploy`
- [x] DB auto-creates on first run — zero manual setup
---
## Stage 4: Bridge API & One-Click Install ✅
**Demo:** "Click 'Install' on marketplace → plugin appears in your local WWV instance."
- [x] `GET /api/marketplace/install-redirect` — session-based redirect install flow
- [x] `GET /api/marketplace/grant-token` — issues marketplace JWT without install
- [x] `GET /api/marketplace/status` — list installed plugins (session or JWT auth)
- [x] `POST /api/marketplace/uninstall` — delete installed plugin record
- [x] `GET /api/marketplace/load` — serve valid manifests to client at startup
- [x] `GET /api/auth/setup-status` — CORS-enabled connection test endpoint
- [x] `src/lib/marketplace/marketplaceToken.ts` — `issueMarketplaceToken()` / `verifyMarketplaceToken()`
- [x] `src/lib/marketplace/auth.ts` — `validateMarketplaceAuth()` (session → JWT → legacy token)
- [x] `src/lib/marketplace/registryClient.ts` — Ed25519 registry verification + 5-min cache
- [x] Marketplace: `InstanceConfig`, `InstallButton`, `useInstalledPlugins`, `InstalledPluginCard`, Manage page
- [x] NPM-driven submission: Admin enters package name → marketplace fetches + parses `"worldwideview"` block from `package.json`
- [x] `NpmCache` table — decouples marketplace from live NPM registry
---
## Stage 5: AI & Sharing Features (Immediate User Value)
**Demo:** "Chat with the AI to explore the globe, record a narrated briefing, and share the view via a URL."
- [ ] Unified Data Format schema (WWVDocument) with snapshot radius bounding
- [ ] Base64url view link sharing (`#v=...`)
- [ ] Shared `ActionExecutor` core for Animation & Copilot
- [ ] Animation Engine (TrackScheduler, Player, overlays, TTS voice)
- [ ] MCP Server (tools wrapping the action vocabulary)
- [ ] Hybrid Spatial Awareness (Pre-computed summaries + MCP spatial query tools)
---
## Stage 6: Publisher Workflow
**Demo:** "A plugin author submits their plugin. After review, it appears in the catalog."
- [ ] Marketplace user accounts (Supabase Auth — email/password + GitHub OAuth)
- [ ] Publisher submission form (upload bundle, fill metadata, declare capabilities)
- [ ] Admin review queue (approve/reject with notes)
- [ ] Version management (semver, changelogs)
- [ ] Publisher dashboard (install counts, download analytics)
- [ ] Publisher namespaces (`publisher.plugin-name`)
---
## Stage 7: Cloud Platform & Accounts
**Demo:** "User registers, gets [user].app.worldwideview.dev, installs plugins from marketplace."
- [ ] `app.worldwideview.dev` — auth/register/dashboard
- [ ] Auto-provisioning on signup (tenant DB row → instance live immediately)
- [ ] RLS tenant isolation in PostgreSQL
- [ ] Cloud edition adapters (`auth.ts`, `storage.ts`, `tenant.ts`)
- [ ] Runtime settings store + setup wizard
- [ ] License key validation with RSA public key
- [ ] Tier gating (free/pro/enterprise feature flags)
- [ ] Cloudflare Turnstile + nginx rate limiting for bot prevention
- [ ] SSO: marketplace redirects to `app.worldwideview.dev` for login
---
## Stage 8: Built-In Data Services
**Demo:** "Aviation and maritime data with full history, served from api.worldwideview.dev."
- [ ] `api.worldwideview.dev` — aviation/maritime polling + persistence
- [ ] Redesign aviation as declarative plugin pointing to `api.worldwideview.dev`
- [ ] Redesign maritime the same way
- [ ] History/timeline with `%t` parameter substitution
- [ ] Snapshot capture (pro tier — counts toward storage quota)
- [ ] API key proxy with per-tenant-per-plugin rate limiting and response caching
---
## Stage 9: Trust Tiers, Extensions & Polish
**Demo:** "Install a verified extension plugin that adds cockpit view to aviation."
- [x] Ed25519-signed plugin registry (`GET /api/registry` on marketplace)
- [x] Server-side trust stamping at install time
- [x] Trust tier badges (`TrustBadge` component — Official / Verified / Unverified)
- [x] Unverified plugin warning dialog (`UnverifiedPluginDialog` + `useMarketplaceSync`)
- [ ] Extension plugin type support in `PluginManager`
- [ ] Activation events and contribution points
- [ ] Capability enforcement at runtime (`PluginPermissionError`)
- [ ] Web Worker sandboxing for unverified plugins (`comlink`)
- [ ] Reviews & ratings system
- [ ] Extension packs (bundles of related plugins)
- [ ] Auto-update mechanism (local: manual opt-in; cloud: automatic CDN swap)
- [ ] Plausible/Umami self-hosted analytics
---
## Stage 10: Infrastructure & Monetization
**Demo:** "Buy Pro, paste license key, unlock snapshot history and higher rate limits."
- [ ] Coolify on ThinkPad T480s — deploy all services
- [ ] Uptime Kuma monitoring (all subdomains)
- [ ] Stripe Checkout for license purchase
- [ ] Storage quota enforcement (cloud only)
- [ ] Stripe Connect for marketplace revenue split on paid plugins
- [ ] Cloudflare R2 as CDN for plugin bundles (`cdn.worldwideview.dev`)
---
## Resolved Architectural Decisions
| Decision | Resolution |
|---|---|
| **License** | EL2.0 for WorldWideView core; Open Source for marketplace |
| **Shared types** | `@worldwideview/plugin-sdk` npm package (MIT) |
| **Hosting** | Coolify (ThinkPad T480s). Landing page on Vercel (static export) |
| **Database** | Supabase PostgreSQL (cloud), SQLite (local), Prisma ORM |
| **Tenant isolation** | Row-Level Security (RLS) in shared PostgreSQL |
| **User settings** | Runtime settings store in DB, not `.env` |
| **Bot prevention** | Email verification + Cloudflare Turnstile + rate limiting |
| **Plugin execution** | Client-side (browser), not server-side |
| **Plugin architecture** | VS Code model — activation events, contribution points, namespaces |
| **Server-side compute** | Not supported — third-party backends handle compute |
| **Auth** | Auth.js on `app.worldwideview.dev`. `Credentials` (local), `@auth/supabase-adapter` (cloud). Marketplace uses SSO redirect |
| **Instance provisioning** | Auto-provision on signup — just a DB row insert |
| **API proxy** | `apikey` plugins routed through cached proxy, per-tenant-per-plugin rate limits |
| **History** | Third-party `historyUrl` with `%t` (all tiers), WWV snapshot capture (pro only) |
| **Built-in data** | Aviation/maritime → declarative plugins → `api.worldwideview.dev` |
| **CI/CD** | GitHub Actions → GHCR → Coolify webhook |
| **Plugin trust registry** | Ed25519-signed JSON, public key hardcoded in WWV, trust stamped server-side at install |
| **Package manager** | pnpm workspaces (migrated from npm) |
| **NPM submission flow** | Admin enters package name → marketplace infers manifest from `"worldwideview"` block in `package.json` |
| **NPM caching** | `NpmCache` table decouples marketplace from live NPM registry |
-46
View File
@@ -1,46 +0,0 @@
# WorldWideView — Phase 1 MVP Task Breakdown
## Planning
- [/] Explore existing codebase and understand project state
- [/] Write implementation plan for Phase 1 MVP
- [ ] Get user approval on implementation plan
## Phase 1: Project Scaffolding
- [ ] Initialize Next.js + TypeScript project with App Router
- [ ] Configure CesiumJS integration (Webpack, static assets, SSR bypass)
- [ ] Set up design system (CSS custom properties, glassmorphism, typography)
- [ ] Configure Zustand state management
- [ ] Set up path aliases and project structure
## Phase 2: Core Globe Component
- [ ] Implement `GlobeView.tsx` — CesiumJS viewer with Google 3D Tiles
- [ ] Implement `CameraController.ts` — cinematic fly-to, orbit mode, presets
- [ ] Implement `LayerRenderer.ts` — entity rendering, clustering, progressive disclosure
- [ ] Implement `TimelineSync.ts` — clock sync, time-window filtering, playback
## Phase 3: Plugin System
- [ ] Define `PluginTypes.ts` — `WorldPlugin` interface, `GeoEntity`, `LayerConfig`
- [ ] Implement `PluginManager.ts` — lifecycle, polling, data routing
- [ ] Implement `PluginRegistry.ts` — static + dynamic registration
- [ ] Implement `DataBus.ts` — event bus for cross-plugin communication
- [ ] Implement `CacheLayer.ts` — in-memory + IndexedDB caching
- [ ] Implement `PollingManager.ts` — per-plugin refresh
## Phase 4: Built-in Plugins (MVP)
- [ ] Aviation plugin (OpenSky Network)
- [ ] Maritime plugin (AIS feeds)
- [ ] Wildfire plugin (NASA FIRMS)
- [ ] Backend API proxy routes for each plugin
## Phase 5: UI Components
- [ ] `AppShell.tsx` — full-viewport layout with floating panels
- [ ] `Header.tsx` — branding, search, region presets, time selector
- [ ] `LayerPanel.tsx` — toggleable layer list grouped by category
- [ ] `Timeline.tsx` — horizontal scrubber with playback controls
- [ ] `IntelPanel.tsx` — entity detail and intelligence sidebar
- [ ] Global CSS design system (dark mode, glassmorphism, animations)
## Phase 6: Verification
- [ ] Build verification (`npm run build` + type-check)
- [ ] Browser verification — globe renders, layers toggle, camera presets work
- [ ] Manual verification — time scrubbing, responsive layout, API proxies
Symlink
+1
View File
@@ -0,0 +1 @@
C:/dev/worldwideview/agents.md
+1
View File
@@ -0,0 +1 @@
{"message":"fix(aviation): implement exponential backoff for rate limits","tree":"55c74a09dac7ce178ecf94d5cb48b2502e57e759","parents":["e25ddc0b648b757ea32b7376bab50d8e75d6d330"]}
+54
View File
@@ -0,0 +1,54 @@
const fs = require("fs");
const { execSync } = require("child_process");
const uuidsToDelete = [
"i331gbc1zzytx7via8lntdm6",
"pow71xsobdas7etf5r3hy5ug",
"l79dyd03lhtcpgi7swkoxm55",
"ry6160tpy4gh2xjfwr011no0",
"gfe78t8jm53lltentz19ze60",
"e1cg7q8khyvpti5rkp351559",
"c35cvvqxhdbslk8yc24g04wk",
"ijj9pqkavlusy2wmzsbjtc74",
"ghe6bzlr6ex6j51lgxzyhd46",
"h3v45w2u1essulzeg56i27a3",
"oxk05amog4fla0lskmkfx64x",
"yxm4mn60lfp9qah0q4yf2hij",
"ezjxo4ehs96lv0ji1n2r0auw",
"t12x7pgptsqiu5gbvv35gun5",
"urq1ll00a3vv9on6pulmpofe",
"eb5zgw5wlgvio2gggbiphpam",
"ld1h3pody4nxj3b44pbskl53",
"x111xfygqxrlbf5wqlx59f6d",
"se1weqr4dj7thp4p1l055wfc",
"cqses6urxff0n94i0u6lktzt",
"nvcir33nyuvzk5niy3s7eg9w",
"s63onga2s6v8r3k10lrdwzth",
"cf3uedqnjmwv48h7tm91d95r",
"o9124dnnieau9wxoefyxvfgu",
"kxzobc8qlvigbsk1d35dpiyi",
"eh8lzjbsy2c9kwj2emztcmf6",
"umfsos2vcmotfk2cfpqdoycc",
"yn1mdh0fngiati6r4625qvv9"
];
const token = "1|vPZPgvB8vVi8ZD5ZKS8lrCrwNlPofVv4I8Tjmqmyd01f92d2";
const baseUrl = "https://coolify.worldwideview.dev/api/v1";
const appUuid = "nmn55t4io3myfubs72worn7k";
async function run() {
for (const id of uuidsToDelete) {
console.log("Deleting", id);
try {
const res = await fetch(`${baseUrl}/applications/${appUuid}/envs/${id}`, {
method: "DELETE",
headers: { "Authorization": `Bearer ${token}` }
});
console.log(id, res.status);
} catch(e) {
console.error(e);
}
}
}
run();
+21
View File
@@ -0,0 +1,21 @@
services:
wwv:
build: .
ports:
- "3000:3000"
volumes:
- wwv-data:/app/data
env_file:
- path: .env
required: false
environment:
- "AUTH_SECRET=${AUTH_SECRET:-default_secret_for_local_dev}"
- "WWV_DEMO_ADMIN_SECRET=${WWV_DEMO_ADMIN_SECRET:-}"
- "WWV_BRIDGE_TOKEN=${WWV_BRIDGE_TOKEN:-}"
volumes:
wwv-data:
networks:
coolify:
external: true
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
# ─── Docker Entrypoint ───────────────────────────────────────
# Ensures the SQLite database exists and is migrated before
# starting the application. On first run with a fresh volume
# the DB file won't exist yet, so we run prisma migrate deploy.
set -e
mkdir -p ./data
echo "[entrypoint] Running database migrations..."
npx -y prisma migrate deploy
echo "[entrypoint] Migrations complete."
exec node server.js
+5 -3
View File
@@ -4,7 +4,9 @@ WorldWideView is a high-performance, event-driven geospatial intelligence engine
## Module Breakdown
1. **`src/core/plugins`**: The registration and lifecycle management layer. Defines how plugins are booted and destroyed.
1. **`src/core/plugins`**: The registration and lifecycle management layer.
- **PluginManager**: Orchestrator for enabling/disabling plugins.
- **InstalledPluginsLoader**: Dynamically discovers and loads external marketplace plugins at runtime via CDN bundles (e.g. UNPKG).
2. **`src/core/data`**: The "Heartbeat" of the system.
- **DataBus**: Decentralized event pipeline for all system actions.
- **PollingManager**: Intelligent scheduler for external API calls with backoff logic.
@@ -12,7 +14,7 @@ WorldWideView is a high-performance, event-driven geospatial intelligence engine
3. **`src/core/globe`**: The Rendering Engine.
- **Cesium Integration**: Low-level control over the Cesium Viewer.
- **EntityRenderer**: High-performance "Primitive" renderer.
4. **`src/plugins`**: Domain-specific logic (Aviation, Maritime, etc.).
4. **`packages/wwv-plugin-*`**: Monorepo plugin packages, externalized into standalone dynamically loaded CDNs.
## Performance: Primitives vs. Entities
@@ -20,7 +22,7 @@ One of our core design decisions is using **Cesium Primitives** instead of the s
| Feature | Entity API | Primitive API (WWV) |
|---|---|---|
| **Abstration** | High (Easy to use) | Low (Direct GPU access) |
| **Abstraction** | High (Easy to use) | Low (Direct GPU access) |
| **Overhead** | Significant per-entity JS objects | Minimal (Batched rendering) |
| **Max Capacity** | ~1,000 entities | **100,000+ points/billboards** |
| **WWV Use Case** | Info window content | Live data point visualization |
+22 -28
View File
@@ -5,46 +5,40 @@ Follow these steps to set up your development environment and get WorldWideView
## Requirements
- **Node.js**: v18.17 or higher (tested on v20+)
- **NPM**: v9 or higher
- **pnpm**: v8 or higher (`npm install -g pnpm`)
- **Browser**: Chrome, Firefox, or Edge (CesiumJS requires WebGL support)
## Environment Setup
WorldWideView requires several API keys to function correctly. You can copy the provided `.env.example` file to `.env.local` and fill in the values:
Run the setup script to auto-generate `.env.local` with a secure `AUTH_SECRET`:
```bash
cp .env.example .env.local
pnpm run setup
```
Or manually create a `.env.local` file in the root directory:
This copies `.env.example` → `.env.local` and fills in `AUTH_SECRET` automatically. You can then optionally add API keys for enhanced features (Cesium Ion, Bing Maps, OpenSky, etc.).
```env
# Cesium Ion Access Token (Required for terrain and default imagery)
NEXT_PUBLIC_CESIUM_ION_TOKEN=your_token_here
# Bing Maps API Key (Optional, for high-res imagery)
NEXT_PUBLIC_BING_MAPS_KEY=your_key_here
# Supabase Configuration (Required for persistence and historical data)
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
```
> [!NOTE]
> `AUTH_SECRET` must remain stable across restarts. The setup script generates it once and writes it to `.env.local`. Never commit `.env.local` to git.
## Running Locally
1. **Install Dependencies**:
```bash
npm install
pnpm install
```
2. **Start Dev Server**:
2. **Generate environment file** (first time only):
```bash
npm run dev
pnpm run setup
```
*Note: Our `dev` script automatically runs `predev` to copy Cesium assets to the public directory.*
3. **Open Browser**:
3. **Start Dev Server**:
```bash
pnpm run dev:all
```
4. **Open Browser**:
Navigate to [http://localhost:3000](http://localhost:3000).
## Folder Structure Explanation
@@ -53,9 +47,9 @@ Understanding the project layout:
```text
worldwideview/
├── .agents/ # Agentic AI workflows and memory
├── docs/ # Project documentation (Markdowns)
├── public/ # Static assets (Imagery, GeoJSON, Cesium dependencies)
├── docs/ # Project documentation
├── packages/ # Plugin packages (pnpm workspaces)
├── public/ # Static assets (GeoJSON data files, Cesium dependencies)
├── scripts/ # Build and utility scripts (e.g., copy-cesium.mjs)
└── src/
├── app/ # Next.js App Router (Layouts, Pages, API Routes)
@@ -64,8 +58,8 @@ worldwideview/
│ ├── data/ # Data management (DataBus, Polling, Cache)
│ ├── globe/ # Cesium-specific hooks and view logic
│ └── plugins/ # Plugin system base and registry
├── lib/ # Utility libraries and server-side polling
└── plugins/ # Feature-specific plugins (Aviation, Maritime, etc.)
├── lib/ # Utility libraries and server-side logic
└── plugins/ # Built-in plugins (Aviation, Maritime, etc.)
```
## Verification
@@ -77,5 +71,5 @@ To verify your setup:
---
> [!IMPORTANT]
> If you encounter issues with hot reloading (HMR), ensure you are running with the `--webpack` flag in the dev script (this is the default in our `package.json`).
> [!TIP]
> The database is created automatically on first run — no manual setup is required. If you need to reset it, delete `data/wwv.db` and restart the dev server.
Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

+362
View File
@@ -0,0 +1,362 @@
# Creating a WorldWideView Plugin
This guide walks you through building, publishing, and listing your own WorldWideView plugin from scratch.
---
## Overview
WorldWideView plugins display geospatial data on a 3D Cesium globe. Every plugin must implement the `WorldPlugin` interface from the **Plugin SDK** (`@worldwideview/wwv-plugin-sdk`).
There are **three plugin formats**:
| Format | Use Case | Example |
|---|---|---|
| **`static`** | GeoJSON file loaded at startup — no API calls at runtime | Military Bases, Nuclear Facilities, Embassies |
| **`bundle`** | Full TypeScript class with custom logic, live API data, UI components | Aviation, Maritime, Wildfire |
| **`declarative`** | JSON-only manifest that points to an external API — no code needed | *(Future)* |
---
## Prerequisites
- Node.js ≥ 18
- pnpm (`npm install -g pnpm`)
- A npm account (for publishing to the npm registry)
- The WorldWideView monorepo cloned locally
---
## Step 1 — Create Your Plugin Package
All plugins live under `packages/` in the monorepo.
```bash
mkdir packages/wwv-plugin-my-data
cd packages/wwv-plugin-my-data
```
Create `package.json`:
```json
{
"name": "@worldwideview/wwv-plugin-my-data",
"version": "1.0.0",
"description": "WorldWideView plugin — my custom data layer",
"main": "src/index.ts",
"types": "src/index.ts",
"files": ["src"],
"keywords": [
"worldwideview",
"worldwideview-plugin",
"geojson",
"cesium",
"globe"
],
"repository": {
"type": "git",
"url": "https://github.com/silvertakana/worldwideview.git",
"directory": "packages/wwv-plugin-my-data"
},
"license": "ISC",
"author": "WorldWideView",
"peerDependencies": {
"@worldwideview/wwv-plugin-sdk": "*"
},
"worldwideview": {
"id": "my-data",
"icon": "MapPin",
"category": "Custom",
"format": "bundle"
}
}
```
> [!IMPORTANT]
> The `"worldwideview"` object block is strictly required if you intend to publish your plugin to the WorldWideView Marketplace. The marketplace uses this internal manifest to determine how to categorize and display your plugin automatically.
> * `id`: The unique string identifier.
> * `icon`: The Lucide React icon name (e.g. `MapPin`, `Satellite`, `Plane`).
> * `category`: Must match an existing category (e.g. `Aviation`, `Maritime`, `Natural Disaster`, `Custom`).
> * `format`: Either `bundle`, `static`, or `declarative`.
> [!IMPORTANT]
> The SDK is declared as a **peer dependency**, not a direct dependency. The host application provides it at runtime.
---
## Step 2 — Write Your Plugin Code
Create `src/index.ts`. Here are examples for the two most common formats:
### Option A — Static GeoJSON Plugin (simplest)
For static plugins, the npm package is just metadata. The actual loading is handled by the `StaticDataPlugin` loader at runtime, driven by a manifest + GeoJSON file.
```typescript
/**
* @worldwideview/wwv-plugin-my-data
*
* Static GeoJSON plugin — my custom dataset.
*
* This package exists for npm registry metadata. The actual plugin logic
* is handled by WorldWideView's StaticDataPlugin loader at runtime using
* the manifest + GeoJSON data file served from the host application.
*/
export const PLUGIN_ID = "my-data" as const;
```
For static plugins you also need:
1. A **GeoJSON file** placed at `public/data/my_data.geojson` in the main app
2. A **manifest entry** in the marketplace (see Step 4)
### Option B — Bundle Plugin (full control)
For bundle plugins, you write a class that implements the `WorldPlugin` interface:
```typescript
import type {
WorldPlugin,
GeoEntity,
TimeRange,
PluginContext,
LayerConfig,
CesiumEntityOptions,
} from "@worldwideview/wwv-plugin-sdk";
export class MyDataPlugin implements WorldPlugin {
// ─── Required Metadata ──────────────────────────────
id = "my-data";
name = "My Data Layer";
description = "Displays custom points on the globe.";
icon = "MapPin"; // Lucide icon name (string)
category = "custom" as const;
version = "1.0.0";
// ─── Lifecycle ──────────────────────────────────────
async initialize(ctx: PluginContext): Promise<void> {
// Called once when the plugin is loaded.
// Use ctx.apiBaseUrl, ctx.timeRange, ctx.onDataUpdate, etc.
}
destroy(): void {
// Called when the plugin is unloaded. Clean up timers, sockets, etc.
}
// ─── Data ───────────────────────────────────────────
async fetch(timeRange: TimeRange): Promise<GeoEntity[]> {
// Fetch your data from an API and return GeoEntity objects.
const res = await fetch("https://api.example.com/points");
const data = await res.json();
return data.map((item: any) => ({
id: String(item.id),
pluginId: this.id,
latitude: item.lat,
longitude: item.lon,
altitude: 0,
timestamp: new Date(),
label: item.name,
properties: { type: item.type },
}));
}
getPollingInterval(): number {
return 60_000; // Re-fetch every 60 seconds
}
// ─── Rendering ──────────────────────────────────────
getLayerConfig(): LayerConfig {
return {
color: "#3b82f6",
clusterEnabled: true,
clusterDistance: 40,
maxEntities: 5000,
};
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "point",
color: "#3b82f6",
size: 8,
};
}
}
```
---
## Step 3 — Publish to npm
```bash
cd packages/wwv-plugin-my-data
pnpm publish --access public
```
> [!NOTE]
> The marketplace pulls metadata (version, description, keywords, readme) directly from the npm registry. You do not need to duplicate this information anywhere else.
---
## Step 4 — Submit to the Marketplace
Once your package is published to npm, submit it for listing in the WorldWideView Marketplace:
1. Go to [marketplace.worldwideview.dev/submit](https://marketplace.worldwideview.dev/submit) (or open the Admin UI on a local marketplace instance)
2. Enter your **npm package name** (e.g. `@worldwideview/wwv-plugin-my-data`)
3. The marketplace automatically fetches your metadata from npm and reads the `"worldwideview"` block from your `package.json`
4. Your plugin enters a **pending** state for review
5. Once approved, it appears in the browse catalog
> [!IMPORTANT]
> The `"worldwideview"` block in your `package.json` is required for submission. Make sure `id`, `icon`, `category`, and `format` are correctly set before publishing.
### For static format plugins
If your plugin uses `"format": "static"`, your **GeoJSON file** must be hosted and accessible at a public URL, or included in the `public/data/` folder of the host WorldWideView application. The `dataFile` path in your manifest should point to that URL.
If you are contributing a plugin for inclusion in the official WorldWideView release, place the GeoJSON at `public/data/<name>.geojson` and open a pull request.
---
## Step 5 — Test Locally
1. Start all WorldWideView services: `pnpm run dev:all` (in the monorepo root)
2. (Wait for both the main app and marketplace to start)
3. Open the marketplace at `http://localhost:3001/browse`
4. Find your plugin and click **Install**
5. Verify the data appears on the globe at `http://localhost:3000`
---
## SDK Interface Reference
The `WorldPlugin` interface requires these properties and methods:
### Required Properties
| Property | Type | Description |
|---|---|---|
| `id` | `string` | Unique plugin identifier (e.g., `"my-data"`) |
| `name` | `string` | Display name shown in the sidebar |
| `description` | `string` | Short description |
| `icon` | `string \| ComponentType` | Lucide icon name or React component |
| `category` | `PluginCategory` | One of: `aviation`, `maritime`, `conflict`, `natural-disaster`, `infrastructure`, `cyber`, `economic`, `custom` |
| `version` | `string` | Semver version string |
### Required Methods
| Method | Returns | Description |
|---|---|---|
| `initialize(ctx)` | `Promise<void>` | Set up the plugin. Receives `PluginContext` with API URLs, time range, callbacks |
| `destroy()` | `void` | Clean up resources (timers, sockets, etc.) |
| `fetch(timeRange)` | `Promise<GeoEntity[]>` | Return the data to display on the globe |
| `getPollingInterval()` | `number` | Milliseconds between `fetch()` calls |
| `getLayerConfig()` | `LayerConfig` | Layer appearance (color, clustering, limits) |
| `renderEntity(entity)` | `CesiumEntityOptions` | How each entity renders on the globe |
### Optional Methods
| Method | Returns | Description |
|---|---|---|
| `getSelectionBehavior(entity)` | `SelectionBehavior \| null` | Trail / fly-to on click |
| `getServerConfig()` | `ServerPluginConfig` | Server-side API routing |
| `getFilterDefinitions()` | `FilterDefinition[]` | Declarative filter UI |
| `getSidebarComponent()` | `ComponentType` | Custom sidebar panel |
| `getDetailComponent()` | `ComponentType<{ entity }>` | Custom detail panel |
| `getSettingsComponent()` | `ComponentType<{ pluginId }>` | Custom settings panel |
### Key Types
```typescript
interface GeoEntity {
id: string;
pluginId: string;
latitude: number;
longitude: number;
altitude?: number;
heading?: number;
speed?: number;
timestamp: Date;
label?: string;
properties: Record<string, unknown>;
}
interface LayerConfig {
color: string;
iconUrl?: string;
clusterEnabled: boolean;
clusterDistance: number;
minZoomLevel?: number;
maxEntities?: number;
}
interface CesiumEntityOptions {
type: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
size?: number;
iconUrl?: string;
rotation?: number;
modelUrl?: string;
modelScale?: number;
// ... more options
}
```
---
## Real Examples
### Borders Plugin (bundle format)
A minimal bundle plugin that implements the `WorldPlugin` interface directly:
- **Source**: `packages/wwv-plugin-borders/src/index.ts`
- **npm**: `@worldwideview/wwv-plugin-borders`
### Military Bases Plugin (static format)
A static GeoJSON plugin where the npm package is just metadata:
- **Source**: `packages/wwv-plugin-military-bases/src/index.ts`
- **GeoJSON**: `public/data/military_bases.geojson`
- **npm**: `@worldwideview/wwv-plugin-military-bases`
- **Manifest**: Defined in `worldwideview-marketplace/src/data/pluginManifests.ts`
---
## How It All Connects
```
Developer writes plugin
│
▼
Publish to npm ► npm registry (stores version, description, keywords, readme)
│
▼
Submit npm package name to Marketplace
│
▼
Marketplace fetches metadata from npm ← npm registry
and reads the "worldwideview" block from package.json
│
▼
Review → Plugin appears in browse catalog
│
▼
User clicks "Install"
│
▼
Marketplace sends manifest to WorldWideView instance
│
▼
Plugin saved to database (Prisma) → loaded on next startup
│
▼
loadPluginFromManifest() routes by format:
static → StaticDataPlugin (GeoJSON loader)
bundle → dynamic import()
│
▼
Plugin renders on the 3D globe
```
@@ -0,0 +1,216 @@
# Plugin Architecture Migration Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Migrate the WorldWideView plugin architecture from compile-time hardcoded imports to a dynamic, runtime-loaded ecosystem where external developers can build, host, and distribute plugins without touching the core repository.
**Architecture:** We will introduce a bundler (`tsup`) to the SDK to compile `bundle` plugins into browser-ready ECMAScript Modules (ESM). We will expose shared dependencies (`react`, `cesium`, `lucide-react`) via a global `window.__WWV_SHARED__` object. Finally, we will refactor `AppShell.tsx` to dynamically load all plugins at runtime via `import(/* webpackIgnore: true */)`, removing the hardcoded imports, and we will update `loadPluginFromManifest.ts` to seamlessly handle the global dependency injection.
**Tech Stack:** Next.js, React, CesiumJS, tsup.
---
## User Review Required
> [!WARNING]
> **Breaking Change**: This migration will decouple your built-in plugins from `AppShell.tsx`. They will now act as true "external" plugins that are loaded at runtime. During the transition, if the build steps aren't executed, the plugins will temporarily stop appearing on the globe. We will mitigate this by ensuring the build step runs before `next dev`.
> [!IMPORTANT]
> **Static GeoJSON Files**: Since static `.geojson` files currently live in `public/data`, we will leave them there during phase 1 of this migration to ensure the app doesn't break, but we will point the plugin manifests to load them via absolute or absolute-relative URLs (`/data/...`). In phase 2, we will introduce a symlink script to move them out of `public` entirely.
## Open Questions
1. **Build Tool Choice**: I am proposing `tsup` because it requires zero configuration to output multiple formats, automatically externalizes dependencies, and natively transpiles TypeScript/React. Are you comfortable adding `tsup` to the `wwv-plugin-sdk` package?
2. **Local Serving**: To test "built-in" plugins using the dynamic loading method, we need the Next.js app to serve their compiled `plugin.js` bundles. My plan adds a quick copy script to the root `package.json` that copies their `dist` folders into `public/builtin-plugins/` so they can be fetched locally via HTTP. Does this sound good?
## Proposed Changes
### Task 1: Initialize Global Shared Dependencies
**Files:**
- Modify: `c:\dev\worldwideview\src\components\layout\AppShell.tsx`
- Create: `c:\dev\worldwideview\src\core\plugins\PluginGlobals.ts`
- [ ] **Step 1: Create the PluginGlobals initializer**
```typescript
import React from "react";
import ReactDOM from "react-dom";
import * as ReactDomServer from "react-dom/server";
import { Plane, Ship, Camera, Shield, Flame, Map, Swords, Atom, Landmark, Mountain, PlaneTakeoff, Anchor, Lamp, Rocket, SunMoon, Cable, Pickaxe, ShieldAlert, Crosshair, SatelliteDish, Hand, Radar, Scale } from "lucide-react";
import * as Cesium from "cesium";
import * as WWVPluginSDK from "@worldwideview/wwv-plugin-sdk";
export function initPluginGlobals() {
if (typeof window === "undefined") return;
// Create a registry of Lucide icons commonly used by plugins to prevent them from bundling the massive icon library
const lucideIcons = {
Plane, Ship, Camera, Shield, Flame, Map, Swords, Atom, Landmark, Mountain,
PlaneTakeoff, Anchor, Lamp, Rocket, SunMoon, Cable, Pickaxe, ShieldAlert,
Crosshair, SatelliteDish, Hand, Radar, Scale
};
(window as any).__WWV_SHARED__ = {
"react": React,
"react-dom": ReactDOM,
"react-dom/server": ReactDomServer,
"cesium": Cesium,
"@worldwideview/wwv-plugin-sdk": WWVPluginSDK,
"lucide-react": lucideIcons
};
}
```
- [ ] **Step 2: Inject globals in AppShell before anything loads**
In `AppShell.tsx`, import and call `initPluginGlobals()` at the top of the file, outside of any React components.
```tsx
import { initPluginGlobals } from "@/core/plugins/PluginGlobals";
import dynamic from "next/dynamic";
// Initialize globals immediately so they exist before any dynamic imports
if (typeof window !== "undefined") {
initPluginGlobals();
}
//... rest of the file
```
### Task 2: Configure SDK Build Tool (`tsup`)
**Files:**
- Modify: `c:\dev\worldwideview\packages\wwv-plugin-sdk\package.json`
- Create: `c:\dev\worldwideview\packages\wwv-plugin-sdk\bin\wwv-plugin-build.js`
- [ ] **Step 1: Add tsup dependency**
Run: `pnpm --filter @worldwideview/wwv-plugin-sdk add -D tsup`
- [ ] **Step 2: Create the wwv-plugin-build CLI wrapper**
Add this to `wwv-plugin-sdk/bin/wwv-plugin-build.js`:
```javascript
#!/usr/bin/env node
const { build } = require("tsup");
const path = require("path");
async function run() {
const cwd = process.cwd();
await build({
entry: ["src/index.ts"],
outDir: "dist",
format: ["esm"],
target: "es2022",
clean: true,
dts: false,
minify: false,
sourcemap: true,
// Mark all these as externals so they aren't bundled
external: ["react", "react-dom", "cesium", "@worldwideview/wwv-plugin-sdk", "lucide-react"],
// Provide a shim that converts bare imports into global lookups
esbuildPlugins: [{
name: "wwv-globals",
setup(build) {
build.onResolve({ filter: /^(react|react-dom|cesium|@worldwideview\/wwv-plugin-sdk|lucide-react)$/ }, args => {
return { path: args.path, namespace: "wwv-global" };
});
build.onLoad({ filter: /.*/, namespace: "wwv-global" }, args => {
let globalKey = args.path;
if (args.path === "lucide-react") return { contents: `module.exports = window.__WWV_SHARED__["lucide-react"];` };
return { contents: `module.exports = window.__WWV_SHARED__["${globalKey}"];` };
});
}
}]
});
}
run();
```
- [ ] **Step 3: Update SDK package.json to expose the bin**
```json
"bin": {
"wwv-plugin-build": "./bin/wwv-plugin-build.js"
},
```
### Task 3: Refactor Plugins to use Build Tool and Manifests
**Files:**
- Modify: `wwv-plugin-aviation/package.json`
- Modify: `wwv-plugin-aviation/plugin.json` (Create)
- [ ] **Step 1: Add build script to aviation plugin**
```json
"scripts": {
"build": "wwv-plugin-build"
},
```
- [ ] **Step 2: Create plugin.json for aviation**
```json
{
"id": "aviation",
"name": "Aviation",
"version": "1.0.7",
"type": "data-layer",
"format": "bundle",
"trust": "built-in",
"capabilities": ["data:own", "network:fetch"],
"category": "aviation",
"icon": "Plane",
"entry": "/builtin-plugins/aviation/index.mjs"
}
```
*(Repeat for all other built-in plugins)*
### Task 4: Dynamic Initial Loader
**Files:**
- Modify: `c:\dev\worldwideview\src\components\layout\AppShell.tsx`
- Modify: `c:\dev\worldwideview\package.json`
- [ ] **Step 1: Remove Hardcoded Plugins**
In `AppShell.tsx`, delete the `builtIns` array and `import` statements at the top.
- [ ] **Step 2: Fetch and load all plugins via manifest**
Modify `AppShell.tsx` `startPlatform`:
```typescript
// Fetch the unified list of ALL installed plugins (both built-in and dynamic)
const res = await fetch("/api/marketplace/load");
if (res.ok) {
const data = await res.json();
for (const manifest of data.manifests) {
if (disabledIds.has(manifest.id)) continue;
try {
await pluginManager.loadFromManifest(manifest);
initLayer(manifest.id);
} catch (e) {
console.error("Failed to load plugin", manifest.id, e);
}
}
}
```
- [ ] **Step 3: Add predev copy-script**
Modify `package.json` to copy compiled plugin `dist` folders to `public/builtin-plugins` so the Next.js server can serve them at the `/builtin-plugins/...` path.
## Verification Plan
### Automated Tests
- Run `pnpm --filter wwv-plugin-aviation build` to ensure `tsup` generates a valid ES Module with no bundled React.
- Verify `dist/index.mjs` contains `window.__WWV_SHARED__["react"]` lookups.
### Manual Verification
- Start the Next.js server.
- Open network tab in browser and verify `GET /builtin-plugins/aviation/index.mjs` succeeds.
- Verify the Aviation plugin appears on the globe and renders planes successfully, indicating that it successfully retrieved Cesium and React from the global shared context.
@@ -0,0 +1,475 @@
# Demo Google AdSense Panel Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Add a Google AdSense vertical ad strip to the right side of the demo instance, with a dismissible banner explaining it's temporary to fund hosting.
**Architecture:** Three layers: (1) load the AdSense script conditionally in the root layout only when `isDemo` is true, (2) a reusable `AdUnit` client component that calls `adsbygoogle.push({})`, (3) a `DemoAdStrip` shell component that wraps the ad unit + a "why ads?" dismissible message, positioned as a fixed vertical strip on the right edge. CSP headers in `next.config.ts` must be updated to allow the AdSense domains.
**Tech Stack:** Next.js 16 (App Router, `next/script`), Google AdSense, vanilla CSS, Vitest
---
## File Structure
| File | Action | Responsibility |
|---|---|---|
| `src/app/layout.tsx` | MODIFY | Conditionally load AdSense `<Script>` for demo |
| `next.config.ts` | MODIFY | Add AdSense domains to CSP `script-src` and `frame-src` |
| `.env` | MODIFY | Add `NEXT_PUBLIC_ADSENSE_CLIENT_ID` placeholder |
| `src/components/ads/AdUnit.tsx` | CREATE | Generic reusable AdSense unit component |
| `src/components/ads/DemoAdStrip.tsx` | CREATE | Demo-only vertical strip: ad + "why ads?" message |
| `src/components/ads/DemoAdStrip.css` | CREATE | Styles for the vertical ad strip |
| `src/components/layout/AppShell.tsx` | MODIFY | Import and render `<DemoAdStrip />` |
| `src/types/adsense.d.ts` | CREATE | TypeScript ambient declaration for `window.adsbygoogle` |
---
> [!IMPORTANT]
> **Before starting:** You need a Google AdSense publisher ID (`ca-pub-XXXXXXXXXXXXXXXX`) and an ad slot ID. These go into `.env` as `NEXT_PUBLIC_ADSENSE_CLIENT_ID` and are passed to the ad unit component. You can get these from [Google AdSense](https://www.google.com/adsense/). Without them the ads will not render, but the component framework will still work.
---
### Task 1: TypeScript Ambient Declaration for AdSense
**Files:**
- Create: `src/types/adsense.d.ts`
- [ ] **Step 1: Create the ambient type declaration**
```ts
// src/types/adsense.d.ts
interface Window {
adsbygoogle: Array<Record<string, unknown>>;
}
```
- [ ] **Step 2: Commit**
```bash
git add src/types/adsense.d.ts
git commit -m "chore: add adsense ambient type declaration"
```
---
### Task 2: Environment Variable
**Files:**
- Modify: `.env`
- [ ] **Step 1: Add the AdSense client ID placeholder**
Add the following line to the end of `.env`:
```
# Google AdSense — only used on demo edition
NEXT_PUBLIC_ADSENSE_CLIENT_ID=
```
The actual value (`ca-pub-XXXXXXXXXXXXXXXX`) should be set in `.env.local` for local testing or in the deployment environment. The ad slot IDs will be hardcoded in the component since there's only one placement.
- [ ] **Step 2: Commit**
```bash
git add .env
git commit -m "chore: add NEXT_PUBLIC_ADSENSE_CLIENT_ID env var"
```
---
### Task 3: CSP Headers Update
**Files:**
- Modify: `next.config.ts:29-52`
- [ ] **Step 1: Update CSP in next.config.ts**
In the `headers()` function, modify the `script-src` and `frame-src` directives to allow AdSense domains.
```ts
// Change this line (line 39):
"script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://analytics.worldwideview.dev https://va.vercel-scripts.com",
// To this:
"script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://analytics.worldwideview.dev https://va.vercel-scripts.com https://pagead2.googlesyndication.com https://adservice.google.com https://www.googletagservices.com",
```
```ts
// Change this line (line 49):
"frame-src 'self' *.youtube.com *.youtube-nocookie.com *.twitch.tv *.vimeo.com *.webcamera.pl *.ivideon.com *.rtsp.me *.bnu.tv",
// To this:
"frame-src 'self' *.youtube.com *.youtube-nocookie.com *.twitch.tv *.vimeo.com *.webcamera.pl *.ivideon.com *.rtsp.me *.bnu.tv https://googleads.g.doubleclick.net https://tpc.googlesyndication.com",
```
- [ ] **Step 2: Commit**
```bash
git add next.config.ts
git commit -m "feat: add Google AdSense domains to CSP headers"
```
---
### Task 4: AdSense Script in Root Layout
**Files:**
- Modify: `src/app/layout.tsx:24-39`
- [ ] **Step 1: Conditionally load AdSense script for demo edition**
Add the AdSense `<Script>` tag inside `<head>`, using the `NEXT_PUBLIC_` env var for the client ID and the `NEXT_PUBLIC_WWV_EDITION` env var to gate loading.
```tsx
// src/app/layout.tsx — updated <head> section
<head>
{/* Load CesiumJS base styles (optional, but helps with UI widgets if used later) */}
<link rel="stylesheet" href="/cesium/Widgets/widgets.css" />
</head>
<body suppressHydrationWarning>
{children}
<Analytics />
<Script
src="https://analytics.worldwideview.dev/script.js"
data-website-id="2c8f6c09-2651-4a2a-af99-b8cee1612b9a"
strategy="afterInteractive"
/>
{process.env.NEXT_PUBLIC_WWV_EDITION === "demo" &&
process.env.NEXT_PUBLIC_ADSENSE_CLIENT_ID && (
<Script
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${process.env.NEXT_PUBLIC_ADSENSE_CLIENT_ID}`}
crossOrigin="anonymous"
strategy="afterInteractive"
/>
)}
</body>
```
> **Note:** We use the raw env var at the layout level (Server Component) rather than importing `isDemo` which uses `process.env.NEXT_PUBLIC_WWV_EDITION` anyway. This avoids importing the edition module into the root layout.
- [ ] **Step 2: Commit**
```bash
git add src/app/layout.tsx
git commit -m "feat: conditionally load AdSense script on demo edition"
```
---
### Task 5: Reusable AdUnit Component
**Files:**
- Create: `src/components/ads/AdUnit.tsx`
- [ ] **Step 1: Create the generic AdSense unit component**
```tsx
// src/components/ads/AdUnit.tsx
"use client";
import { useEffect, useRef } from "react";
interface AdUnitProps {
adSlot: string;
adFormat?: string;
style?: React.CSSProperties;
className?: string;
}
export function AdUnit({ adSlot, adFormat = "auto", style, className }: AdUnitProps) {
const pushed = useRef(false);
const clientId = process.env.NEXT_PUBLIC_ADSENSE_CLIENT_ID;
useEffect(() => {
if (pushed.current || !clientId) return;
try {
(window.adsbygoogle = window.adsbygoogle || []).push({});
pushed.current = true;
} catch (err) {
console.error("[AdUnit] AdSense push error:", err);
}
}, [clientId]);
if (!clientId) return null;
return (
<div className={className} style={style}>
<ins
className="adsbygoogle"
style={{ display: "block" }}
data-ad-client={clientId}
data-ad-slot={adSlot}
data-ad-format={adFormat}
data-full-width-responsive="false"
/>
</div>
);
}
```
> **Key detail:** The `pushed` ref prevents double-push on React strict mode / hot reload. `data-full-width-responsive="false"` prevents the ad from expanding beyond the container — critical for a fixed-width vertical strip.
- [ ] **Step 2: Commit**
```bash
git add src/components/ads/AdUnit.tsx
git commit -m "feat: add reusable AdUnit component"
```
---
### Task 6: DemoAdStrip Component + Styles
**Files:**
- Create: `src/components/ads/DemoAdStrip.tsx`
- Create: `src/components/ads/DemoAdStrip.css`
- [ ] **Step 1: Create the CSS for the vertical ad strip**
```css
/* src/components/ads/DemoAdStrip.css */
.demo-ad-strip {
position: fixed;
right: 0;
top: 0;
bottom: 0;
width: 160px;
z-index: 45;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-md);
padding: var(--space-sm);
pointer-events: none;
transition: transform var(--duration-slow) var(--ease-smooth),
opacity var(--duration-slow) var(--ease-smooth);
}
.demo-ad-strip--hidden {
transform: translateX(200px);
opacity: 0;
}
.demo-ad-strip__ad {
pointer-events: auto;
width: 160px;
min-height: 600px;
}
.demo-ad-strip__banner {
pointer-events: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-xs);
padding: var(--space-sm) var(--space-md);
background: var(--bg-glass);
backdrop-filter: blur(var(--glass-blur));
-webkit-backdrop-filter: blur(var(--glass-blur));
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
max-width: 160px;
text-align: center;
cursor: pointer;
transition: all var(--duration-fast) var(--ease-smooth);
}
.demo-ad-strip__banner:hover {
border-color: rgba(var(--accent-rgb), 0.3);
box-shadow: var(--glow-cyan);
}
.demo-ad-strip__banner-label {
font-size: 9px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--text-muted);
}
.demo-ad-strip__banner-text {
font-size: 11px;
line-height: 1.4;
color: var(--text-secondary);
}
.demo-ad-strip__close {
position: absolute;
top: var(--space-xs);
right: var(--space-xs);
width: 20px;
height: 20px;
border-radius: 50%;
background: transparent;
border: none;
color: var(--text-muted);
font-size: 12px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: color var(--duration-fast) var(--ease-smooth);
}
.demo-ad-strip__close:hover {
color: var(--text-primary);
}
/* Hide on mobile — ads shouldn't overlay the full-screen globe */
@media (max-width: 768px) {
.demo-ad-strip {
display: none;
}
}
```
- [ ] **Step 2: Create the DemoAdStrip component**
```tsx
// src/components/ads/DemoAdStrip.tsx
"use client";
import { useState } from "react";
import { isDemo } from "@/core/edition";
import { AdUnit } from "./AdUnit";
import { X } from "lucide-react";
import "./DemoAdStrip.css";
/** The ad slot ID for the vertical skyscraper unit — set this in AdSense dashboard. */
const VERTICAL_AD_SLOT = "REPLACE_WITH_YOUR_AD_SLOT_ID";
export function DemoAdStrip() {
const [showMessage, setShowMessage] = useState(false);
const [closed, setClosed] = useState(false);
if (!isDemo || closed) return null;
return (
<aside className="demo-ad-strip" aria-label="Sponsored content">
<AdUnit
adSlot={VERTICAL_AD_SLOT}
adFormat="vertical"
className="demo-ad-strip__ad"
/>
<div
className="demo-ad-strip__banner"
onClick={() => setShowMessage((prev) => !prev)}
role="button"
tabIndex={0}
onKeyDown={(e) => { if (e.key === "Enter") setShowMessage((prev) => !prev); }}
>
<button
className="demo-ad-strip__close"
onClick={(e) => { e.stopPropagation(); setClosed(true); }}
aria-label="Dismiss ad panel"
>
<X size={12} />
</button>
<span className="demo-ad-strip__banner-label">Why ads?</span>
{showMessage ? (
<span className="demo-ad-strip__banner-text">
This isn&apos;t permanent — it&apos;s temporary because I&apos;m a single
dev and need to cover hosting costs. Thank you for understanding.
</span>
) : (
<span className="demo-ad-strip__banner-text">
Click to learn more
</span>
)}
</div>
</aside>
);
}
```
- [ ] **Step 3: Commit**
```bash
git add src/components/ads/DemoAdStrip.tsx src/components/ads/DemoAdStrip.css
git commit -m "feat: add DemoAdStrip with Google AdSense vertical unit"
```
---
### Task 7: Integrate into AppShell
**Files:**
- Modify: `src/components/layout/AppShell.tsx:8-9,168`
- [ ] **Step 1: Add import**
After the existing `CameraStatsPanel` import (line 8), add:
```tsx
import CameraStatsPanel from "@/components/panels/CameraStatsPanel";
import { DemoAdStrip } from "@/components/ads/DemoAdStrip"; // ADD THIS
import { Timeline } from "@/components/timeline/Timeline";
```
- [ ] **Step 2: Add the JSX**
After `<EntityInfoCard />` (line 168), add:
```tsx
<EntityInfoCard />
<DemoAdStrip />
<Timeline />
```
- [ ] **Step 3: Commit**
```bash
git add src/components/layout/AppShell.tsx
git commit -m "feat: integrate DemoAdStrip into AppShell"
```
---
### Task 8: ads.txt for AdSense Verification
**Files:**
- Create: `public/ads.txt`
- [ ] **Step 1: Create ads.txt**
```
google.com, ca-pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
```
> Replace `ca-pub-XXXXXXXXXXXXXXXX` with your actual publisher ID. This file is required by AdSense for domain verification.
- [ ] **Step 2: Commit**
```bash
git add public/ads.txt
git commit -m "chore: add ads.txt for AdSense domain verification"
```
---
## Open Questions
> [!IMPORTANT]
> **Do you have a Google AdSense publisher ID yet?** If not, you'll need to sign up at https://www.google.com/adsense/ and get your `ca-pub-XXXX` ID and create a 160x600 "Wide Skyscraper" ad unit to get the slot ID. The code will render nothing gracefully until these are configured.
> [!WARNING]
> **CSP changes are required for AdSense to work.** The current CSP is restrictive and blocks `pagead2.googlesyndication.com` and `googleads.g.doubleclick.net`. Task 3 adds them. Without this, ads will be silently blocked by the browser.
---
## Verification Plan
### Manual Verification
1. Set `NEXT_PUBLIC_WWV_EDITION=demo` and `NEXT_PUBLIC_ADSENSE_CLIENT_ID=ca-pub-XXXX` in `.env.local`
2. Run `pnpm dev`
3. Verify: A 160px vertical strip appears on the right edge of the screen
4. Verify: The "Why ads?" banner is clickable and toggles the explanation message
5. Verify: Clicking the X dismisses the entire strip
6. Verify: On mobile viewport widths (< 768px), the strip is hidden
7. Verify: Set `NEXT_PUBLIC_WWV_EDITION=local` → strip does not render at all
8. Verify: Browser console shows no CSP violations related to AdSense domains
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,145 @@
# Expand OSM Chips Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Expand the available OSM search chips to include a curated list of ~30 pre-loaded OSINT-relevant tags, and add a live Taginfo API autocomplete search to dynamically find and select any of the millions of other OSM tags.
**Architecture:** We will replace the current small `COMMON_TAGS` array with a richer, categorized list inside the `OSMSidebar` file. To allow access to "all" tags without crashing the UI, we will add a debounced fetch hook that hits `https://taginfo.openstreetmap.org/api/4/tags/popular` (or the equivalent search endpoint) when the user types in the filter box. These dynamically fetched tags will temporarily populate the chip list.
**Tech Stack:** React, TypeScript, Taginfo API
---
### Task 1: Update Pre-Loaded COMMON_TAGS
**Files:**
- Modify: `c:\dev\worldwideview\packages\wwv-plugin-osm-search\src\components\OSMSidebar.tsx:6-11`
- [ ] **Step 1: Replace existing COMMON_TAGS array**
```tsx
const COMMON_TAGS = [
// Military & Security
"military=base", "military=bunker", "amenity=police", "amenity=prison",
// Aviation & Maritime
"aeroway=aerodrome", "aeroway=helipad", "aeroway=hangar", "man_made=pier", "harbour=yes",
// Infrastructure & Utilities
"power=plant", "power=substation", "telecom=antenna", "man_made=communications_tower", "man_made=water_tower",
// Transport
"highway=bus_stop", "railway=station", "amenity=fuel", "amenity=parking",
// Medical & Emergency
"amenity=hospital", "amenity=fire_station", "amenity=clinic",
// General Commercial & Industrial
"shop=supermarket", "tourism=hotel", "industrial=factory", "landuse=industrial",
// Education & Amenities
"amenity=school", "amenity=university", "amenity=cafe", "building=house"
];
```
- [ ] **Step 2: Commit**
```bash
git add packages/wwv-plugin-osm-search/src/components/OSMSidebar.tsx
git commit -m "feat(osm-search): expand quick preset tags with OSINT categories"
```
### Task 2: Implement Taginfo Dynamic Autocomplete
**Files:**
- Modify: `c:\dev\worldwideview\packages\wwv-plugin-osm-search\src\components\OSMSidebar.tsx`
- [ ] **Step 1: Add state and debounced fetch logic inside OSMSidebar component**
```tsx
const [searchText, setSearchText] = useState("");
const [activeTags, setActiveTags] = useState<string[]>([]);
const [dynamicTags, setDynamicTags] = useState<string[]>([]);
const [isSearchingApi, setIsSearchingApi] = useState(false);
// Add this useEffect below the useState hooks
React.useEffect(() => {
if (searchText.length < 3) {
setDynamicTags([]);
return;
}
const timer = setTimeout(async () => {
setIsSearchingApi(true);
try {
// Fetch tags matching the search term from OSM Taginfo
const res = await fetch(`https://taginfo.openstreetmap.org/api/4/search/by_keyword?query=${encodeURIComponent(searchText)}`);
const data = await res.json();
if (data && data.data) {
// Extract exact key=value pairs or just keys, format as "key=value"
const tags = data.data
.filter((item: any) => item.key && item.value)
.map((item: any) => `${item.key}=${item.value}`)
.slice(0, 15); // Limit to top 15 results
setDynamicTags(tags);
}
} catch (err) {
console.error("Taginfo fetch failed", err);
} finally {
setIsSearchingApi(false);
}
}, 500); // 500ms debounce
return () => clearTimeout(timer);
}, [searchText]);
```
- [ ] **Step 2: Update rendering logic to merge static and dynamic tags**
Look for the `renderedTags` definition and replace it:
```tsx
// Combine filtered common tags with newly fetched dynamic tags, removing duplicates
const filteredCommon = searchText
? COMMON_TAGS.filter(t => t.toLowerCase().includes(searchText.toLowerCase()))
: COMMON_TAGS;
const renderedTags = Array.from(new Set([...filteredCommon, ...dynamicTags]));
```
- [ ] **Step 3: Add loading indicator to the search input area**
Look for the `<input>` element for `searchText` and wrap it/add a loading indicator:
```tsx
<div style={{ position: "relative" }}>
<input
style={{
width: "100%",
padding: "8px",
paddingRight: "24px",
backgroundColor: "rgba(0,0,0,0.3)",
color: "#fff",
border: "1px solid var(--border-subtle)",
borderRadius: "4px",
fontSize: "13px"
}}
placeholder="Filter or search OSM for tags..."
value={searchText}
onChange={e => setSearchText(e.target.value)}
/>
{isSearchingApi && (
<span style={{
position: "absolute",
right: "8px",
top: "50%",
transform: "translateY(-50%)",
fontSize: "10px",
color: "var(--text-muted)"
}}>
⏳
</span>
)}
</div>
```
- [ ] **Step 4: Commit**
```bash
git add packages/wwv-plugin-osm-search/src/components/OSMSidebar.tsx
git commit -m "feat(osm-search): add live Taginfo autocomplete for unlisted tags"
```
@@ -0,0 +1,139 @@
# Plugin Versioning Streamlining Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Refactor all WorldWideView plugin classes to derive their `version` property dynamically from their local `package.json` file rather than hardcoding string literals.
**Architecture:** We will replace the hardcoded `version = "x.y.z"` strings in the core `WorldPlugin` interface implementations across all monorepo packages. We will utilize TypeScript's JSON module resolution feature to `import pkg from "../package.json"` and map `version = pkg.version`. This ensures that `pnpm version patch` is the single source of truth and eliminates the double-bookkeeping that previously made CI fixes tedious.
**Tech Stack:** TypeScript, Next.js / bundler (JSON module resolution), pnpm workspaces.
---
## Task 1: Verify TypeScript Configuration
**Files:**
- Modify: N/A (Verification step)
- [ ] **Step 1: Check `tsconfig.json` for JSON resolution**
Run: `cat tsconfig.json | grep resolveJsonModule`
Expected: `"resolveJsonModule": true`
- [ ] **Step 2: Check compiler compatibility**
Run: `pnpm exec tsc --noEmit`
Expected: PASS (exit code 0)
## Task 2: Refactor Group A Plugins (Core Infrastructure)
**Files:**
- Modify: `packages/wwv-plugin-aviation/src/index.ts`
- Modify: `packages/wwv-plugin-maritime/src/index.ts`
- Modify: `packages/wwv-plugin-military-aviation/src/index.ts`
- [ ] **Step 1: Update plugin classes**
For each file above, modify the imports and the class body:
```typescript
import pkg from "../package.json";
// ...
export class AviationPlugin implements WorldPlugin { // (or extends BasePlugin)
// ...
version = pkg.version;
```
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for core infrastructure plugins [Patch]"
```
## Task 3: Refactor Group B Plugins (Facilities & Infrastructure)
**Files:**
- Modify: `packages/wwv-plugin-airports/src/index.ts`
- Modify: `packages/wwv-plugin-seaports/src/index.ts`
- Modify: `packages/wwv-plugin-spaceports/src/index.ts`
- Modify: `packages/wwv-plugin-embassies/src/index.ts`
- Modify: `packages/wwv-plugin-lighthouses/src/index.ts`
- Modify: `packages/wwv-plugin-nuclear/src/index.ts`
- Modify: `packages/wwv-plugin-undersea-cables/src/index.ts`
- Modify: `packages/wwv-plugin-mineral-mines/src/index.ts`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`.
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for facility plugins [Patch]"
```
## Task 4: Refactor Group C Plugins (Hazards & Events)
**Files:**
- Modify: `packages/wwv-plugin-earthquakes/src/index.ts`
- Modify: `packages/wwv-plugin-volcanoes/src/index.ts`
- Modify: `packages/wwv-plugin-wildfire/src/index.ts`
- Modify: `packages/wwv-plugin-conflict-events/src/index.tsx`
- Modify: `packages/wwv-plugin-conflict-zones/src/index.tsx`
- Modify: `packages/wwv-plugin-civil-unrest/src/index.tsx`
- Modify: `packages/wwv-plugin-cyber-attacks/src/index.tsx`
- Modify: `packages/wwv-plugin-international-sanctions/src/index.tsx`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`. Note that some files are `.tsx`.
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for event and hazard plugins [Patch]"
```
## Task 5: Refactor Group D Plugins (Misc & Utilities)
**Files:**
- Modify: `packages/wwv-plugin-satellite/src/index.ts`
- Modify: `packages/wwv-plugin-surveillance-satellites/src/index.tsx`
- Modify: `packages/wwv-plugin-osm-search/src/index.ts`
- Modify: `packages/wwv-plugin-iranwarlive/src/index.ts`
- Modify: `packages/wwv-plugin-daynight/src/index.ts`
- Modify: `packages/wwv-plugin-camera/src/index.ts`
- Modify: `packages/wwv-plugin-borders/src/index.ts`
- Modify: `packages/wwv-plugin-gps-jamming/src/index.tsx`
- Modify: `packages/wwv-plugin-air-defense/src/index.tsx`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`.
- [ ] **Step 2: Verify compilation and tests**
Run: `pnpm exec tsc --noEmit`
Run: `pnpm test`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for utility plugins [Patch]"
```
@@ -0,0 +1,124 @@
# Demo Default Plugins Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Enable specific plugins by default on the demo edition via environment variables so the user is immediately impressed.
**Architecture:** Update `layersSlice.ts` to accept an optional `defaultEnabled` parameter in `initLayer`. In `AppShell.tsx`, look up `NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS` when the edition is `demo`, and pass the flag true to `initLayer` for matching plugins during registration. Document the variable in `.env.example`.
**Tech Stack:** Next.js, Zustand, TypeScript.
---
### Task 1: Update layer slice definition
**Files:**
- Modify: `src/core/state/layersSlice.ts`
- [ ] **Step 1: Write the implementation**
Update `initLayer` in `src/core/state/layersSlice.ts` to accept a second parameter:
```typescript
// Add defaultEnabled parameter to the interface
export interface LayersSlice {
// ...
initLayer: (pluginId: string, defaultEnabled?: boolean) => void;
}
// ...
// Use the parameter in the state updater
initLayer: (pluginId, defaultEnabled = false) =>
set((state) => ({
layers: {
...state.layers,
[pluginId]: state.layers[pluginId] || { enabled: defaultEnabled, entityCount: 0, loading: false },
},
})),
```
- [ ] **Step 2: Commit**
```bash
git add src/core/state/layersSlice.ts
npm run commit -- "feat: add defaultEnabled param to initLayer in layers slice"
```
### Task 2: Apply default configuration in AppShell
**Files:**
- Modify: `src/components/layout/AppShell.tsx`
- [ ] **Step 1: Write the implementation**
Add `isDemo` import at the top of `src/components/layout/AppShell.tsx`:
```typescript
import { isDemo } from "@/core/edition";
```
In `AppShell.tsx`, around line 71, inside `startPlatform()`, fetch the value from the environment if the instance is demo:
```typescript
// Fetch disabled built-in plugins before registration
let disabledIds = new Set<string>();
// ... (keep existing try/catch block)
// Setup demo defaults
const demoDefaultPlugins = new Set<string>();
if (isDemo) {
const envVar = process.env.NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS || "";
envVar.split(",").forEach(s => {
const clean = s.trim();
if (clean) demoDefaultPlugins.add(clean);
});
}
```
Then update the `pluginManager` registration loop to inject the boolean for `initLayer`:
```typescript
for (const plugin of pluginRegistry.getAll()) {
await pluginManager.registerPlugin(plugin);
initLayer(plugin.id, demoDefaultPlugins.has(plugin.id));
}
```
- [ ] **Step 2: Run test to verify it passes**
Run type checks to verify no compilation issues:
`npx tsc --noEmit`
- [ ] **Step 3: Commit**
```bash
git add src/components/layout/AppShell.tsx
npm run commit -- "feat: parse and apply default demo plugins via NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS"
```
### Task 3: Document environment definitions
**Files:**
- Modify: `.env.example`
- Modify: `.env`
- [ ] **Step 1: Write the implementation**
Update `.env.example` and `.env` around the `NEXT_PUBLIC_WWV_EDITION=local` definition:
```dotenv
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs (e.g. aviation,maritime,iranwarlive)
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
```
- [ ] **Step 2: Commit**
```bash
git add .env.example .env
npm run commit -- "docs: add NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS to env templates"
```
@@ -0,0 +1,177 @@
# Decouple Plugin Proxies Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Strip out hardcoded proxy endpoints from the `worldwideview` core repository to enforce a fully decoupled plugin ecosystem, replacing them with direct browser fetching or a universal CORS proxy.
**Architecture:** Remove preferential API routes (`/api/earthquake`, `/api/undersea-cables`, `/api/camera/*`) from the `worldwideview` core app. Promote the existing camera proxy to a universal `/api/proxy` with strict SSRF defenses. Provide direct browser-fetch code for the `wwv-plugin-earthquakes` where CORS permits, and migrate traffic camera fetchers directly into the `wwv-plugin-camera` package to fetch via the universal proxy.
**Tech Stack:** Next.js 16 (App Router), TypeScript, pnpm workspace
---
### Task 1: Promote Universal Proxy in Core Repository
**Files:**
- Create (Move): `src/app/api/proxy/route.ts`
- Delete: `src/app/api/camera/proxy/route.ts`
- [ ] **Step 1: Relocate the proxy route and update logs**
Move the existing camera proxy to act as a system-wide universal proxy.
Run: `mkdir -p src/app/api/proxy`
Run: `mv src/app/api/camera/proxy/route.ts src/app/api/proxy/route.ts`
- [ ] **Step 2: Update the error logging prefix in the new file**
Modify `src/app/api/proxy/route.ts` near line 97:
```json
{
"instruction": "Update the error logging prefix",
"replace_chunks": [
{
"start_line": 96,
"end_line": 98,
"target_content": " } catch (error: any) {\n console.error(\"[CameraProxy] Error fetching target URL:\", error);\n return NextResponse.json(",
"replacement_content": " } catch (error: any) {\n console.error(\"[UniversalProxy] Error fetching target URL:\", error);\n return NextResponse.json("
}
]
}
```
- [ ] **Step 3: Commit the Universal Proxy**
```bash
git add src/app/api/proxy/route.ts src/app/api/camera/proxy/route.ts
git commit -m "refactor: promote camera proxy to universal proxy"
```
### Task 2: Strip Preferential Proxy Routes From Core Application
**Files:**
- Delete: `src/app/api/earthquake/route.ts`
- Delete: `src/app/api/undersea-cables/route.ts`
- Delete: everything in `src/app/api/camera` codebase (`caltrans`, `extract`, `gdot`, `test`, `tfl`, `traffic`)
- [ ] **Step 1: Delete all plugin-specific Next.js API routes**
Run: `rm -rf src/app/api/earthquake`
Run: `rm -rf src/app/api/undersea-cables`
**WAIT**: For `src/app/api/camera`, we must physically copy the fetchers into `worldwideview-plugins` before we delete them.
Run: `cp -r src/app/api/camera/caltrans ../worldwideview-plugins/packages/wwv-plugin-camera/src/`
Run: `cp -r src/app/api/camera/gdot ../worldwideview-plugins/packages/wwv-plugin-camera/src/`
Run: `cp -r src/app/api/camera/tfl ../worldwideview-plugins/packages/wwv-plugin-camera/src/`
Run: `rm -rf src/app/api/camera`
- [ ] **Step 2: Commit the deleted API routes**
```bash
git add src/app/api/earthquake src/app/api/undersea-cables src/app/api/camera
git commit -m "refactor!: strip preferential plugin APIs from core"
```
### Task 3: Migrate Earthquakes and Undersea Cables Plugins
**Files:**
- Modify: `../worldwideview-plugins/packages/wwv-plugin-earthquakes/src/index.ts`
- Modify: `../worldwideview-plugins/packages/wwv-plugin-undersea-cables/src/index.ts`
- [ ] **Step 1: Update Earthquakes plugin to direct browser fetch (Option A)**
In `../worldwideview-plugins/packages/wwv-plugin-earthquakes/src/index.ts`, replace the `/api/earthquake` fetch with the USGS direct URL.
```json
{
"instruction": "Replace the API fetch with direct USGS fetch and remove apiBasePath",
"replace_chunks": [
{
"start_line": 38,
"end_line": 40,
"target_content": " try {\n const res = await globalThis.fetch(`/api/earthquake`);\n if (!res.ok) {",
"replacement_content": " try {\n const res = await globalThis.fetch(`https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson`);\n if (!res.ok) {"
},
{
"start_line": 94,
"end_line": 96,
"target_content": " getServerConfig(): ServerPluginConfig {\n return { apiBasePath: \"/api/earthquake\", pollingIntervalMs: 120000, historyEnabled: false };\n }",
"replacement_content": " getServerConfig(): ServerPluginConfig {\n return { pollingIntervalMs: 120000, historyEnabled: false };\n }"
}
]
}
```
- [ ] **Step 2: Update Undersea Cables plugin to use Universal Proxy (Option B)**
In `../worldwideview-plugins/packages/wwv-plugin-undersea-cables/src/index.ts`:
```json
{
"instruction": "Proxy route to universal proxy",
"replace_chunks": [
{
"start_line": 35,
"end_line": 37,
"target_content": " // Proxy route to bypass CORS for Telegeography submarine cable map API\n const url = \"/api/undersea-cables\";\n ",
"replacement_content": " // Proxy route to bypass CORS for Telegeography submarine cable map API\n const targetUrl = encodeURIComponent(\"https://www.submarinecablemap.com/api/v3/cable/cable-geo.json\");\n const url = `/api/proxy?url=${targetUrl}`;\n "
}
]
}
```
- [ ] **Step 3: Commit the plugin migrations**
```bash
cd ../worldwideview-plugins
git add packages/wwv-plugin-earthquakes/src/index.ts packages/wwv-plugin-undersea-cables/src/index.ts
git commit -m "refactor: transition earthquake and undersea cables to decoupled fetching"
cd ../worldwideview
```
### Task 4: Refactor Camera Plugin to Fetch Natively
**Files:**
- Modify: `../worldwideview-plugins/packages/wwv-plugin-camera/src/index.ts`
- Delete: `caltrans`, `gdot`, `tfl` previously copied components (combine into `trafficFetchers.ts`)
- [ ] **Step 1: Consolidate the camera fetchers**
Create `../worldwideview-plugins/packages/wwv-plugin-camera/src/trafficFetchers.ts`.
Migrate the code from the `caltransFetcher.ts`, `gdotFetcher.ts`, and `tflFetcher.ts` files that we copied in Task 2.
Crucially, when doing `fetch(...)` in these fetchers, if the endpoint doesn't support CORS, wrap it in `/api/proxy?url=${encodeURIComponent(...) }` so the browser can fetch it. Ensure the data models align.
- [ ] **Step 2: Update `wwv-plugin-camera/src/index.ts` to call the fetchers natively**
In `../worldwideview-plugins/packages/wwv-plugin-camera/src/index.ts` function `loadTrafficCameras()`:
```json
{
"instruction": "Replace API fetch with native client-side parallel fetching",
"replace_chunks": [
{
"start_line": 106,
"end_line": 118,
"target_content": " private async loadTrafficCameras(): Promise<void> {\n try {\n const res = await fetch(\"/api/camera/traffic\");\n if (!res.ok) throw new Error(`API returned ${res.status}`);\n const data = await res.json();\n if (data.cameras && Array.isArray(data.cameras)) {\n this.sourceBuckets[\"default\"] = data.cameras.map(\n (f: unknown, i: number) => mapGeoJsonFeature(f, i, \"traffic\"),\n );\n }\n } catch (err) {\n console.warn(\"[CameraPlugin] Traffic cameras API failed:\", err);\n }",
"replacement_content": " private async loadTrafficCameras(): Promise<void> {\n try {\n const { fetchCaltrans, fetchGdot, fetchTfl } = await import(\"./trafficFetchers\");\n const [caltrans, gdot, tfl] = await Promise.allSettled([\n fetchCaltrans(), fetchGdot(), fetchTfl()\n ]);\n \n const cameras = [];\n if (caltrans.status === \"fulfilled\") cameras.push(...caltrans.value);\n if (gdot.status === \"fulfilled\") cameras.push(...gdot.value);\n if (tfl.status === \"fulfilled\") cameras.push(...tfl.value);\n\n if (cameras.length > 0) {\n this.sourceBuckets[\"default\"] = cameras.map(\n (f: unknown, i: number) => mapGeoJsonFeature(f, i, \"traffic\"),\n );\n }\n } catch (err) {\n console.warn(\"[CameraPlugin] Traffic cameras API failed:\", err);\n }"
}
]
}
```
- [ ] **Step 3: Remove the extra node API files from the plugin source tree**
Run: `rm -rf ../worldwideview-plugins/packages/wwv-plugin-camera/src/caltrans`
Run: `rm -rf ../worldwideview-plugins/packages/wwv-plugin-camera/src/gdot`
Run: `rm -rf ../worldwideview-plugins/packages/wwv-plugin-camera/src/tfl`
- [ ] **Step 4: Commit Camera plugin refactoring**
```bash
cd ../worldwideview-plugins
git add packages/wwv-plugin-camera/src
git commit -m "feat: migrate traffic camera fetchers to client-side plugin bundle"
cd ../worldwideview
```
View File
Whitespace-only changes.
+336749
View File
File diff suppressed because it is too large. Load diff
+77 -37
View File
@@ -1,46 +1,66 @@
import type { NextConfig } from "next";
import path from "path";
import webpack from "webpack";
import CopyPlugin from "copy-webpack-plugin";
const cesiumSource = path.resolve(__dirname, "node_modules/cesium/Build/Cesium");
const nextConfig: NextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "@prisma/adapter-better-sqlite3", "@prisma/client", "prisma"],
transpilePackages: ["@worldwideview/wwv-plugin-sdk","resium",
"react-player",
"satellite.js"
],
experimental: {
memoryBasedWorkersCount: true,
cpus: 2,
optimizePackageImports: ["lucide-react"],
},
typescript: {
ignoreBuildErrors: true,
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: [
"default-src 'self'",
// CesiumJS requires unsafe-eval (worker compilation) and unsafe-inline (styles)
"script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://cdn.jsdelivr.net https://analytics.worldwideview.dev https://va.vercel-scripts.com https://pagead2.googlesyndication.com https://adservice.google.com https://www.googletagservices.com https://ep2.adtrafficquality.google https://static.cloudflareinsights.com",
"style-src 'self' 'unsafe-inline' fonts.googleapis.com",
"font-src 'self' fonts.gstatic.com",
// Camera streams load images/MJPEG from arbitrary IPs worldwide — http: https: required
"img-src 'self' data: blob: http: https:",
// Camera HLS streams and external data fetches need arbitrary origins
"connect-src 'self' http: https: ws: wss:",
// HLS video streams from arbitrary camera sources
"media-src 'self' blob: http: https:",
// Embeddable video platforms for camera iframes
"frame-src 'self' *.youtube.com *.youtube-nocookie.com *.twitch.tv *.vimeo.com *.webcamera.pl *.ivideon.com *.rtsp.me *.bnu.tv https://googleads.g.doubleclick.net https://tpc.googlesyndication.com https://ep2.adtrafficquality.google https://*.google.com",
"worker-src 'self' blob:",
"frame-ancestors 'none'",
].join("; "),
},
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "X-DNS-Prefetch-Control", value: "on" },
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=(self)",
},
],
},
];
},
outputFileTracingExcludes: {
"*": ["./public/cesium/**"],
},
env: {
CESIUM_BASE_URL: "/cesium",
},
webpack: (config, { isServer }) => {
webpack: (config, { isServer, webpack }) => {
if (!isServer) {
// Copy Cesium static assets to public/cesium (Production only)
if (process.env.NODE_ENV === "production" || !isServer) {
// We only add it here if it's production or if we're not using predev
// To be safe, let's just make it only run if NOT in dev
if (process.env.NODE_ENV === "production") {
config.plugins?.push(
new CopyPlugin({
patterns: [
{
from: path.join(cesiumSource, "Workers"),
to: path.resolve(__dirname, "public/cesium/Workers"),
},
{
from: path.join(cesiumSource, "ThirdParty"),
to: path.resolve(__dirname, "public/cesium/ThirdParty"),
},
{
from: path.join(cesiumSource, "Assets"),
to: path.resolve(__dirname, "public/cesium/Assets"),
},
{
from: path.join(cesiumSource, "Widgets"),
to: path.resolve(__dirname, "public/cesium/Widgets"),
},
],
})
);
}
}
// Define CESIUM_BASE_URL for Cesium's worker resolution
config.plugins?.push(
new webpack.DefinePlugin({
@@ -64,4 +84,24 @@ const nextConfig: NextConfig = {
},
};
export default nextConfig;
import { withSentryConfig } from "@sentry/nextjs";
export default withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
sentryUrl: process.env.GLITCHTIP_SERVER_URL,
authToken: process.env.SENTRY_AUTH_TOKEN,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Hides source maps from generated client bundles
sourcemaps: {
disable: true,
},
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
});
-4480
View File
File diff suppressed because it is too large. Load diff
+46 -7
View File
@@ -1,36 +1,75 @@
{
"name": "worldwideview",
"version": "0.1.0",
"version": "1.13.3",
"private": true,
"scripts": {
"setup": "node scripts/setup.mjs",
"test-worktree": "node scripts/test-worktree.mjs",
"clean": "node -e \"const fs=require('fs');fs.rmSync('.next',{recursive:true,force:true})\"",
"dev": "next dev --webpack",
"predev": "node scripts/copy-cesium.mjs",
"dev:all": "concurrently -n \"next,backends\" -c \"magenta,blue\" \"pnpm dev\" \"pnpm dev:backends\"",
"dev:backends": "cd ../wwv-data-engine && pnpm dev",
"predev": "npx prisma migrate deploy && node scripts/copy-cesium.mjs",
"copy-cesium": "node scripts/copy-cesium.mjs",
"build": "next build --webpack",
"start": "next start"
"start": "next start",
"test": "vitest run",
"db:reset": "npx prisma migrate reset --force"
},
"dependencies": {
"@auth/prisma-adapter": "^2.11.1",
"@prisma/adapter-better-sqlite3": "^7.5.0",
"@prisma/client": "^7.5.0",
"@sentry/nextjs": "^10.48.0",
"@supabase/supabase-js": "^2.98.0",
"@vercel/analytics": "^1.6.1",
"@worldwideview/wwv-plugin-sdk": "workspace:*",
"bcryptjs": "^3.0.3",
"cesium": "^1.139.0",
"cheerio": "^1.2.0",
"hls.js": "^1.6.15",
"insecam-api": "^0.0.3",
"jsdom": "^28.1.0",
"jose": "^6.2.2",
"lucide-react": "^0.576.0",
"next": "16.1.6",
"next": "16.2.3",
"next-auth": "^5.0.0-beta.30",
"prisma": "^7.5.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-player": "^3.4.0",
"resium": "^1.19.4",
"resium": "1.19.4",
"satellite.js": "^7.0.0",
"tslib": "^2.8.1",
"ws": "^8.14.2",
"zustand": "^5.0.11"
},
"devDependencies": {
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.2",
"@types/bcryptjs": "^3.0.0",
"@types/cesium": "^1.70.4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/ws": "^8.18.1",
"@vitejs/plugin-react": "^5.1.4",
"concurrently": "^9.2.1",
"copy-webpack-plugin": "^14.0.0",
"typescript": "^5"
"jsdom": "^28.1.0",
"rollup-plugin-external-globals": "^0.13.0",
"typescript": "^5",
"vite": "^8.0.8",
"vitest": "^4.0.18"
},
"pnpm": {
"onlyBuiltDependencies": [
"@prisma/engines",
"better-sqlite3",
"esbuild",
"prisma",
"protobufjs",
"sharp",
"unrs-resolver"
]
}
}
+64
View File
@@ -0,0 +1,64 @@
# @worldwideview/wwv-plugin-sdk
Plugin SDK for building [WorldWideView](https://github.com/silvertakana/worldwideview) globe plugins. Provides TypeScript types, interfaces, and utilities that all plugins depend on.
## Installation
```bash
npm install @worldwideview/wwv-plugin-sdk
```
## Core Interfaces
| Interface | Purpose |
|---|---|
| `WorldPlugin` | Main plugin contract — lifecycle, data fetching, rendering |
| `GeoEntity` | A positioned object on the globe (lat/lon/alt + properties) |
| `PluginContext` | Host app context injected into every plugin at init |
| `LayerConfig` | Visual layer settings (color, clustering, limits) |
| `CesiumEntityOptions` | Per-entity Cesium rendering options (point, model, etc.) |
| `SelectionBehavior` | Optional trail / fly-to behavior on entity selection |
| `FilterDefinition` | Declarative filter UI (text, select, range, boolean) |
| `ServerPluginConfig` | Server-side API routing and polling config |
## Quick Example
```ts
import type { WorldPlugin, GeoEntity, TimeRange, PluginContext, LayerConfig, CesiumEntityOptions } from "@worldwideview/wwv-plugin-sdk";
export class MyPlugin implements WorldPlugin {
id = "my-plugin";
name = "My Plugin";
description = "A custom WorldWideView plugin";
icon = "🌍";
category = "custom";
version = "1.0.0";
async initialize(ctx: PluginContext) { /* setup */ }
destroy() { /* cleanup */ }
async fetch(timeRange: TimeRange): Promise<GeoEntity[]> {
// Return geo-positioned entities
return [];
}
getPollingInterval() { return 30000; }
getLayerConfig(): LayerConfig {
return { color: "#3b82f6", clusterEnabled: true, clusterDistance: 40 };
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return { type: "point", color: "#3b82f6", size: 6 };
}
}
```
## Changelog
- **v1.0.3** — Added README with core interfaces and usage docs.
- **v1.0.2** — Package metadata updates.
- **v1.0.1** — Package configuration fixes.
- **v1.0.0** — Initial release with core types and interfaces.
## License
ISC
+231
View File
@@ -0,0 +1,231 @@
import type { ComponentType } from "react";
/** Standard SVG icon size (px) used by createSvgIconUrl when no size is given. */
export declare const DEFAULT_ICON_SIZE = 32;
export interface IconUrlOptions extends Record<string, unknown> {
/** Icon color (stroke). */
color?: string;
/** SVG icon size in px (default: DEFAULT_ICON_SIZE). */
size?: number;
/** Show circle background behind icon (default: true). */
background?: boolean;
/** Background fill color (default: semi-transparent dark slate). */
backgroundColor?: string;
}
/**
* Convert a React icon component into a `data:image/svg+xml` URL for Cesium billboards.
* By default wraps the icon in a filled circle for visibility on any terrain.
* Pass `{ background: false }` to opt out.
*/
export declare function createSvgIconUrl(Icon: ComponentType<any>, opts?: IconUrlOptions): string;
export type { PluginManifest, PluginFormat, PluginType, TrustTier, PluginCapability, DataSourceConfig, FieldMapping, RenderingConfig } from "./manifest";
export type PluginCategory = "aviation" | "maritime" | "military" | "conflict" | "natural-disaster" | "infrastructure" | "space" | "cyber" | "economic" | "intelligence" | "custom";
export interface TimeRange {
start: Date;
end: Date;
}
export type TimeWindow = "1h" | "6h" | "24h" | "48h" | "7d";
export interface GeoEntity {
id: string;
pluginId: string;
latitude: number;
longitude: number;
altitude?: number;
heading?: number;
speed?: number;
timestamp: Date;
label?: string;
properties: Record<string, unknown>;
}
export interface WsStreamPayload {
type: "data" | "error";
pluginId?: string;
payload?: GeoEntity[];
error?: string;
}
export interface LayerConfig {
color: string;
iconUrl?: string;
clusterEnabled: boolean;
clusterDistance: number;
minZoomLevel?: number;
maxEntities?: number;
/** If true, the core primitive renderer and StackManager will ignore this plugin's entities. Use when getGlobeComponent completely manages rendering. */
disableDefaultRendering?: boolean;
}
export interface CesiumEntityOptions {
type: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
size?: number;
iconUrl?: string;
rotation?: number;
outlineColor?: string;
outlineWidth?: number;
labelText?: string;
labelFont?: string;
distanceDisplayCondition?: {
near: number;
far: number;
};
disableDepthTestDistance?: number;
/** Billboard scale override (default: 0.6). Plugin devs can set this to control icon size. */
iconScale?: number;
/** GPU Depth Test bias (meters). Negative values pull billboard towards camera (default: -1000 for visibility). */
depthBias?: number;
modelUrl?: string;
modelScale?: number;
modelMinPixelSize?: number;
modelHeadingOffset?: number;
trailOptions?: {
width?: number;
color?: string;
dashPattern?: "solid" | "dashed";
opacityFade?: boolean;
};
/** Skip mathematical horizon culling (useful for high-altitude objects like satellites) */
disableManualHorizonCulling?: boolean;
/** Skip combining this entity into clusters/stacks when zoomed out */
disableClustering?: boolean;
}
export interface SelectionBehavior {
showTrail?: boolean;
trailDurationSec?: number;
trailStepSec?: number;
trailColor?: string;
flyToOffsetMultiplier?: number;
flyToBaseDistance?: number;
}
export interface ServerPluginConfig {
apiBasePath: string;
pollingIntervalMs: number;
requiresAuth?: boolean;
historyEnabled?: boolean;
availabilityEnabled?: boolean;
/** WebSocket URL for direct engine connection. Overrides the global default engine URL. */
streamUrl?: string;
}
export interface PluginContext {
apiBaseUrl: string;
timeRange: TimeRange;
onDataUpdate: (entities: GeoEntity[]) => void;
onError: (error: Error) => void;
/** Get plugin-specific settings from the app config store */
getPluginSettings: <T = unknown>(pluginId: string) => T | undefined;
/** Returns true if the app is in timeline playback mode */
isPlaybackMode: () => boolean;
/** Returns the current timeline time (relevant in playback mode) */
getCurrentTime: () => Date;
}
export interface FilterSelectOption {
value: string;
label: string;
}
export interface FilterRangeConfig {
min: number;
max: number;
step: number;
}
export interface FilterDefinition {
id: string;
label: string;
type: "text" | "select" | "range" | "boolean";
propertyKey: string;
options?: FilterSelectOption[];
range?: FilterRangeConfig;
}
export type FilterValue = {
type: "text";
value: string;
} | {
type: "select";
values: string[];
} | {
type: "range";
min: number;
max: number;
} | {
type: "boolean";
value: boolean;
};
export interface WorldPlugin {
id: string;
name: string;
description: string;
icon: string | ComponentType<{
size?: number;
color?: string;
}>;
category: PluginCategory;
version: string;
initialize(ctx: PluginContext): Promise<void>;
destroy(): void;
fetch(timeRange: TimeRange): Promise<GeoEntity[]>;
getPollingInterval(): number;
getLayerConfig(): LayerConfig;
renderEntity(entity: GeoEntity): CesiumEntityOptions;
getSelectionBehavior?(entity: GeoEntity): SelectionBehavior | null;
getServerConfig?(): ServerPluginConfig;
getFilterDefinitions?(): FilterDefinition[];
getLegend?(): {
label: string;
color: string;
filterId?: string;
filterValue?: string;
}[];
getSidebarComponent?(): ComponentType<{
plugin?: any;
} | any>;
getDetailComponent?(): ComponentType<{
entity: GeoEntity;
}>;
getSettingsComponent?(): ComponentType<{
pluginId: string;
}>;
/** Custom React component injected into the Globe view for rendering primitives/data sources (e.g. GeoJSON). */
getGlobeComponent?(): ComponentType<{
viewer: any;
enabled: boolean;
}>;
requiresConfiguration?(settings: unknown): boolean;
/** Map raw websocket payload into GeoEntity array. Optional existingEntities is provided so plugins can merge state (e.g. historical trails). */
mapWebsocketPayload?(payload: any, existingEntities?: GeoEntity[]): GeoEntity[];
}
export type GlobePlugin = WorldPlugin;
export type DataBusEvents = {
pluginRegistered: {
pluginId: string;
defaultInterval: number;
};
dataUpdated: {
pluginId: string;
entities: GeoEntity[];
};
entitySelected: {
entity: GeoEntity | null;
};
layerToggled: {
pluginId: string;
enabled: boolean;
};
timeRangeChanged: {
timeRange: TimeRange;
};
cameraPreset: {
presetId: string;
};
cameraFaceTowards: {
lat: number;
lon: number;
alt: number;
};
cameraGoTo: {
lat: number;
lon: number;
alt: number;
distance?: number;
maxPitch?: number;
heading?: number;
};
globeReady: Record<string, never>;
};
export * from "./viteGlobals";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAKpC,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EACxB,IAAI,GAAE,cAAmB,GAC1B,MAAM,CA4BR;AAGD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGzJ,MAAM,MAAM,cAAc,GACpB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,kBAAkB,GAClB,gBAAgB,GAChB,OAAO,GACP,OAAO,GACP,UAAU,GACV,cAAc,GACd,QAAQ,CAAC;AAGf,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACb;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;AAG5D,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yJAAyJ;IACzJ,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAGD,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mHAAmH;IACnH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;QACjC,WAAW,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,2FAA2F;IAC3F,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,6DAA6D;IAC7D,iBAAiB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IACpE,2DAA2D;IAC3D,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,oEAAoE;IACpE,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAkB;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AACrE,MAAM,WAAW,iBAAiB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE;AAC9E,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAG1C,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,IAAI,IAAI,CAAC;IAGhB,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAClD,kBAAkB,IAAI,MAAM,CAAC;IAG7B,cAAc,IAAI,WAAW,CAAC;IAC9B,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAGrD,oBAAoB,CAAC,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,IAAI,CAAC;IACnE,eAAe,CAAC,IAAI,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,IAAI,gBAAgB,EAAE,CAAC;IAC5C,SAAS,CAAC,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1F,mBAAmB,CAAC,IAAI,aAAa,CAAC;QAAE,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE,Line truncated
+45
View File
@@ -0,0 +1,45 @@
// ─── WorldWideView Plugin SDK ─────────────────────────────────
// The public API for building WorldWideView plugins.
// Import from "@worldwideview/wwv-plugin-sdk" in your plugin.
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
/** Standard SVG icon size (px) used by createSvgIconUrl when no size is given. */
export const DEFAULT_ICON_SIZE = 32;
/** Default dark background color for icon circles. */
const DEFAULT_BG_COLOR = "rgba(15, 23, 42, 0.85)";
/**
* Convert a React icon component into a `data:image/svg+xml` URL for Cesium billboards.
* By default wraps the icon in a filled circle for visibility on any terrain.
* Pass `{ background: false }` to opt out.
*/
export function createSvgIconUrl(Icon, opts = {}) {
const { background = true, backgroundColor = DEFAULT_BG_COLOR, size = DEFAULT_ICON_SIZE } = opts, iconProps = __rest(opts, ["background", "backgroundColor", "size"]);
const innerSvg = renderToStaticMarkup(createElement(Icon, Object.assign({ size }, iconProps)));
if (!background) {
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(innerSvg)}`;
}
// Wrap the icon in a larger SVG with a filled circle behind it
const padding = 6;
const totalSize = size + padding * 2;
const center = totalSize / 2;
const radius = totalSize / 2 - 1;
const wrappedSvg = [
`<svg xmlns="http://www.w3.org/2000/svg" width="${totalSize}" height="${totalSize}" viewBox="0 0 ${totalSize} ${totalSize}">`,
`<circle cx="${center}" cy="${center}" r="${radius}" fill="${backgroundColor}" />`,
`<g transform="translate(${padding}, ${padding})">${innerSvg}</g>`,
`</svg>`,
].join("");
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(wrappedSvg)}`;
}
export * from "./viteGlobals";
+70
View File
@@ -0,0 +1,70 @@
import type { PluginCategory } from "./index";
export type PluginFormat = "declarative" | "static" | "bundle";
export type PluginType = "data-layer" | "extension";
export type TrustTier = "built-in" | "verified" | "unverified";
export type PluginCapability = "data:own" | `data:read:${string}` | "ui:detail-panel" | "ui:sidebar" | "ui:toolbar" | "ui:settings" | "globe:overlay" | "globe:camera" | "storage:read" | "storage:write" | "network:fetch";
export interface DataSourceConfig {
url: string;
method: "GET" | "POST";
pollInterval: number;
format: "geojson" | "json" | "csv";
auth?: {
type: "header" | "query";
key: string;
envVar: string;
} | null;
headers?: Record<string, string>;
body?: Record<string, unknown>;
arrayPath?: string;
/** WebSocket URL for direct engine connection (e.g., wss://my-engine.example.com/stream). */
streamUrl?: string;
}
export interface FieldMapping {
id: string;
latitude: string;
longitude: string;
altitude?: string;
heading?: string;
speed?: string;
label?: string;
timestamp?: string;
properties?: Record<string, string>;
}
export interface RenderingConfig {
entityType: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
icon?: string;
sizeField?: string;
labelField?: string;
clusterEnabled?: boolean;
clusterDistance?: number;
modelUrl?: string;
minZoomLevel?: number;
maxEntities?: number;
}
export interface PluginManifest {
id: string;
name: string;
version: string;
description?: string;
type: PluginType;
format: PluginFormat;
trust: TrustTier;
capabilities: PluginCapability[];
category: PluginCategory | string;
icon?: string;
compatibility?: {
worldwideview: string;
};
requires?: {
envVars?: string[];
};
dataSource?: DataSourceConfig;
fieldMapping?: FieldMapping;
dataFile?: string;
rendering?: RenderingConfig;
entry?: string;
assets?: string[];
extends?: string[];
}
//# sourceMappingURL=manifest.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GACtB,UAAU,GACV,aAAa,MAAM,EAAE,GACrB,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,eAAe,GACf,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;IACnC,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAClC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
+4
View File
@@ -0,0 +1,4 @@
// ─── Plugin Manifest Types ───────────────────────────────────
// Schema for plugin.json manifest files.
// Three formats: declarative (JSON-only), static (GeoJSON), bundle (JS code).
export {};
+40
View File
@@ -0,0 +1,40 @@
{
"name": "@worldwideview/wwv-plugin-sdk",
"version": "1.3.0",
"description": "Plugin SDK — types, interfaces, and utilities for building WorldWideView globe plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc --project tsconfig.build.json",
"typecheck": "tsc --noEmit"
},
"keywords": [
"worldwideview",
"wwv-plugin-sdk",
"globe",
"cesium",
"plugin-sdk",
"geospatial"
],
"repository": {
"type": "git",
"url": "https://github.com/silvertakana/worldwideview.git",
"directory": "packages/wwv-plugin-sdk"
},
"homepage": "https://github.com/silvertakana/worldwideview#readme",
"bugs": {
"url": "https://github.com/silvertakana/worldwideview/issues"
},
"license": "ISC",
"author": "WorldWideView",
"peerDependencies": {
"react": ">=18"
},
"devDependencies": {
"typescript": "^5",
"@types/react": "^19"
}
}
+262
View File
@@ -0,0 +1,262 @@
// ─── WorldWideView Plugin SDK ─────────────────────────────────
// The public API for building WorldWideView plugins.
// Import from "@worldwideview/wwv-plugin-sdk" in your plugin.
import type { ComponentType } from "react";
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
/** Standard SVG icon size (px) used by createSvgIconUrl when no size is given. */
export const DEFAULT_ICON_SIZE = 32;
/** Default dark background color for icon circles. */
const DEFAULT_BG_COLOR = "rgba(15, 23, 42, 0.85)";
export interface IconUrlOptions extends Record<string, unknown> {
/** Icon color (stroke). */
color?: string;
/** SVG icon size in px (default: DEFAULT_ICON_SIZE). */
size?: number;
/** Show circle background behind icon (default: true). */
background?: boolean;
/** Background fill color (default: semi-transparent dark slate). */
backgroundColor?: string;
}
/**
* Convert a React icon component into a `data:image/svg+xml` URL for Cesium billboards.
* By default wraps the icon in a filled circle for visibility on any terrain.
* Pass `{ background: false }` to opt out.
*/
export function createSvgIconUrl(
Icon: ComponentType<any>,
opts: IconUrlOptions = {},
): string {
const {
background = true,
backgroundColor = DEFAULT_BG_COLOR,
size = DEFAULT_ICON_SIZE,
...iconProps
} = opts;
const innerSvg = renderToStaticMarkup(createElement(Icon, { size, ...iconProps }));
if (!background) {
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(innerSvg)}`;
}
// Wrap the icon in a larger SVG with a filled circle behind it
const padding = 6;
const totalSize = size + padding * 2;
const center = totalSize / 2;
const radius = totalSize / 2 - 1;
const wrappedSvg = [
`<svg xmlns="http://www.w3.org/2000/svg" width="${totalSize}" height="${totalSize}" viewBox="0 0 ${totalSize} ${totalSize}">`,
`<circle cx="${center}" cy="${center}" r="${radius}" fill="${backgroundColor}" />`,
`<g transform="translate(${padding}, ${padding})">${innerSvg}</g>`,
`</svg>`,
].join("");
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(wrappedSvg)}`;
}
// ─── Re-export manifest types ─────────────────────────────────
export type { PluginManifest, PluginFormat, PluginType, TrustTier, PluginCapability, DataSourceConfig, FieldMapping, RenderingConfig } from "./manifest";
// ─── Categories ──────────────────────────────────────────────
export type PluginCategory =
| "aviation"
| "maritime"
| "military"
| "conflict"
| "natural-disaster"
| "infrastructure"
| "space"
| "cyber"
| "economic"
| "intelligence"
| "custom";
// ─── Time ────────────────────────────────────────────────────
export interface TimeRange {
start: Date;
end: Date;
}
export type TimeWindow = "1h" | "6h" | "24h" | "48h" | "7d";
// ─── Geo Entities ────────────────────────────────────────────
export interface GeoEntity {
id: string;
pluginId: string;
latitude: number;
longitude: number;
altitude?: number;
heading?: number;
speed?: number;
timestamp: Date;
label?: string;
properties: Record<string, unknown>;
}
export interface WsStreamPayload {
type: "data" | "error";
pluginId?: string;
payload?: GeoEntity[];
error?: string;
}
// ─── Layer Config ────────────────────────────────────────────
export interface LayerConfig {
color: string;
iconUrl?: string;
clusterEnabled: boolean;
clusterDistance: number;
minZoomLevel?: number;
maxEntities?: number;
/** If true, the core primitive renderer and StackManager will ignore this plugin's entities. Use when getGlobeComponent completely manages rendering. */
disableDefaultRendering?: boolean;
}
// ─── Cesium Entity Options ───────────────────────────────────
export interface CesiumEntityOptions {
type: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
size?: number;
iconUrl?: string;
rotation?: number;
outlineColor?: string;
outlineWidth?: number;
labelText?: string;
labelFont?: string;
distanceDisplayCondition?: { near: number; far: number };
disableDepthTestDistance?: number;
/** Billboard scale override (default: 0.6). Plugin devs can set this to control icon size. */
iconScale?: number;
/** GPU Depth Test bias (meters). Negative values pull billboard towards camera (default: -1000 for visibility). */
depthBias?: number;
modelUrl?: string;
modelScale?: number;
modelMinPixelSize?: number;
modelHeadingOffset?: number;
trailOptions?: {
width?: number;
color?: string;
dashPattern?: "solid" | "dashed";
opacityFade?: boolean;
};
/** Skip mathematical horizon culling (useful for high-altitude objects like satellites) */
disableManualHorizonCulling?: boolean;
/** Skip combining this entity into clusters/stacks when zoomed out */
disableClustering?: boolean;
}
// ─── Selection Behavior ──────────────────────────────────────
export interface SelectionBehavior {
showTrail?: boolean;
trailDurationSec?: number;
trailStepSec?: number;
trailColor?: string;
flyToOffsetMultiplier?: number;
flyToBaseDistance?: number;
}
// ─── Server Plugin Config ────────────────────────────────────
export interface ServerPluginConfig {
apiBasePath: string;
pollingIntervalMs: number;
requiresAuth?: boolean;
historyEnabled?: boolean;
availabilityEnabled?: boolean;
/** WebSocket URL for direct engine connection. Overrides the global default engine URL. */
streamUrl?: string;
}
// ─── Plugin Context ──────────────────────────────────────────
// Provided by the host app when initializing each plugin.
// All plugins (built-in and 3rd party) receive the same context.
export interface PluginContext {
apiBaseUrl: string;
timeRange: TimeRange;
onDataUpdate: (entities: GeoEntity[]) => void;
onError: (error: Error) => void;
/** Get plugin-specific settings from the app config store */
getPluginSettings: <T = unknown>(pluginId: string) => T | undefined;
/** Returns true if the app is in timeline playback mode */
isPlaybackMode: () => boolean;
/** Returns the current timeline time (relevant in playback mode) */
getCurrentTime: () => Date;
}
// ─── Filter Definitions ──────────────────────────────────────
export interface FilterSelectOption { value: string; label: string; }
export interface FilterRangeConfig { min: number; max: number; step: number; }
export interface FilterDefinition {
id: string;
label: string;
type: "text" | "select" | "range" | "boolean";
propertyKey: string;
options?: FilterSelectOption[];
range?: FilterRangeConfig;
}
export type FilterValue =
| { type: "text"; value: string }
| { type: "select"; values: string[] }
| { type: "range"; min: number; max: number }
| { type: "boolean"; value: boolean };
// ─── World Plugin Interface ──────────────────────────────────
export interface WorldPlugin {
id: string;
name: string;
description: string;
icon: string | ComponentType<{ size?: number; color?: string }>;
category: PluginCategory;
version: string;
// Lifecycle
initialize(ctx: PluginContext): Promise<void>;
destroy(): void;
// Data
fetch(timeRange: TimeRange): Promise<GeoEntity[]>;
getPollingInterval(): number;
// Rendering
getLayerConfig(): LayerConfig;
renderEntity(entity: GeoEntity): CesiumEntityOptions;
// Optional
getSelectionBehavior?(entity: GeoEntity): SelectionBehavior | null;
getServerConfig?(): ServerPluginConfig;
getFilterDefinitions?(): FilterDefinition[];
getLegend?(): { label: string; color: string; filterId?: string; filterValue?: string }[];
getSidebarComponent?(): ComponentType<{ plugin?: any } | any>;
getDetailComponent?(): ComponentType<{ entity: GeoEntity }>;
getSettingsComponent?(): ComponentType<{ pluginId: string }>;
/** Custom React component injected into the Globe view for rendering primitives/data sources (e.g. GeoJSON). */
getGlobeComponent?(): ComponentType<{ viewer: any; enabled: boolean }>;
requiresConfiguration?(settings: unknown): boolean;
/** Map raw websocket payload into GeoEntity array. Optional existingEntities is provided so plugins can merge state (e.g. historical trails). */
mapWebsocketPayload?(payload: any, existingEntities?: GeoEntity[]): GeoEntity[];
}
// ─── Aliases for backwards compatibility ─────────────────────
export type GlobePlugin = WorldPlugin;
// ─── Data Bus Event Types ────────────────────────────────────
export type DataBusEvents = {
pluginRegistered: { pluginId: string; defaultInterval: number };
dataUpdated: { pluginId: string; entities: GeoEntity[] };
entitySelected: { entity: GeoEntity | null };
layerToggled: { pluginId: string; enabled: boolean };
timeRangeChanged: { timeRange: TimeRange };
cameraPreset: { presetId: string };
cameraFaceTowards: { lat: number; lon: number; alt: number };
cameraGoTo: { lat: number; lon: number; alt: number; distance?: number; maxPitch?: number; heading?: number };
globeReady: Record<string, never>;
};
export * from "./viteGlobals";
+82
View File
@@ -0,0 +1,82 @@
// ─── Plugin Manifest Types ───────────────────────────────────
// Schema for plugin.json manifest files.
// Three formats: declarative (JSON-only), static (GeoJSON), bundle (JS code).
import type { PluginCategory } from "./index";
export type PluginFormat = "declarative" | "static" | "bundle";
export type PluginType = "data-layer" | "extension";
export type TrustTier = "built-in" | "verified" | "unverified";
export type PluginCapability =
| "data:own"
| `data:read:${string}`
| "ui:detail-panel"
| "ui:sidebar"
| "ui:toolbar"
| "ui:settings"
| "globe:overlay"
| "globe:camera"
| "storage:read"
| "storage:write"
| "network:fetch";
export interface DataSourceConfig {
url: string;
method: "GET" | "POST";
pollInterval: number;
format: "geojson" | "json" | "csv";
auth?: { type: "header" | "query"; key: string; envVar: string } | null;
headers?: Record<string, string>;
body?: Record<string, unknown>;
arrayPath?: string;
/** WebSocket URL for direct engine connection (e.g., wss://my-engine.example.com/stream). */
streamUrl?: string;
}
export interface FieldMapping {
id: string;
latitude: string;
longitude: string;
altitude?: string;
heading?: string;
speed?: string;
label?: string;
timestamp?: string;
properties?: Record<string, string>;
}
export interface RenderingConfig {
entityType: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
icon?: string;
sizeField?: string;
labelField?: string;
clusterEnabled?: boolean;
clusterDistance?: number;
modelUrl?: string;
minZoomLevel?: number;
maxEntities?: number;
}
export interface PluginManifest {
id: string;
name: string;
version: string;
description?: string;
type: PluginType;
format: PluginFormat;
trust: TrustTier;
capabilities: PluginCapability[];
category: PluginCategory | string;
icon?: string;
compatibility?: { worldwideview: string };
requires?: { envVars?: string[] };
dataSource?: DataSourceConfig;
fieldMapping?: FieldMapping;
dataFile?: string;
rendering?: RenderingConfig;
entry?: string;
assets?: string[];
extends?: string[];
}
+110
View File
@@ -0,0 +1,110 @@
interface GlobalsMap {
[moduleId: string]: string;
}
/**
* A Vite/Rollup plugin that resolves shared dependencies to the
* `globalThis.__WWV_HOST__` object injected by the core WWV engine.
*
* This ensures that dynamically loaded CDN plugins inherit the exact
* React, Zustand, and Cesium instances of the host application,
* eliminating "Invalid Hook Call" and "useCallback" context mismatches.
*/
export function wwvPluginGlobals(): any {
const HOST_MAPPINGS: GlobalsMap = {
"react": "React",
"react-dom": "ReactDOM",
"react/jsx-runtime": "jsxRuntime",
"cesium": "Cesium",
"resium": "Resium",
// zustand is also part of WWVHostGlobals or maybe not? Wait. I should check hostGlobals.ts!
"@worldwideview/wwv-plugin-sdk": "WWVPluginSDK",
"@/core/state/store": "useStore",
"@/core/plugins/PluginManager": "pluginManager",
"@/components/video/CameraStream": "CameraStream"
};
return {
name: "wwv-plugin-globals",
enforce: "pre",
resolveId(id: string) {
if (id in HOST_MAPPINGS || id === "zustand") {
// Ensure Rollup doesn't try to look for these modules in node_modules
return "\0" + id;
}
return null;
},
load(id: string) {
if (!id.startsWith("\0")) return null;
const originalId = id.slice(1);
if (originalId === "react") {
return `
const React = globalThis.__WWV_HOST__.React;
export default React;
export const { useState, useEffect, useRef, useMemo, useCallback, useContext, useReducer, useLayoutEffect, StrictMode, Suspense, createContext, createElement, cloneElement, isValidElement, Fragment, Children, Component, PureComponent, createRef, forwardRef, memo, lazy, startTransition, useTransition, useDeferredValue, useId, useSyncExternalStore, useInsertionEffect } = React;
`;
}
if (originalId === "react-dom") {
return `
const ReactDOM = globalThis.__WWV_HOST__.ReactDOM;
export default ReactDOM;
export const { createPortal, flushSync } = ReactDOM;
`;
}
if (originalId === "react/jsx-runtime") {
return `
const jsxRuntime = globalThis.__WWV_HOST__.jsxRuntime;
export const jsx = jsxRuntime.jsx;
export const jsxs = jsxRuntime.jsxs;
export const Fragment = jsxRuntime.Fragment;
`;
}
if (originalId === "cesium") {
return `
const Cesium = globalThis.__WWV_HOST__.Cesium;
export default Cesium;
// Export common bindings for direct destructuring
export const { Viewer, Entity, Cartesian3, Cartesian2, Color, CallbackProperty, DistanceDisplayCondition, NearFarScalar, HeightReference, Resource, Rectangle, PolygonHierarchy, ClassificationType, ArcType, Math, JulianDate, TimeInterval, TimeIntervalCollection, SampledPositionProperty, GeoJsonDataSource, PinBuilder } = Cesium;
`;
}
if (originalId === "resium") {
return `
const Resium = globalThis.__WWV_HOST__.Resium;
export default Resium;
export const { Entity, PointGraphics, BillboardGraphics, CustomDataSource, Camera, PolygonGraphics, PolylineGraphics, EllipseGraphics, LabelGraphics, ModelGraphics, PathGraphics, BoxGraphics, GeoJsonDataSource, ScreenSpaceEventHandler, ScreenSpaceEvent } = Resium;
`;
}
if (originalId === "@worldwideview/wwv-plugin-sdk") {
return `
const SDK = globalThis.__WWV_HOST__.WWVPluginSDK;
export default SDK;
export const { WorldPlugin, PluginManifest, createSvgIconUrl, DEFAULT_ICON_SIZE } = SDK;
`;
}
// If zustand is required, wait, is Zustand in host globals?
if (originalId === "zustand") {
return `
if (!globalThis.__WWV_HOST__.zustand) {
console.warn("zustand was not found on WWV_HOST");
}
const zustand = globalThis.__WWV_HOST__.zustand || {};
export default zustand;
export const { create, createStore, useStore } = zustand;
`;
}
if (originalId === "@/core/state/store") {
return `export const useStore = globalThis.__WWV_HOST__.useStore;`;
}
if (originalId === "@/core/plugins/PluginManager") {
return `export const pluginManager = globalThis.__WWV_HOST__.pluginManager;`;
}
if (originalId === "@/components/video/CameraStream") {
return `export const CameraStream = globalThis.__WWV_HOST__.CameraStream;`;
}
return null;
}
};
}
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"moduleResolution": "node"
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
}
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"esModuleInterop": true,
"isolatedModules": true,
"resolveJsonModule": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
}
+7992
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -0,0 +1,3 @@
packages:
- 'packages/*'
- 'packages/*/backend'
+25
View File
@@ -0,0 +1,25 @@
import fs from "fs";
import path from "path";
let dbUrl = process.env.DATABASE_URL;
if (!dbUrl) {
try {
const envPath = path.resolve(process.cwd(), ".env");
if (fs.existsSync(envPath)) {
const envContent = fs.readFileSync(envPath, "utf8");
const match = envContent.match(/^DATABASE_URL=(.*)$/m);
if (match) {
dbUrl = match[1].trim();
}
}
} catch (e) {
// Ignore
}
}
export default {
datasource: {
url: dbUrl,
},
};
@@ -0,0 +1,33 @@
-- CreateTable
CREATE TABLE "aviation_history" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"icao24" TEXT NOT NULL,
"callsign" TEXT,
"timestamp" DATETIME NOT NULL,
"latitude" REAL NOT NULL,
"longitude" REAL NOT NULL,
"altitude" REAL,
"speed" REAL,
"heading" REAL
);
-- CreateTable
CREATE TABLE "installed_plugins" (
"id" TEXT NOT NULL PRIMARY KEY,
"pluginId" TEXT NOT NULL,
"version" TEXT NOT NULL,
"config" TEXT NOT NULL DEFAULT '{}',
"installedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "settings" (
"key" TEXT NOT NULL PRIMARY KEY,
"value" TEXT NOT NULL
);
-- CreateIndex
CREATE INDEX "aviation_history_timestamp_idx" ON "aviation_history"("timestamp");
-- CreateIndex
CREATE UNIQUE INDEX "aviation_history_timestamp_icao24_key" ON "aviation_history"("timestamp", "icao24");
@@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL PRIMARY KEY,
"email" TEXT NOT NULL,
"name" TEXT NOT NULL,
"hashedPassword" TEXT NOT NULL,
"role" TEXT NOT NULL DEFAULT 'user',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
@@ -0,0 +1,51 @@
/*
Warnings:
- You are about to drop the `aviation_history` table. If the table is not empty, all the data it contains will be lost.
- Added the required column `updatedAt` to the `installed_plugins` table without a default value. This is not possible if the table is not empty.
*/
-- DropIndex
DROP INDEX "aviation_history_timestamp_icao24_key";
-- DropIndex
DROP INDEX "aviation_history_timestamp_idx";
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "aviation_history";
PRAGMA foreign_keys=on;
-- CreateTable
CREATE TABLE "favorites" (
"id" TEXT NOT NULL PRIMARY KEY,
"entityId" TEXT NOT NULL,
"pluginId" TEXT NOT NULL,
"label" TEXT NOT NULL,
"pluginName" TEXT NOT NULL,
"lastSeen" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"userId" TEXT NOT NULL,
CONSTRAINT "favorites_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_installed_plugins" (
"id" TEXT NOT NULL PRIMARY KEY,
"pluginId" TEXT NOT NULL,
"version" TEXT NOT NULL,
"config" TEXT NOT NULL DEFAULT '{}',
"enabled" BOOLEAN NOT NULL DEFAULT true,
"installedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_installed_plugins" ("config", "id", "installedAt", "pluginId", "version") SELECT "config", "id", "installedAt", "pluginId", "version" FROM "installed_plugins";
DROP TABLE "installed_plugins";
ALTER TABLE "new_installed_plugins" RENAME TO "installed_plugins";
CREATE UNIQUE INDEX "installed_plugins_pluginId_key" ON "installed_plugins"("pluginId");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
-- CreateIndex
CREATE UNIQUE INDEX "favorites_userId_entityId_key" ON "favorites"("userId", "entityId");
+3
View File
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "sqlite"
+76
View File
@@ -0,0 +1,76 @@
// Prisma schema — SQLite for local, PostgreSQL for cloud.
// Connection URL configured in prisma.config.ts
datasource db {
provider = "sqlite"
}
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}
model User {
id String @id @default(uuid())
email String @unique
name String
hashedPassword String
role String @default("user")
createdAt DateTime @default(now())
favorites Favorite[]
@@map("users")
}
model Favorite {
id String @id @default(uuid())
entityId String
pluginId String
label String
pluginName String
lastSeen DateTime @default(now())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([userId, entityId])
@@map("favorites")
}
// DISABLED — aviation history feature is currently turned off.
// Uncomment to re-enable.
//
// model AviationHistory {
// id Int @id @default(autoincrement())
// icao24 String
// callsign String?
// timestamp DateTime
// latitude Float
// longitude Float
// altitude Float?
// speed Float?
// heading Float?
//
// @@unique([timestamp, icao24])
// @@index([timestamp])
// @@map("aviation_history")
// }
model InstalledPlugin {
id String @id @default(uuid())
pluginId String @unique
version String
config String @default("{}")
enabled Boolean @default(true)
installedAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("installed_plugins")
}
model Setting {
key String @id
value String
@@map("settings")
}
+1
View File
@@ -0,0 +1 @@
google.com, pub-3325496707858400, DIRECT, f08c47fec0942fa0
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
Model Information:
* title: Airplane
* source: https://sketchfab.com/3d-models/airplane-df0d3bc1c930405a96125679268b96d9
* author: sardornosirov203 (https://sketchfab.com/sardornosirov203)
Model License:
* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
* requirements: Author must be credited. Commercial use is allowed.
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
This work is based on "Airplane" (https://sketchfab.com/3d-models/airplane-df0d3bc1c930405a96125679268b96d9) by sardornosirov203 (https://sketchfab.com/sardornosirov203) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
Binary file not shown.
+217
View File
@@ -0,0 +1,217 @@
{
"accessors": [
{
"bufferView": 2,
"componentType": 5126,
"count": 6605,
"max": [
1.0392043590545654,
8.712139129638672,
6.981330871582031
],
"min": [
-3.7596216201782227,
-9.34218692779541,
-6.981330871582031
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 79260,
"componentType": 5126,
"count": 6605,
"max": [
1.0,
1.0,
1.0
],
"min": [
-1.0,
-1.0,
-1.0
],
"type": "VEC3"
},
{
"bufferView": 1,
"componentType": 5126,
"count": 6605,
"max": [
1.0826516151428223,
1.0
],
"min": [
0.0,
0.0
],
"type": "VEC2"
},
{
"bufferView": 0,
"componentType": 5125,
"count": 13422,
"type": "SCALAR"
}
],
"asset": {
"extras": {
"author": "sardornosirov203 (https://sketchfab.com/sardornosirov203)",
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
"source": "https://sketchfab.com/3d-models/airplane-df0d3bc1c930405a96125679268b96d9",
"title": "Airplane"
},
"generator": "Sketchfab-15.34.0",
"version": "2.0"
},
"bufferViews": [
{
"buffer": 0,
"byteLength": 53688,
"name": "floatBufferViews",
"target": 34963
},
{
"buffer": 0,
"byteLength": 52840,
"byteOffset": 53688,
"byteStride": 8,
"name": "floatBufferViews",
"target": 34962
},
{
"buffer": 0,
"byteLength": 158520,
"byteOffset": 106528,
"byteStride": 12,
"name": "floatBufferViews",
"target": 34962
}
],
"buffers": [
{
"byteLength": 265048,
"uri": "scene.bin"
}
],
"materials": [
{
"doubleSided": true,
"name": "Material.001",
"pbrMetallicRoughness": {
"metallicFactor": 0.988768,
"roughnessFactor": 0.202273
}
}
],
"meshes": [
{
"name": "Object_0",
"primitives": [
{
"attributes": {
"NORMAL": 1,
"POSITION": 0,
"TEXCOORD_0": 2
},
"indices": 3,
"material": 0,
"mode": 4
}
]
}
],
"nodes": [
{
"children": [
1
],
"matrix": [
1.0,
0.0,
0.0,
0.0,
0.0,
2.220446049250313e-16,
-1.0,
0.0,
0.0,
1.0,
2.220446049250313e-16,
0.0,
0.0,
0.0,
0.0,
1.0
],
"name": "Sketchfab_model"
},
{
"children": [
2
],
"name": "root"
},
{
"children": [
3
],
"matrix": [
1.0,
0.0,
0.0,
0.0,
0.0,
2.220446049250313e-16,
1.0,
0.0,
0.0,
-1.0,
2.220446049250313e-16,
0.0,
0.0,
0.0,
0.0,
1.0
],
"name": "GLTF_SceneRootNode"
},
{
"children": [
4
],
"matrix": [
2.041668293203005e-08,
-0.24220889806747353,
-0.0,
0.0,
0.24220889806747353,
2.041668293203005e-08,
0.0,
0.0,
0.0,
-0.0,
0.24220889806747437,
0.0,
-0.029667379334568977,
-0.2017381340265274,
0.0,
1.0
],
"name": "Cylinder_5"
},
{
"mesh": 0,
"name": "Object_4"
}
],
"scene": 0,
"scenes": [
{
"name": "Sketchfab_Scene",
"nodes": [
0
]
}
]
}
File diff suppressed because it is too large. Load diff
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as C}from"./chunk-ZSYYF6UE.js";import{a as P}from"./chunk-QWRZXNH3.js";import{a as L}from"./chunk-F2ZMVLJV.js";import{a as O}from"./chunk-VGILZD7B.js";import{a as y}from"./chunk-RXYBLNW3.js";import{e as S}from"./chunk-VIMSDF2W.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as g}from"./chunk-WQ5ZC6ME.js";import{a as d}from"./chunk-XVAXSA53.js";import{j as x}from"./chunk-V6RJRUKY.js";import{a as p,b as M,c as O}from"./chunk-F2ZMVLJV.js";import{b as m}from"./chunk-TXOEXY5C.js";import{e as f}from"./chunk-VIMSDF2W.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a};
+29
View File
@@ -0,0 +1,29 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as Ma}from"./chunk-X2JEUMCS.js";import{a as Ub,b as Pa,c as Fa}from"./chunk-AJGKN5FZ.js";import{a as Ea}from"./chunk-BPTWZPZ6.js";import{a as ra}from"./chunk-GVYQ2MV7.js";import{a as rb}from"./chunk-CAEAJPBH.js";import{a as Ha}from"./chunk-HJG35BQ3.js";import{a as ib,b as gb}from"./chunk-5U3HZZCI.js";import{b as db,c as wa}from"./chunk-WQ5ZC6ME.js";import{a as Ka,b as $b,d as hb,e as Fb,f as Mb,g as Na,i as Ta,j as xa}from"./chunk-V6RJRUKY.js";import{b as P}from"./chunk-R6PWD5CA.js";import{a as tb}from"./chunk-BDF6MEVU.js";import{a as za}from"./chunk-OEIACSKL.js";import{a as V,b as K,c as Aa,d as nb}from"./chunk-F2ZMVLJV.js";import{a as u,b as ya,c as fb}from"./chunk-VGILZD7B.js";import{a as $}from"./chunk-RXYBLNW3.js";import{a as Ia,b as J}from"./chunk-TXOEXY5C.js";import{d as Qb,e as Q}from"./chunk-VIMSDF2W.js";var De=(function(){var c="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuec;G:Qdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:p28Adbk:Bhdhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;m:kjjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8AarcUf9cb83ibarc8Wf9cb83ibarcyf9cb83ibarcaf9cb83ibarcKf9cb83ibarczf9cb83ibar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzarc;qofcKfhHarc;qofczfhOcbhAincdhCcbhodnavci6mbaH9cb83ibaO9cb83ibar9cb83i;yoar9cb83i;qoadaAfgoybbhXcbhQincbhwcbhLdninaoalfhKaoybbgYaX7aLVhLawcP0meaKhoaYhXawcefgwaQfai6mbkkcbhXarc;qofhwincwh8AcwhEdnaLaX93gocFeGg3cs0mbclhEa3ci0mba3cb9hcethEkdnaocw4cFeGg3cs0mbclh8Aa3ci0mba3cb9hceth8Aka8AaEfh3awydbh5cwh8AcwhEdnaocz4cFeGg8Ecs0mbclhEa8Eci0mba8Ecb9hcethEka3a5fh3dnaocFFFFb0mbclh8AaocFFF8F0mbaocFFFr0ceth8Akawa3aEfa8AfBdbawclfhwaXcefgXcw9hmbkaKhoaYhXaQczfgQai6mbkcbhocehwazhLinawaoaLydbarc;qofaocdtfydb6EhoaLclfhLawcefgwcw9hmbkcihCkcbh3arc;qlfcbcjdz:xjjjb8Aarc;alfcwfcbBdbar9cb83i;alaoclth8Fadhaaqhhakh5inarc;qlfadcba3cufgoaoa30Eal2falz:wjjjb8Aaiahaiah6Ehgdnaqaia39Ra3aqfai6EgYcsfc9WGgoaY9nmbarc;qofaYfcbaoaY9Rz:xjjjb8Akada3al2fh8Jcbh8Kina8Ka8FVcl4hQarc;alfa8Kcdtfh8LaAh8Mcbh8Nina8NaAfhwdndndndndndna8KPldebidkasa8Mc98GgLfhoa5aLfh8Aarc;qlfawc98GgLfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkaYTmla8Ncith8Ea8JaLfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aQ93a8E486bba8Aalfh8AaEalfhEaLhXaKcefgKaY9hmbxlkkaYTmia8Mc9:Ghoa8NcitcwGhEarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhLarc;qofhwaghXinawa5aofRbbcwtaaaofRbbVg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaoalfhoawcefhwa8AhLa3aXcufgX9hmbxikkaYTmda8Jawfhoarc;qlfawfRbbhLarc;qofhwaghXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLa3aXcufgX9hmbxdkkaYTmeka8LydbhEcbhKarc;qofhoincdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egwa8Aawa8A6Egwczawcz6EaEfhEaoczfhoaKczfgKaY6mbka8LaEBdbka8Mcefh8Ma8Ncefg8Ncl9hmbka8Kcefg8KaC9hmbkaaamfhaahaxfhha5amfh5a3axfg3ai6mbkcbhocehwaPhLinawaoaLydbarc;alfaocdtfydb6EhoaLclfhLawcefgXhwaCaX9hmbkaraAcd4fa8FcdVaoaocdSE86bbaAclfgAal6mbkkabaefh8Kabcefhoalcd4gecbaDEhkadcefhOarc;abfceVhHcbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aa8Kao9Rak6mdadamal2gwfhxcbh8JaOawfhzaocbakz:xjjjbghakfh5aqaiam9Ramaqfai6Egscsfgocl4cifcd4hCaoc9WGg8LThPindndndndndndndndndndnaDTmbara8Jcd4fRbbgLciGPlbedlbkasTmdaxa8Jfhoarc;abfa8JfRbbhLarc;qofhwashXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLaXcufgXmbxikkasTmia8JcitcwGhEarc;abfa8JceVfRbbcwtarc;abfa8Jc9:GgofRbbVhLaxaofhoarc;qofhwashXinawao8Vbbg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbawcefhwaoalfhoa8AhLaXcufgXmbxdkkaHa8Jc98GgEfhoazaEfh8Aarc;abfaEfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkasTmbaLcl4hYa8JcitcKGh3axaEfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aY93a3486bba8Aalfh8AaEalfhEaLhXaKcefgKas9hmbkkaDmbcbhoxlka8LTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8L9pmdxbkkdnavmbcehoxikcbhEaChKaChYinarc;qofaEfgocwf8Pibhyao8Pibh8PcdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egoa8Line truncated
importScripts("${ob(CESIUM_WORKERS)}");
CesiumWorkers["${g}"]();
`;return b=ob(p),new Worker(b,s)}if(b=c,e||(b=Na(`${_._workerModulePrefix+g}.js`)),!nb.supportsEsmWebWorkers())throw new za("This browser is not supported. Please update your browser to continue.");return s.type="module",new Worker(b,s)}async function bc(c,o){let e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!nb.supportsWebAssembly()){if(!Q(o.fallbackModulePath))throw new za(`This browser does not support Web Assembly, and no backup module was provided for ${c._workerPath}`);return e.modulePath=Na(o.fallbackModulePath),e}e.wasmBinaryFile=Na(o.wasmBinaryFile);let g=await Mb.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=g,e}function _(c,o){this._workerPath=c,this._maximumActiveTasks=o??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var cc=(c,o,e,g)=>{let s=({data:b})=>{if(b.id===o){if(Q(b.error)){let r=b.error;r.name==="RuntimeError"?(r=new za(b.error.message),r.stack=b.error.stack):r.name==="DeveloperError"?(r=new Ia(b.error.message),r.stack=b.error.stack):r.name==="Error"&&(r=new Error(b.error.message),r.stack=b.error.stack),lb.raiseEvent(r),g(r)}else lb.raiseEvent(),e(b.result);c.removeEventListener("message",s)}};return s},ec=[];async function dc(c,o,e){let g=await Promise.resolve(zb());Q(e)?g||(e.length=0):e=ec;let s=c._nextID++,b=new Promise((r,p)=>{c._worker.addEventListener("message",cc(c._worker,s,r,p))});return c._worker.postMessage({id:s,baseUrl:Na.getCesiumBaseUrl().url,parameters:o,canTransferArrayBuffer:g},e),b}async function fc(c,o,e){++c._activeTasks;try{let g=await dc(c,o,e);return--c._activeTasks,g}catch(g){throw--c._activeTasks,g}}_.prototype.scheduleTask=function(c,o){if(Q(this._worker)||(this._worker=mb(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return fc(this,c,o)};_.prototype.initWebAssemblyModule=async function(c){if(Q(this._webAssemblyPromise))return this._webAssemblyPromise;let o=async()=>{let e=this._worker=mb(this._workerPath),g=await bc(this,c),s=await Promise.resolve(zb()),b,r=g.wasmBinary;Q(r)&&s&&(b=[r]);let p=new Promise((E,F)=>{e.onmessage=function({data:y}){Q(y)?E(y.result):F(new za("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:s,parameters:{webAssemblyConfig:g}},b),p};return this._webAssemblyPromise=o(),this._webAssemblyPromise};_.prototype.isDestroyed=function(){return!1};_.prototype.destroy=function(){return Q(this._worker)&&this._worker.terminate(),Bb(this)};_.taskCompletedEvent=lb;_._defaultWorkerModulePrefix="Workers/";_._workerModulePrefix=_._defaultWorkerModulePrefix;_._canTransferArrayBuffer=void 0;var Kb=_;var hc=3;function kb(c,o,e){J.defined("vertices",c),J.defined("indices",o),J.defined("encoding",e),this._vertices=c,this._indices=o,this._encoding=e,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new jb}var nc=new Kb("incrementallyBuildTerrainPicker");Object.defineProperties(kb.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(c){this._needsRebuild=c}}});function jb(){this.x=0,this.y=0,this.level=0,this.aabb=Tb(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}jb.prototype.addChild=function(c){if(c<0||c>3)throw new Ia("TerrainPickerNode child index must be between 0 and 3, inclusive.");let o=new jb;o.x=this.x*2+(c&1),o.y=this.y*2+(c>>1&1),o.level=this.level+1,o.aabb=Tb(o.x,o.y,o.level),this.children[c]=o};var tc=new ib,Za=[new u,new u,new u];kb.prototype.rayIntersect=function(c,o,e,g,s){this._needsRebuild&&rc(this,o);let b=this._inverseTransform,r=tc;r.origin=P.multiplyByPoint(b,c.origin,r.origin),r.direction=P.multiplyByPointAsVector(b,c.direction,r.direction);let p=[];return Hb(this._rootNode,r,p),mc(this,p,c,e,g,s)};function rc(c,o){P.inverse(o,c._inverseTransform),c._needsRebuild=!1;let e=c._indices.length/3,g=new Uint32Array(e);for(let s=0;s<e;++s)g[s]=s;c._rootNode.intersectingTriangles=g,c._rootNode.children.length=0}var ic=new u,gc=new u;function Tb(c,o,e){let g=1/Math.pow(2,e),s=u.fromElements(c*g-.5,o*g-.5,-.5,ic),b=u.fromElements((c+1)*g-.5,(o+1)*g-.5,.5,gc);return Ha.fromCorners(s,b)}function oc(c,o,e,g,s){u.pack(e[0],c,9*s),u.pack(e[1],c,9*s+3),u.pack(e[2],c,9*s+6),o[s]=g}var lc=new db;function Hb(c,o,e){let g=gb.rayAxisAlignedBoundingBox(o,c.aabb,lc);if(!Q(g))return;if(!c.children.length||c.buildingChildren){e.push({node:c,interval:new db(g.start,g.stop)});return}for(let b=0;b<c.children.length;b++)Hb(c.children[b],o,e)}function mc(c,o,e,g,s,b){let r=o.sort(function(E,F){return E.interval.start-F.interval.start}),p=Number.MAX_VALUE;for(let E=0;E<r.length;E++){let F=r[E],y=sc(c,e,F.node,g,s,b);if(p=Math.min(y,p),p!==Number.MAX_VALUE)break}if(p!==Number.MAX_VALUE)return ib.getPoint(e,p)}function sc(c,o,e,g,s,b){let r=Number.MAX_VALUE,p=c._encoding,E=c._indices,F=c._vertices,y=e.intersectingTriangles.length,O=!(e.level>=hc)&&!e.buildingChildren,k,j;O&&(k=new Float64Array(y*9),j=new Uint32Array(y));f Line truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{c as O}from"./chunk-VGILZD7B.js";import{a as f}from"./chunk-TXOEXY5C.js";import{e as t}from"./chunk-VIMSDF2W.js";function n(e){e=e??O.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!t(e))throw new f("value is required");if(!t(o))throw new f("array is required");return i=i??0,o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!t(e))throw new f("array is required");return o=o??0,t(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(t(e))return t(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{b as U}from"./chunk-WQ5ZC6ME.js";import{a as ft}from"./chunk-F2ZMVLJV.js";import{a as i,b}from"./chunk-VGILZD7B.js";import{a as y}from"./chunk-RXYBLNW3.js";import{a as w,b as tt}from"./chunk-TXOEXY5C.js";import{e as g}from"./chunk-VIMSDF2W.js";var nt={};nt.computeDiscriminant=function(t,n,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof n!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return n*n-4*t*r};function mt(t,n,r){let e=t+n;return y.sign(t)!==y.sign(n)&&Math.abs(e/Math.max(Math.abs(t),Math.abs(n)))<r?0:e}nt.computeRealRoots=function(t,n,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof n!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let e;if(t===0)return n===0?[]:[-r/n];if(n===0){if(r===0)return[0,0];let u=Math.abs(r),f=Math.abs(t);if(u<f&&u/f<y.EPSILON14)return[0,0];if(u>f&&f/u<y.EPSILON14)return[];if(e=-r/t,e<0)return[];let h=Math.sqrt(e);return[-h,h]}else if(r===0)return e=-n/t,e<0?[e,0]:[0,e];let o=n*n,s=4*t*r,c=mt(o,-s,y.EPSILON14);if(c<0)return[];let a=-.5*mt(n,y.sign(n)*Math.sqrt(c),y.EPSILON14);return n>0?[a/t,r/a]:[r/a,a/t]};var z=nt;var rt={};rt.computeDiscriminant=function(t,n,r,e){if(typeof t!="number")throw new w("a is a required number.");if(typeof n!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof e!="number")throw new w("d is a required number.");let o=t*t,s=n*n,c=r*r,a=e*e;return 18*t*n*r*e+s*c-27*o*a-4*(t*c*r+s*n*e)};function et(t,n,r,e){let o=t,s=n/3,c=r/3,a=e,u=o*c,f=s*a,h=s*s,d=c*c,p=o*c-h,q=o*a-s*c,m=s*a-d,l=4*p*m-q*q,E,x;if(l<0){let J,k,G;h*f>=u*d?(J=o,k=p,G=-2*s*p+o*q):(J=a,k=m,G=-a*q+2*c*m);let ut=-(G<0?-1:1)*Math.abs(J)*Math.sqrt(-l);x=-G+ut;let K=x/2,Y=K<0?-Math.pow(-K,1/3):Math.pow(K,1/3),$=x===ut?-Y:-k/Y;return E=k<=0?Y+$:-G/(Y*Y+$*$+k),h*f>=u*d?[(E-s)/o]:[-a/(E+c)]}let v=p,W=-2*s*p+o*q,L=m,B=-a*q+2*c*m,I=Math.sqrt(l),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-W)/3);E=2*Math.sqrt(-v);let R=Math.cos(P);x=E*R;let S=E*(-R/2-C*Math.sin(P)),M=x+S>2*s?x-s:S-s,N=o,D=M/N;P=Math.abs(Math.atan2(a*I,-B)/3),E=2*Math.sqrt(-L),R=Math.cos(P),x=E*R,S=E*(-R/2-C*Math.sin(P));let _=-a,Z=x+S<2*c?x+c:S+c,A=_/Z,Rt=N*Z,at=-M*Z-N*_,bt=M*_,V=(c*at-s*bt)/(-s*at+c*Rt);return D<=V?D<=A?V<=A?[D,V,A]:[D,A,V]:[A,D,V]:D<=A?[V,D,A]:V<=A?[V,A,D]:[A,V,D]}rt.computeRealRoots=function(t,n,r,e){if(typeof t!="number")throw new w("a is a required number.");if(typeof n!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof e!="number")throw new w("d is a required number.");let o,s;if(t===0)return z.computeRealRoots(n,r,e);if(n===0){if(r===0){if(e===0)return[0,0,0];s=-e/t;let c=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[c,c,c]}else if(e===0)return o=z.computeRealRoots(t,0,r),o.Length===0?[0]:[o[0],0,o[1]];return et(t,0,r,e)}else{if(r===0)return e===0?(s=-n/t,s<0?[s,0,0]:[0,0,s]):et(t,n,0,e);if(e===0)return o=z.computeRealRoots(t,n,r),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return et(t,n,r,e)};var H=rt;var ot={};ot.computeDiscriminant=function(t,n,r,e,o){if(typeof t!="number")throw new w("a is a required number.");if(typeof n!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof e!="number")throw new w("d is a required number.");if(typeof o!="number")throw new w("e is a required number.");let s=t*t,c=s*t,a=n*n,u=a*n,f=r*r,h=f*r,d=e*e,p=d*e,q=o*o,m=q*o;return a*f*d-4*u*p-4*t*h*d+18*t*n*r*p-27*s*d*d+256*c*m+o*(18*u*r*e-4*a*h+16*t*f*f-80*t*n*f*e-6*t*a*d+144*s*r*d)+q*(144*t*a*r-27*a*a-128*s*f-192*s*n*e)};function T(t,n,r,e){let o=t*t,s=n-3*o/8,c=r-n*t/2+o*t/8,a=e-r*t/4+n*o/16-3*o*o/256,u=H.computeRealRoots(1,2*s,s*s-4*a,-c*c);if(u.length>0){let f=-t/4,h=u[u.length-1];if(Math.abs(h)<y.EPSILON14){let d=z.computeRealRoots(1,s,a);if(d.length===2){let p=d[0],q=d[1],m;if(p>=0&&q>=0){let l=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-l,f+l,f+E]}else{if(p>=0&&q<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&q>=0)return m=Math.sqrt(q),[f-m,f+m]}}return[]}else if(h>0){let d=Math.sqrt(h),p=(s+h-c/d)/2,q=(s+h+c/d)/2,m=z.computeRealRoots(1,d,p),l=z.computeRealRoots(1,-d,q);return m.length!==0?(m[0]+=f,m[1]+=f,l.length!==0?(l[0]+=f,l[1]+=f,m[1]<=l[0]?[m[0],m[1],l[0],l[1]]:l[1]<=m[0]?[l[0],l[1],m[0],m[1]]:m[0]>=l[0]&&m[1]<=l[1]?[l[0],m[0],m[1],l[1]]:l[0]>=m[0]&&l[1]<=m[1]?[m[0],l[0],l[1],m[1]]:m[0]>l[0]&&m[0]<l[1]?[l[0],m[0],l[1],m[1]]:[m[0],l[0],m[1],l[1]]):m):l.length!==0?(l[0]+=f,l[1]+=f,l):[]}}return[]}function j(t,n,r,e){let o=r*r,s=n*n,c=t*t,a=-2*n,u=r*t+s-4*e,f=c*e-r*n*t+o,h=H.computeRealRoots(1,a,u,f);if(h.length>0){let d=h[0],p=n-d,q=p*p,m=t/2,l=p/2,E=q-4*e,x=q+4*Math.abs(e),v=c-4*d,W=c+4*Math.abs(d),L,B;if(d<0||E*W<v*x){let N=Math.sqrt(v);L=N/2,B=N===0?0:(t*l-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*l-r)/N,B=N/2}leLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as N}from"./chunk-XB2TPQAQ.js";import{a}from"./chunk-RXYBLNW3.js";import{a as t}from"./chunk-TXOEXY5C.js";import{e as i}from"./chunk-VIMSDF2W.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var u=Object.freeze(r);export{u as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{h as O,i as R,j as G,k as L}from"./chunk-V6RJRUKY.js";import{b as E}from"./chunk-R6PWD5CA.js";import{a as u}from"./chunk-XB2TPQAQ.js";import{a as N,b as s}from"./chunk-F2ZMVLJV.js";import{a as S,b as y,c as A}from"./chunk-VGILZD7B.js";import{a as I,b as w}from"./chunk-TXOEXY5C.js";import{e as f}from"./chunk-VIMSDF2W.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as y}from"./chunk-CAEAJPBH.js";import{c as W}from"./chunk-WQ5ZC6ME.js";import{j as k}from"./chunk-V6RJRUKY.js";import{b as h}from"./chunk-R6PWD5CA.js";import{a as A}from"./chunk-BDF6MEVU.js";import{a as F,b as T,c as w}from"./chunk-F2ZMVLJV.js";import{a as s}from"./chunk-VGILZD7B.js";import{a as _}from"./chunk-RXYBLNW3.js";import{a as I,b as r}from"./chunk-TXOEXY5C.js";import{e as l}from"./chunk-VIMSDF2W.js";function b(e,t){r.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(o)-1;s.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=o,this._distanceToLimbInScaledSpaceSquared=n}}});var L=new s;b.prototype.isPointVisible=function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,L);return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};b.prototype.isScaledSpacePointVisible=function(e){return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var tt=new s;b.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let o=this._ellipsoid,n,i;return l(t)&&t<0&&o.minimumRadius>-t?(i=tt,i.x=this._cameraPosition.x/(o.radii.x+t),i.y=this._cameraPosition.y/(o.radii.y+t),i.z=this._cameraPosition.z/(o.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(e,i,n)};b.prototype.computeHorizonCullingPoint=function(e,t,o){return Q(this._ellipsoid,e,t,o)};var U=w.clone(w.UNIT_SPHERE);b.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,o,n){let i=v(this._ellipsoid,o,U);return Q(i,e,t,n)};b.prototype.computeHorizonCullingPointFromVertices=function(e,t,o,n,i){return Z(this._ellipsoid,e,t,o,n,i)};b.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,o,n,i,c){let a=v(this._ellipsoid,i,U);return Z(a,e,t,o,n,c)};var et=[];b.prototype.computeHorizonCullingPointFromRectangle=function(e,t,o){r.typeOf.object("rectangle",e);let n=k.subsample(e,t,0,et),i=W.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,o)};var ot=new s;function v(e,t,o){if(l(t)&&t<0&&e.minimumRadius>-t){let n=s.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,ot);e=w.fromCartesian3(n,o)}return e}function Q(e,t,o,n){r.typeOf.object("directionToPoint",t),r.defined("positions",o),l(n)||(n=new s);let i=K(e,t),c=0;for(let a=0,m=o.length;a<m;++a){let d=o[a],u=B(e,d,i);if(u<0)return;c=Math.max(c,u)}return J(i,c,n)}var q=new s;function Z(e,t,o,n,i,c){r.typeOf.object("directionToPoint",t),r.defined("vertices",o),r.typeOf.number("stride",n),l(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=K(e,t),m=0;for(let d=0,u=o.length;d<u;d+=n){q.x=o[d]+i.x,q.y=o[d+1]+i.y,q.z=o[d+2]+i.z;let f=B(e,q,a);if(f<0)return;m=Math.max(m,f)}return J(a,m,c)}function D(e,t,o){let n=t,i=o,c=s.subtract(e,n,L),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var it=new s,nt=new s;function B(e,t,o){let n=e.transformPositionToScaledSpace(t,it),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,nt);i=Math.max(1,i),c=Math.max(1,c);let m=s.dot(a,o),d=s.magnitude(s.cross(a,o,a)),u=1/c,f=Math.sqrt(i-1)*u;return 1/(m*u-d*f)}function J(e,t,o){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(e,t,o)}var R=new s;function K(e,t){return s.equals(t,s.ZERO)?t:(e.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Nt=b;var j={};j.getHeight=function(e,t,o){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(o))throw new I("relativeHeight must be a finite number.");return(e-o)*t+o};var at=new F;j.getPosition=function(e,t,o,n,i){let c=t.cartesianToCartographic(e,at);if(!l(c))return s.clone(e,i);let a=j.getHeight(c.height,o,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var X=j;var st={NONE:0,BITS12:1},g=Object.freeze(st);var C=new s,ct=new s,N=new T,rt=new h,mt=new h,dt=Math.pow(2,12);function p(e,t,o,n,i,c,a,m,d,u){let f=g.NONE,O,S;if(l(t)&&l(o)&&l(n)&&l(i)){let z=t.minimum,G=t.maximum,x=s.subtract(G,z,ct),$=n-o;Math.max(s.maximumComponent(x),$)<dt-1?f=g.BITS12:f=g.NONE;let P=h.fromScale(x,rt);P=h.setTranslation(P,z,P);let E=h.fromScale(s.fromElements(1/x.x,1/x.y,1/x.z,C),mt);E=h.multiplyByTranslation(E,s.negate(z,C),E),S=h.clone(i,new h);let H=h.getTranslation(i,C);H=s.subtract(H,e,C),S=h.setTranslation(S,H,S),S=h.multiply(S,P,S),O=h.inverseTransformation(i,new h),O=h.multiply(E,O,O),i=h.multiply(i,P,new h)}this.quantization=f,this.minimumHeight=o,this.maximumHeight=n,this.center=s.clone(e),this.toScaledENU=O,this.fromScaledENU=i,this.matrix=S,this.hasVertexNormalLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as P,c as T}from"./chunk-F2ZMVLJV.js";import{a as p}from"./chunk-VGILZD7B.js";import{a}from"./chunk-RXYBLNW3.js";import{a as I,b as g}from"./chunk-TXOEXY5C.js";import{e as l}from"./chunk-VIMSDF2W.js";function w(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function H(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),v=Math.sin(4*t),W=Math.cos(4*t),V=Math.sin(6*t),C=Math.cos(6*t),N=Math.sin(8*t),R=Math.cos(8*t),b=Math.sin(10*t),x=Math.cos(10*t),U=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*W+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*C+(1097*t*M/65536+42783*t*_/1048576)*R+8011*t*_/1048576*x+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*v+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*V+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*N+(8011*M/2621440+8011*_/1048576)*b+293393*_/251658240*U}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function z(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function k(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=w(n._ellipticity,i,e);d=(w(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var A=new p,q=new p;function y(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,q),A),c=p.normalize(t.cartographicToCartesian(o,q),q);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=z(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=k(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function D(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=w(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=H(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=o??T.default;this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&y(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=t??T.default,r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=D(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),y(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||thiLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as N}from"./chunk-XB2TPQAQ.js";import{a}from"./chunk-TXOEXY5C.js";import{e as T}from"./chunk-VIMSDF2W.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new a("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new a("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new a("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,E,t){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("buffer is required.");switch(E=E??0,t=t??(e.byteLength-E)/r.getSizeInBytes(n),n){case r.BYTE:return new Int8Array(e,E,t);case r.UNSIGNED_BYTE:return new Uint8Array(e,E,t);case r.SHORT:return new Int16Array(e,E,t);case r.UNSIGNED_SHORT:return new Uint16Array(e,E,t);case r.INT:return new Int32Array(e,E,t);case r.UNSIGNED_INT:return new Uint32Array(e,E,t);case r.FLOAT:return new Float32Array(e,E,t);case r.DOUBLE:return new Float64Array(e,E,t);default:throw new a("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new a("name is not a valid value.")}};var A=Object.freeze(r);export{A as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as c,c as p}from"./chunk-F2ZMVLJV.js";import{a as u}from"./chunk-VGILZD7B.js";import{a as d}from"./chunk-RXYBLNW3.js";import{a as s}from"./chunk-TXOEXY5C.js";import{e as a}from"./chunk-VIMSDF2W.js";function e(t){this._ellipsoid=t??p.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});e.mercatorAngleToGeodeticLatitude=function(t){return d.PI_OVER_TWO-2*Math.atan(Math.exp(-t))};e.geodeticLatitudeToMercatorAngle=function(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let i=Math.sin(t);return .5*Math.log((1+i)/(1-i))};e.MaximumLatitude=e.mercatorAngleToGeodeticLatitude(Math.PI);e.prototype.project=function(t,i){let o=this._semimajorAxis,r=t.longitude*o,n=e.geodeticLatitudeToMercatorAngle(t.latitude)*o,m=t.height;return a(i)?(i.x=r,i.y=n,i.z=m,i):new u(r,n,m)};e.prototype.unproject=function(t,i){if(!a(t))throw new s("cartesian is required");let o=this._oneOverSemimajorAxis,r=t.x*o,n=e.mercatorAngleToGeodeticLatitude(t.y*o),m=t.z;return a(i)?(i.longitude=r,i.latitude=n,i.height=m,i):new c(r,n,m)};var A=e;export{A as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{k as N}from"./chunk-V6RJRUKY.js";import{a as S,b as z}from"./chunk-R6PWD5CA.js";import{a as p}from"./chunk-BDF6MEVU.js";import{b as C}from"./chunk-F2ZMVLJV.js";import{a as T,b as w}from"./chunk-VGILZD7B.js";import{a as m}from"./chunk-RXYBLNW3.js";import{a as h,b as c}from"./chunk-TXOEXY5C.js";import{e as b}from"./chunk-VIMSDF2W.js";var a={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};a.getMathType=function(e){switch(e){case a.SCALAR:return Number;case a.VEC2:return C;case a.VEC3:return T;case a.VEC4:return S;case a.MAT2:return N;case a.MAT3:return w;case a.MAT4:return z;default:throw new h("attributeType is not a valid value.")}};a.getNumberOfComponents=function(e){switch(e){case a.SCALAR:return 1;case a.VEC2:return 2;case a.VEC3:return 3;case a.VEC4:case a.MAT2:return 4;case a.MAT3:return 9;case a.MAT4:return 16;default:throw new h("attributeType is not a valid value.")}};a.getAttributeLocationCount=function(e){switch(e){case a.SCALAR:case a.VEC2:case a.VEC3:case a.VEC4:return 1;case a.MAT2:return 2;case a.MAT3:return 3;case a.MAT4:return 4;default:throw new h("attributeType is not a valid value.")}};a.getGlslType=function(e){switch(c.typeOf.string("attributeType",e),e){case a.SCALAR:return"float";case a.VEC2:return"vec2";case a.VEC3:return"vec3";case a.VEC4:return"vec4";case a.MAT2:return"mat2";case a.MAT3:return"mat3";case a.MAT4:return"mat4";default:throw new h("attributeType is not a valid value.")}};var F=Object.freeze(a);var V=1/256,k=65536,l=256,r={};r.octEncodeInRange=function(e,t,n){c.defined("vector",e),c.defined("result",n);let o=T.magnitudeSquared(e);if(Math.abs(o-1)>m.EPSILON6)throw new h("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*m.signNotZero(i),n.y=(1-Math.abs(i))*m.signNotZero(d)}return n.x=m.toSNorm(n.x,t),n.y=m.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var E=new C,D=new Uint8Array(1);function M(e){return D[0]=e,D[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,E),t.x=M(E.x*V),t.y=M(E.x),t.z=M(E.y*V),t.w=M(E.y),t};r.octDecodeInRange=function(e,t,n,o){if(c.defined("result",o),e<0||e>n||t<0||t>n)throw new h(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=m.fromSNorm(e,n),o.y=m.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*m.signNotZero(i),o.y=(1-Math.abs(i))*m.signNotZero(o.y)}return T.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){c.typeOf.object("encoded",e),c.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new h("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*l+o,s=i*l+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return c.defined("encoded",e),256*e.x+e.y};var x=new C;r.octEncodeFloat=function(e){return r.octEncode(e,x),r.octPackFloat(x)};r.octDecodeFloat=function(e,t){c.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){c.defined("v1",e),c.defined("v2",t),c.defined("v3",n),c.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,x);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){c.defined("packed",e),c.defined("v1",t),c.defined("v2",n),c.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),u=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(u,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){c.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){c.defined("compressed",e),c.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){c.defined("uBuffer",e),c.defined("vBuffer",t),c.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&c.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){c.defined("typedArray",e),c.defined("componentDatatype",t),c.defined("type",n),c.defined("count",o);let i=F.getNumberOfComponents(n),d;switch(t){case p.BYTE:d=127;break;case p.UNSIGNED_BYTE:d=255;break;case p.SHORT:d=32767;break;case p.UNSIGNED_SHORT:d=65535;break;case p.INT:d=2147483647;break;case p.UNSIGNED_INT:d=4294967295;break;default:throw new h(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let u=0;u<i;u++){let y=s*i+u;f[y]=Math.max(e[y]/d,-1)}return f};r.encodeRGB8=function(e){return c.typeOf.object("color",e),Math.rLine truncated
+28
View File
@@ -0,0 +1,28 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{e as f}from"./chunk-VIMSDF2W.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=`
${o}`),n}var i=c;function l(t){async function n({data:e}){let o=[],s={id:e.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=e.baseUrl;try{let r=await t(e.parameters,o);s.result=r}catch(r){r instanceof Error?s.error={name:r.name,message:r.message,stack:r.stack}:s.error=r}e.canTransferArrayBuffer||(o.length=0);try{postMessage(s,o)}catch(r){s.result=void 0,s.error=`postMessage failed with error: ${i(r)}
with responseMessage: ${JSON.stringify(s)}`,postMessage(s)}}function a(e){postMessage({id:e.data?.id,error:`postMessage failed with error: ${JSON.stringify(e)}`})}return self.onmessage=n,self.onmessageerror=a,self}var d=l;export{d as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
var r,u=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&u.decode();var a=null;function h(){return(a===null||a.byteLength===0)&&(a=new Uint8Array(r.memory.buffer)),a}function b(e,t){return e=e>>>0,u.decode(h().subarray(e,e+t))}var o=null;function g(){return(o===null||o.byteLength===0)&&(o=new Uint32Array(r.memory.buffer)),o}function m(e,t){return e=e>>>0,g().subarray(e/4,e/4+t)}var y=0;function x(e,t){let n=t(e.length*4,4)>>>0;return g().set(e,n/4),y=e.length,n}function c(e){let t=r.__wbindgen_export_0.get(e);return r.__externref_table_dealloc(e),t}function U(e,t,n,i,_){let s=r.generate_splat_texture(e,t,n,i,_);if(s[2])throw c(s[1]);return f.__wrap(s[0])}function M(e,t,n){let i=r.radix_sort_gaussians_indexes(e,t,n);if(i[2])throw c(i[1]);return c(i[0])}var w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_texturedata_free(e>>>0,1)),f=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,w.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,w.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_texturedata_free(t,0)}get data(){let t=r.texturedata_data(this.__wbg_ptr);var n=m(t[0],t[1]).slice();return r.__wbindgen_free(t[0],t[1]*4,4),n}get width(){return r.texturedata_width(this.__wbg_ptr)>>>0}get height(){return r.texturedata_height(this.__wbg_ptr)>>>0}static new(t,n,i){let _=x(t,r.__wbindgen_malloc),s=y,p=r.texturedata_new(_,s,n,i);return e.__wrap(p)}};async function A(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(i){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function d(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},e.wbg.__wbg_length_3b4f022188ae8db6=function(t){return t.length},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return t.length},e.wbg.__wbg_new_780abee5c1739fd7=function(t){return new Float32Array(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},e.wbg.__wbg_new_e3b321dcfef89fc7=function(t){return new Uint32Array(t)},e.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(t,n,i){return new Uint32Array(t,n>>>0,i>>>0)},e.wbg.__wbg_set_10bad9bee0e9c58b=function(t,n,i){t.set(n,i>>>0)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,i){t.set(n,i>>>0)},e.wbg.__wbindgen_init_externref_table=function(){let t=r.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)},e.wbg.__wbindgen_memory=function(){return r.memory},e.wbg.__wbindgen_string_new=function(t,n){return b(t,n)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(b(t,n))},e}function l(e,t){return r=e.exports,W.__wbindgen_wasm_module=t,o=null,a=null,r.__wbindgen_start(),r}function O(e){if(r!==void 0)return r;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=d();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return l(n,e)}async function W(e){if(r!==void 0)return r;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("wasm_splats_bg.wasm",import.meta.url));let t=d();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:i}=await A(await e,t);return l(n,i)}export{U as a,M as b,O as c};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{c as e}from"./chunk-VGILZD7B.js";function r(t){t=t??e.EMPTY_OBJECT,this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var n=r;export{n as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as tt}from"./chunk-CAEAJPBH.js";import{a as jt}from"./chunk-WAWDCDZ5.js";import{b as Lt}from"./chunk-5U3HZZCI.js";import{a as Et}from"./chunk-QITOM3FA.js";import{a as j}from"./chunk-74XTGJKF.js";import{a as dt,b as D,c as B,d as U}from"./chunk-AD7XFG6M.js";import{a as _t,c as ot}from"./chunk-WQ5ZC6ME.js";import{a as Ut}from"./chunk-XVAXSA53.js";import{a as pt,b as H}from"./chunk-R6PWD5CA.js";import{a as F}from"./chunk-BDF6MEVU.js";import{a as Mt,b as V}from"./chunk-F2ZMVLJV.js";import{a as r,b as gt,c as Ot}from"./chunk-VGILZD7B.js";import{a as N}from"./chunk-RXYBLNW3.js";import{a as I,b as ft}from"./chunk-TXOEXY5C.js";import{e as f}from"./chunk-VIMSDF2W.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as o}from"./chunk-VGILZD7B.js";import{a as p}from"./chunk-RXYBLNW3.js";import{a as O,b as r}from"./chunk-TXOEXY5C.js";import{e as a}from"./chunk-VIMSDF2W.js";var Ee=new o,Ce=new o;function Te(n,e,t,i,u){if(!a(n))throw new O("cartesian is required.");if(!a(e))throw new O("oneOverRadii is required.");if(!a(t))throw new O("oneOverRadiiSquared is required.");if(!a(i))throw new O("centerToleranceSquared is required.");let c=n.x,d=n.y,y=n.z,R=e.x,A=e.y,S=e.z,w=c*c*R*R,_=d*d*A*A,j=y*y*S*S,M=w+_+j,E=Math.sqrt(1/M),P=o.multiplyByScalar(n,E,Ee);if(M<i)return isFinite(E)?o.clone(P,u):void 0;let Y=t.x,Q=t.y,H=t.z,k=Ce;k.x=P.x*Y*2,k.y=P.y*Q*2,k.z=P.z*H*2;let I=(1-E)*o.magnitude(n)/(.5*o.magnitude(k)),se=0,J,fe,C,T,v,K,ee,te,de,pe,le;do{I-=se,C=1/(1+I*Y),T=1/(1+I*Q),v=1/(1+I*H),K=C*C,ee=T*T,te=v*v,de=K*C,pe=ee*T,le=te*v,J=w*K+_*ee+j*te-1,fe=w*de*Y+_*pe*Q+j*le*H;let je=-2*fe;se=J/je}while(Math.abs(J)>p.EPSILON12);return a(u)?(u.x=c*C,u.y=d*T,u.z=y*v,u):new o(c*C,d*T,y*v)}var B=Te;function f(n,e,t){this.longitude=n??0,this.latitude=e??0,this.height=t??0}f.fromRadians=function(n,e,t,i){return r.typeOf.number("longitude",n),r.typeOf.number("latitude",e),t=t??0,a(i)?(i.longitude=n,i.latitude=e,i.height=t,i):new f(n,e,t)};f.fromDegrees=function(n,e,t,i){return r.typeOf.number("longitude",n),r.typeOf.number("latitude",e),n=p.toRadians(n),e=p.toRadians(e),f.fromRadians(n,e,t,i)};var ve=new o,Fe=new o,Me=new o;f._ellipsoidOneOverRadii=new o(1/6378137,1/6378137,1/6356752314245179e-9);f._ellipsoidOneOverRadiiSquared=new o(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));f._ellipsoidCenterToleranceSquared=p.EPSILON1;f.fromCartesian=function(n,e,t){let i=a(e)?e.oneOverRadii:f._ellipsoidOneOverRadii,u=a(e)?e.oneOverRadiiSquared:f._ellipsoidOneOverRadiiSquared,c=a(e)?e._centerToleranceSquared:f._ellipsoidCenterToleranceSquared,d=B(n,i,u,c,Fe);if(!a(d))return;let y=o.multiplyComponents(d,u,ve);y=o.normalize(y,y);let R=o.subtract(n,d,Me),A=Math.atan2(y.y,y.x),S=Math.asin(y.z),w=p.sign(o.dot(R,n))*o.magnitude(R);return a(t)?(t.longitude=A,t.latitude=S,t.height=w,t):new f(A,S,w)};f.toCartesian=function(n,e,t){return r.defined("cartographic",n),o.fromRadians(n.longitude,n.latitude,n.height,e,t)};f.clone=function(n,e){if(a(n))return a(e)?(e.longitude=n.longitude,e.latitude=n.latitude,e.height=n.height,e):new f(n.longitude,n.latitude,n.height)};f.equals=function(n,e){return n===e||a(n)&&a(e)&&n.longitude===e.longitude&&n.latitude===e.latitude&&n.height===e.height};f.equalsEpsilon=function(n,e,t){return t=t??0,n===e||a(n)&&a(e)&&Math.abs(n.longitude-e.longitude)<=t&&Math.abs(n.latitude-e.latitude)<=t&&Math.abs(n.height-e.height)<=t};f.ZERO=Object.freeze(new f(0,0,0));f.prototype.clone=function(n){return f.clone(this,n)};f.prototype.equals=function(n){return f.equals(this,n)};f.prototype.equalsEpsilon=function(n,e){return f.equalsEpsilon(this,n,e)};f.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var N=f;var l=class n{constructor(e,t){this.x=e??0,this.y=t??0}static fromElements(e,t,i){return a(i)?(i.x=e,i.y=t,i):new n(e,t)}static clone(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t):new n(e.x,e.y)}static pack(e,t,i){return r.typeOf.object("value",e),r.defined("array",t),i=i??0,t[i++]=e.x,t[i]=e.y,t}static unpack(e,t,i){return r.defined("array",e),t=t??0,a(i)||(i=new n),i.x=e[t++],i.y=e[t],i}static packArray(e,t){r.defined("array",e);let i=e.length,u=i*2;if(!a(t))t=new Array(u);else{if(!Array.isArray(t)&&t.length!==u)throw new O("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==u&&(t.length=u)}for(let c=0;c<i;++c)n.pack(e[c],t,c*2);return t}static unpackArray(e,t){if(r.defined("array",e),r.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new O("array length must be a multiple of 2.");let i=e.length;a(t)?t.length=i/2:t=new Array(i/2);for(let u=0;u<i;u+=2){let c=u/2;t[c]=n.unpack(e,u,t[c])}return t}static maximumComponent(e){return r.typeOf.object("cartesian",e),Math.max(e.x,e.y)}static minimumComponent(e){return r.typeOf.object("cartesian",e),Math.min(e.x,e.y)}static minimumByComponent(e,t,i){return r.typeOf.object("first",e),r.typeOf.object("second",t),r.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i}static maximumByComponent(e,t,i){return r.typeOf.object("first",e),r.typeOf.object("second",t),r.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i}static clamp(e,t,i,u){r.typeOf.object("value",e),r.typeOf.object("min",t),r.typeOf.object("max",i),r.typeOf.object("result",u);let c=p.clamp(e.x,t.x,i.x),d=p.clamp(e.y,t.y,i.y);return u.x=c,u.y=d,u}static magnitudeSquared(e){return r.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y}static magnitude(e){return Math.sqrt(n.magnitudeSquared(e))}static distance(e,t){return r.typeOf.object("left",e),r.typeOf.object("right",t),n.subtract(e,t,W),n.magnitude(W)}static distanceSquared(e,t){return r.typeOf.object("lLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as b}from"./chunk-OSSC4KDI.js";import{a as u}from"./chunk-5LHPDHWM.js";import{a as O}from"./chunk-EJPD5BNO.js";import{b as w,c as h,d as y}from"./chunk-AD7XFG6M.js";import{c as l}from"./chunk-WQ5ZC6ME.js";import{a as p}from"./chunk-BDF6MEVU.js";import{a as i,c as A}from"./chunk-VGILZD7B.js";import{a as d,b as c}from"./chunk-TXOEXY5C.js";import{e as x}from"./chunk-VIMSDF2W.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(72),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y(Line truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as w}from"./chunk-RXYBLNW3.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as J}from"./chunk-HZDH6VFE.js";import{a as I}from"./chunk-QITOM3FA.js";import{b as G,c as k}from"./chunk-WQ5ZC6ME.js";import{a as B}from"./chunk-XVAXSA53.js";import{j as X}from"./chunk-V6RJRUKY.js";import{b as j}from"./chunk-R6PWD5CA.js";import{a as S,b as z,c as F}from"./chunk-F2ZMVLJV.js";import{a as t,b as d}from"./chunk-VGILZD7B.js";import{a as g}from"./chunk-RXYBLNW3.js";import{a as b,b as W}from"./chunk-TXOEXY5C.js";import{e as p}from"./chunk-VIMSDF2W.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as h}from"./chunk-GVYQ2MV7.js";import{b as y}from"./chunk-F2ZMVLJV.js";import{a as n,b as a}from"./chunk-VGILZD7B.js";import{b as f}from"./chunk-TXOEXY5C.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as d}from"./chunk-XVAXSA53.js";import{a as i}from"./chunk-VGILZD7B.js";import{b as a}from"./chunk-TXOEXY5C.js";import{e as c}from"./chunk-VIMSDF2W.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return a.defined("minimum",m),a.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,u=m[0].y,o=m[0].z,r=m[0].x,h=m[0].y,l=m[0].z,A=m.length;for(let z=1;z<A;z++){let B=m[z],E=B.x,M=B.y,p=B.z;e=Math.min(E,e),r=Math.max(E,r),u=Math.min(M,u),h=Math.max(M,h),o=Math.min(p,o),l=Math.max(p,l)}let x=n.minimum;x.x=e,x.y=u,x.z=o;let f=n.maximum;return f.x=r,f.y=h,f.z=l,n.center=i.midpoint(x,f,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var y=new i;t.intersectPlane=function(m,n){a.defined("box",m),a.defined("plane",n),y=i.subtract(m.maximum,m.minimum,y);let e=i.multiplyByScalar(y,.5,y),u=n.normal,o=e.x*Math.abs(u.x)+e.y*Math.abs(u.y)+e.z*Math.abs(u.z),r=i.dot(m.center,u)+n.distance;return r-o>0?d.INSIDE:r+o<0?d.OUTSIDE:d.INTERSECTING};t.intersectAxisAlignedBoundingBox=function(m,n){return a.defined("box",m),a.defined("other",n),m.minimum.x<=n.maximum.x&&m.maximum.x>=n.minimum.x&&m.minimum.y<=n.maximum.y&&m.maximum.y>=n.minimum.y&&m.minimum.z<=n.maximum.z&&m.maximum.z>=n.minimum.z};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.intersectAxisAlignedBoundingBox=function(m){return t.intersectAxisAlignedBoundingBox(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var O=t;export{O as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as P}from"./chunk-HJG35BQ3.js";import{a as u,b as d}from"./chunk-5U3HZZCI.js";import{a as j}from"./chunk-QITOM3FA.js";import{i as A}from"./chunk-V6RJRUKY.js";import{a as _,b as h}from"./chunk-R6PWD5CA.js";import{b as l,c as g}from"./chunk-F2ZMVLJV.js";import{a as e}from"./chunk-VGILZD7B.js";import{a as y,b as p}from"./chunk-TXOEXY5C.js";import{e as r}from"./chunk-VIMSDF2W.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as L}from"./chunk-V2KE7XRI.js";import{a as S}from"./chunk-OSSC4KDI.js";import{a as D}from"./chunk-74XTGJKF.js";import{a as H}from"./chunk-EJPD5BNO.js";import{b as T,c as B,d as x}from"./chunk-AD7XFG6M.js";import{c as E}from"./chunk-WQ5ZC6ME.js";import{a as O}from"./chunk-BDF6MEVU.js";import{c as d}from"./chunk-F2ZMVLJV.js";import{a as c,c as V}from"./chunk-VGILZD7B.js";import{a as w}from"./chunk-RXYBLNW3.js";import{a as A}from"./chunk-TXOEXY5C.js";import{e as a}from"./chunk-VIMSDF2W.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attribuLine truncated
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as F}from"./chunk-OSSC4KDI.js";import{a as Z}from"./chunk-74XTGJKF.js";import{a as X}from"./chunk-EJPD5BNO.js";import{b as K,c as Q,d as U}from"./chunk-AD7XFG6M.js";import{c as H}from"./chunk-WQ5ZC6ME.js";import{a as y}from"./chunk-BDF6MEVU.js";import{c as J}from"./chunk-F2ZMVLJV.js";import{a as r,c as V}from"./chunk-VGILZD7B.js";import{a as N}from"./chunk-RXYBLNW3.js";import{a as b}from"./chunk-TXOEXY5C.js";import{e as R}from"./chunk-VIMSDF2W.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a};
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.139.1
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as P,c as B}from"./chunk-F2ZMVLJV.js";import{a as y}from"./chunk-VGILZD7B.js";import{a as L}from"./chunk-RXYBLNW3.js";import{b as q}from"./chunk-TXOEXY5C.js";import{e as T}from"./chunk-VIMSDF2W.js";function X(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,f=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-f)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,M=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,u=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,d=1-3*c+35*o/4,g=1-5*c,w=u*M-C*Math.sin(2*M)*c/2-d*Math.sin(4*M)*o/16-g*Math.sin(6*M)*h/48-Math.sin(8*M)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=f,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=M,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=u,s.a1=C,s.a2=d,s.a3=g,s.distanceRatio=w}function Y(n,a){return n*a*(4+n*(4-3*a))/16}function k(n,a,t,e,f,m,_){let r=Y(n,t);return(1-r)*n*a*(e+r*f*(_+r*m*(2*_*_-1)))}function Z(n,a,t,e,f,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(f)),M=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(M),A=Math.sin(M),c=l*i,o=l*A,h=U*A,S=U*i,u=p,C=L.TWO_PI,d=Math.cos(u),g=Math.sin(u),w,s,O,H,b;do{d=Math.cos(u),g=Math.sin(u);let z=o-S*d;O=Math.sqrt(i*i*g*g+z*z),s=h+c*d,w=Math.atan2(O,s);let D;O===0?(D=0,H=1):(D=c*g/O,H=1-D*D),C=u,b=s-2*h/H,isFinite(b)||(b=0),u=p+k(r,D,H,w,O,s,b)}while(Math.abs(u-C)>L.EPSILON12);let v=H*(a*a-t*t)/(t*t),W=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,J=I*O*(b+I*(s*(2*F-1)-I*b*(4*O*O-3)*(4*F-3)/6)/4),K=t*W*(w-J),Q=Math.atan2(i*g,o-S*d),V=Math.atan2(l*g,o*d-S);n._distance=K,n._startHeading=Q,n._endHeading=V,n._uSquared=v}var $=new y,x=new y;function N(n,a,t,e){let f=y.normalize(e.cartographicToCartesian(a,x),$),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(f,m))-Math.PI),.0125),Z(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=P.clone(a,n._start),n._end=P.clone(t,n._end),n._start.height=0,n._end.height=0,X(n)}function E(n,a,t){let e=t??B.default;this._ellipsoid=e,this._start=new P,this._end=new P,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,T(n)&&T(a)&&N(this,n,a,e)}Object.defineProperties(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});E.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),N(this,n,a,this._ellipsoid)};E.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};E.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,f=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),M=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*f/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*f-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*M/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),u=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),d=Math.sin(h),g=Math.cos(h),w=t.cosineU*g,s=t.sineU*d,H=Math.atan2(d*t.sineHeading,w-s*t.cosineHeading)-k(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,d,g,C);return T(a)?(a.longitude=this._start.longitude+H,a.latitude=u,a.height=0,a):new P(this._start.longitude+H,u,0)};var et=E;export{et as a};
Loaded 100 of 505 files, more files were not shown because too many files have changed in this diff. Show more