Skip to content

Commit

Permalink
Add ImageIconEntity to Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaMatsuzaki committed Jun 29, 2022
1 parent 95db9ac commit 3c61984
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/development/Scene-Schema.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ start => <SCENE>
id?: <ID>
altitude_mode?: <ALTITUDE-MODE> = "absolute"
visibility?: Boolean = true
<MODEL-CONTENT> | <MARKERLINE-CONTENT> | <PATH-CONTENT> | <TEXT-CONTENT> | <POLYGON-CONTENT> | <PIN-CONTENT>
<MODEL-CONTENT> | <MARKERLINE-CONTENT> | <PATH-CONTENT> | <TEXT-CONTENT> | <POLYGON-CONTENT> | <PIN-CONTENT> | <IMAGEICON-CONTENT>
}

<MODEL-CONTENT> =>
Expand Down Expand Up @@ -73,6 +73,12 @@ start => <SCENE>
bg_color?: <PARAM-VEC3> = [0.35, 0.61, 0.81]
font_family?: String = "sans-serif"

<IMAGEICON-CONTENT> =>
type: "imageicon"
entries: [<IMAGEICON-ENTRY>*]
size?: <PARAM-VEC2> = [30, 30]
origin?: <PARAM-VEC2> = [0.5, 0.5]

<TRANSFORM> => {
position: <GEO-POINT>
heading?: <PARAM-FLOAT> = 0
Expand Down Expand Up @@ -116,6 +122,13 @@ start => <SCENE>
id?: <ID>
}

<IMAGEICON-ENTRY> => {
image_src: <URL>
position: <PARAM-VEC2>
size?: <PARAM-VEC2>
id?: <ID>
}

<BOUNDARY> => {
type?: <BOUNDARY-TYPE> = "outer"
points: <GEO-POINTS>
Expand Down
4 changes: 4 additions & 0 deletions packages/mapray/src/SceneLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import TextEntity from "./TextEntity";
import ModelEntity from "./ModelEntity";
import PolygonEntity from "./PolygonEntity";
import PinEntity from "./PinEntity";
import ImageIconEntity from "./ImageIconEntity";
import GLEnv from "./GLEnv";
import GltfTool from "./gltf/Tool";
import Resource, { URLResource } from "./Resource";
Expand Down Expand Up @@ -228,6 +229,9 @@ class SceneLoader extends Loader {
case "pin":
entity = new PinEntity( scene, { json: item, refs: this._references } as PinEntity.Option);
break;
case "imageicon":
entity = new ImageIconEntity( scene, { json: item, refs: this._references } as ImageIconEntity.Option);
break;
default:
console.error( "mapray: unknown entity type: " + type );
break;
Expand Down

0 comments on commit 3c61984

Please sign in to comment.