-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
259 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
# dde-earth-vite-example | ||
|
||
## 0.0.12 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
- @dde-earth/plugin-martini-terrain-loader@1.0.3 | ||
- @dde-earth/plugin-mvt-loader@1.2.3 | ||
- @dde-earth/plugin-nc-loader@1.2.3 | ||
- @dde-earth/plugin-tiff-loader@1.2.3 | ||
- @dde-earth/recommend-plugins@1.3.3 | ||
|
||
## 0.0.11 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# dde-earth | ||
|
||
## 1.2.3 | ||
|
||
### Patch Changes | ||
|
||
- export EventEmitter | ||
|
||
## 1.2.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# @dde-earth/plugin-feature-click | ||
|
||
## 1.3.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "@dde-earth/plugin-feature-click", | ||
"version": "1.3.3", | ||
"type": "module", | ||
"main": "./dist/lib/index.js", | ||
"module": "./dist/es/index.js", | ||
"types": "./dist/typings/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "rimraf dist && rollup -c", | ||
"dev": "rollup -c --watch" | ||
}, | ||
"keywords": [ | ||
"cesium", | ||
"dde" | ||
], | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"cesium": "*" | ||
}, | ||
"devDependencies": { | ||
"@dde-earth/recommend-plugins": "workspace:^", | ||
"cesium": "latest" | ||
}, | ||
"engines": { | ||
"node": "^18.0.0 || >=20.0.0" | ||
}, | ||
"dependencies": { | ||
"@cesium-extends/primitive-geojson": "^1.0.7", | ||
"dde-earth": "workspace:^" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createConfig } from "../../shared/rollup.config.mjs"; | ||
|
||
export default createConfig(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Earth } from "dde-earth"; | ||
|
||
declare module "dde-earth" { | ||
namespace Earth { | ||
interface Events { | ||
FEATURE_CLICK: [ | ||
reslt: { | ||
feature: any; | ||
position?: number[]; | ||
properties: any; | ||
[key: string]: any; | ||
}, | ||
]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import type { Earth, EventEmitter } from "dde-earth"; | ||
|
||
import "./api"; | ||
|
||
import { GeoJsonPrimitiveLayer } from "@cesium-extends/primitive-geojson"; | ||
import { JulianDate } from "cesium"; | ||
import { BasePlugin } from "dde-earth"; | ||
|
||
import type { Subscriber } from "@dde-earth/recommend-plugins"; | ||
import type { DataSource, Entity } from "cesium"; | ||
|
||
export class FeatureClick extends BasePlugin< | ||
FeatureClick.Args, | ||
FeatureClick.Intl | ||
> { | ||
name = "FeatureClick"; | ||
private _subscriber: Subscriber | undefined; | ||
private _eventEmitter: EventEmitter | undefined; | ||
|
||
public init(earth: Earth) { | ||
this._init(earth); | ||
this._subscriber = this.earth.getSubscriber(); | ||
this._eventEmitter = this.earth.eventEmitter; | ||
this.addListner(); | ||
return this; | ||
} | ||
|
||
addListner() { | ||
if (!this._subscriber || !this._eventEmitter) return; | ||
|
||
const sub = this._subscriber; | ||
sub.on("LEFT_CLICK", (move, result) => { | ||
if (result?.id) { | ||
const entity = result.id as Entity; | ||
const properties = entity.properties?.propertyNames?.length | ||
? entity.properties?.getValue(new JulianDate()) | ||
: undefined; | ||
const position = sub.cartesiantoLonlat( | ||
entity.position?.getValue(new JulianDate()), | ||
); | ||
|
||
this.earth.emit("FEATURE_CLICK", { | ||
feature: entity, | ||
properties, | ||
position, | ||
}); | ||
} | ||
}); | ||
|
||
this.earth.on("layer:add", (layerItem) => { | ||
const layer = layerItem.instance; | ||
if (layer instanceof GeoJsonPrimitiveLayer) { | ||
sub.on("LEFT_CLICK", (move, result) => { | ||
if (result?.primitive) { | ||
const id = result.id; | ||
const feature = layer.getFeatureItemById(id); | ||
if (feature) | ||
this.earth.emit("FEATURE_CLICK", { | ||
feature: feature, | ||
properties: feature.properties, | ||
position: sub.cartesiantoLonlat(feature.center?.cartesian3), | ||
}); | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
export namespace FeatureClick { | ||
export type Intl = {}; | ||
|
||
export type Args = []; | ||
|
||
export type SupportedLayer = GeoJsonPrimitiveLayer | DataSource; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"lib": ["esnext", "dom"], | ||
"allowSyntheticDefaultImports": true, | ||
"moduleResolution": "node", | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"resolveJsonModule": true, | ||
"skipDefaultLibCheck": true, | ||
"skipLibCheck": true, | ||
"outDir": "./dist", | ||
"declaration": true, | ||
"inlineSourceMap": true, | ||
"types": ["node"] | ||
}, | ||
"include": ["src/**/*", "test/**/*"], | ||
"exclude": ["**/dist/**"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/plugin-geojson-loader | ||
|
||
## 1.2.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.2.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/plugin-martini-terrain-loader | ||
|
||
## 1.0.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.0.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/plugin-mvt-loader | ||
|
||
## 1.2.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.2.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/plugin-nc-loader | ||
|
||
## 1.2.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.2.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/plugin-tiff-loader | ||
|
||
## 1.2.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.2.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @dde-earth/recommend-plugins | ||
|
||
## 1.3.3 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
|
||
## 1.3.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.