Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support CZML in reearth/core (#383)
* chore: remove legacy prefix for Resource component * feat: support CZML * feat: add extractSimpleLayerData util * Update src/core/engines/Cesium/Feature/Resource/index.stories.tsx Co-authored-by: rot1024 <aayhrot@gmail.com> * feat: support glTF on reearth/core (#386) * feat: support gltf * fix: add url in model appearance Co-authored-by: rot1024 <aayhrot@gmail.com>
- Loading branch information
Showing
16 changed files
with
259 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[ | ||
{ | ||
"id": "document", | ||
"name": "Japan", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"id": "1", | ||
"name": "Sendai city", | ||
"description": "This is Sendai city of Miyagi prefecture.", | ||
"position": { | ||
"cartographicDegrees": [ | ||
140.87636805791237, | ||
38.26835288549171, | ||
0 | ||
] | ||
}, | ||
"point": { | ||
"color": { "rgba": [255, 0, 255, 255] }, | ||
"pixelSize": 100 | ||
} | ||
}, | ||
{ | ||
"id": "2", | ||
"name": "Fukushima city", | ||
"description": "This is Fukushima city of Fukushima prefecture.", | ||
"position": { | ||
"cartographicDegrees": [ | ||
140.47334452422348, | ||
37.76702444930477, | ||
0 | ||
] | ||
}, | ||
"point": { | ||
"color": { "rgba": [0, 255, 255, 255] }, | ||
"pixelSize": 100 | ||
} | ||
}, | ||
{ | ||
"id": "3", | ||
"name": "Tokyo", | ||
"description": "This is Tokyo prefecture.", | ||
"position": { | ||
"cartographicDegrees": [ | ||
139.6904487961309, | ||
35.685394553171434, | ||
0 | ||
] | ||
}, | ||
"point": { | ||
"color": { "rgba": [255, 255, 0, 255] }, | ||
"pixelSize": 100 | ||
} | ||
} | ||
] |
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,70 @@ | ||
{ | ||
"scene": 0, | ||
"scenes" : [ | ||
{ | ||
"nodes" : [ 0 ] | ||
} | ||
], | ||
|
||
"nodes" : [ | ||
{ | ||
"mesh" : 0 | ||
} | ||
], | ||
|
||
"meshes" : [ | ||
{ | ||
"primitives" : [ { | ||
"attributes" : { | ||
"POSITION" : 1 | ||
}, | ||
"indices" : 0 | ||
} ] | ||
} | ||
], | ||
|
||
"buffers" : [ | ||
{ | ||
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=", | ||
"byteLength" : 44 | ||
} | ||
], | ||
"bufferViews" : [ | ||
{ | ||
"buffer" : 0, | ||
"byteOffset" : 0, | ||
"byteLength" : 6, | ||
"target" : 34963 | ||
}, | ||
{ | ||
"buffer" : 0, | ||
"byteOffset" : 8, | ||
"byteLength" : 36, | ||
"target" : 34962 | ||
} | ||
], | ||
"accessors" : [ | ||
{ | ||
"bufferView" : 0, | ||
"byteOffset" : 0, | ||
"componentType" : 5123, | ||
"count" : 3, | ||
"type" : "SCALAR", | ||
"max" : [ 2 ], | ||
"min" : [ 0 ] | ||
}, | ||
{ | ||
"bufferView" : 1, | ||
"byteOffset" : 0, | ||
"componentType" : 5126, | ||
"count" : 3, | ||
"type" : "VEC3", | ||
"max" : [ 1.0, 1.0, 0.0 ], | ||
"min" : [ 0.0, 0.0, 0.0 ] | ||
} | ||
], | ||
|
||
"asset" : { | ||
"version" : "2.0" | ||
} | ||
} |
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,49 @@ | ||
import { Meta, Story } from "@storybook/react"; | ||
|
||
import { engine } from "../../"; | ||
import Component, { Props } from "../../../../Map"; | ||
|
||
export default { | ||
title: "core/engines/Cesium/Feature/Model", | ||
component: Component, | ||
parameters: { actions: { argTypesRegex: "^on.*" } }, | ||
} as Meta; | ||
|
||
const Template: Story<Props> = args => <Component {...args} />; | ||
|
||
export const Default = Template.bind([]); | ||
Default.args = { | ||
engine: "cesium", | ||
engines: { | ||
cesium: engine, | ||
}, | ||
ready: true, | ||
layers: [ | ||
{ | ||
id: "l", | ||
type: "simple", | ||
data: { | ||
type: "geojson", | ||
value: { | ||
type: "Feature", | ||
geometry: { | ||
type: "Point", | ||
coordinates: [0, 0, 1000], | ||
}, | ||
}, | ||
}, | ||
model: { | ||
url: "/BoxAnimated.glb", | ||
scale: 1000000, | ||
}, | ||
}, | ||
], | ||
property: { | ||
tiles: [ | ||
{ | ||
id: "default", | ||
tile_type: "default", | ||
}, | ||
], | ||
}, | ||
}; |
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
40 changes: 40 additions & 0 deletions
40
src/core/engines/Cesium/Feature/Resource/index.stories.tsx
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,40 @@ | ||
import { Meta, Story } from "@storybook/react"; | ||
|
||
import { engine } from "../.."; | ||
import Component, { Props } from "../../../../Map"; | ||
|
||
export default { | ||
title: "core/engines/Cesium/Feature/Resource", | ||
component: Component, | ||
parameters: { actions: { argTypesRegex: "^on.*" } }, | ||
} as Meta; | ||
|
||
const Template: Story<Props> = args => <Component {...args} />; | ||
|
||
export const Default = Template.bind([]); | ||
Default.args = { | ||
engine: "cesium", | ||
engines: { | ||
cesium: engine, | ||
}, | ||
ready: true, | ||
layers: [ | ||
{ | ||
id: "l", | ||
type: "simple", | ||
data: { | ||
type: "czml", | ||
url: "/testdata/sample.czml", | ||
}, | ||
resource: {}, | ||
}, | ||
], | ||
property: { | ||
tiles: [ | ||
{ | ||
id: "default", | ||
tile_type: "default", | ||
}, | ||
], | ||
}, | ||
}; |
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
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
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
Oops, something went wrong.