@equinor/videx-map 1.14.9 → 1.14.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EventHandler.d.ts +21 -0
- package/dist/ExplorationLayer.d.ts +38 -0
- package/dist/FaultlineModule.d.ts +52 -0
- package/dist/FieldModule.d.ts +113 -0
- package/dist/GeoJSONModule/GeoJSONModule.d.ts +47 -0
- package/dist/GeoJSONModule/constants.d.ts +13 -0
- package/dist/GeoJSONModule/index.d.ts +6 -0
- package/dist/GeoJSONModule/interfaces.d.ts +15 -0
- package/dist/GeoJSONModule/labels.d.ts +46 -0
- package/dist/GeoJSONModule/linestring.d.ts +55 -0
- package/dist/GeoJSONModule/multipolygon.d.ts +94 -0
- package/dist/GeoJSONModule/point.d.ts +26 -0
- package/dist/GeoJSONModule/polygon.d.ts +96 -0
- package/dist/GeoJSONModule/shader.d.ts +10 -0
- package/dist/ModuleInterface.d.ts +26 -0
- package/dist/OutlineModule.d.ts +81 -0
- package/dist/ResizeConfigInterface.d.ts +14 -0
- package/dist/WellboreModule.d.ts +126 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.umd.js +1 -0
- package/dist/pixiOverlayInterfaces.d.ts +16 -0
- package/dist/utils/ComparableArray.d.ts +60 -0
- package/dist/utils/LineDictionary.d.ts +89 -0
- package/dist/utils/LineInterpolator.d.ts +84 -0
- package/dist/utils/Log.d.ts +1 -0
- package/dist/utils/Mesh.d.ts +46 -0
- package/dist/utils/PointDictionary.d.ts +58 -0
- package/dist/utils/Radius.d.ts +2 -0
- package/dist/utils/Rect.d.ts +27 -0
- package/dist/utils/TriangleDictionary.d.ts +21 -0
- package/dist/utils/WellboreMesh.d.ts +51 -0
- package/dist/utils/centerOfMass.d.ts +8 -0
- package/dist/utils/fields/Highlighter.d.ts +33 -0
- package/dist/utils/fields/LabelManager.d.ts +62 -0
- package/dist/utils/fields/groupLabels.d.ts +5 -0
- package/dist/utils/fields/preprocessFields.d.ts +29 -0
- package/dist/utils/generateCircle.d.ts +10 -0
- package/dist/utils/linePoint.d.ts +27 -0
- package/dist/utils/lineReducer.d.ts +9 -0
- package/dist/utils/wellbores/AsyncLoop.d.ts +35 -0
- package/dist/utils/wellbores/Colors.d.ts +40 -0
- package/dist/utils/wellbores/Config.d.ts +80 -0
- package/dist/utils/wellbores/DataManager.d.ts +15 -0
- package/dist/utils/wellbores/Highlight.d.ts +18 -0
- package/dist/utils/wellbores/LabelType.d.ts +9 -0
- package/dist/utils/wellbores/Projector.d.ts +20 -0
- package/dist/utils/wellbores/RealtimeWellbore.d.ts +21 -0
- package/dist/utils/wellbores/Shader.d.ts +41 -0
- package/dist/utils/wellbores/data/Group.d.ts +48 -0
- package/dist/utils/wellbores/data/RootData.d.ts +29 -0
- package/dist/utils/wellbores/data/SourceData.d.ts +25 -0
- package/dist/utils/wellbores/data/WellboreData.d.ts +76 -0
- package/dist/utils/wellbores/data/WellboreEventData.d.ts +17 -0
- package/dist/utils/wellbores/data/details/Detail.d.ts +20 -0
- package/dist/utils/wellbores/data/details/DetailOptions.d.ts +7 -0
- package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +14 -0
- package/dist/utils/wellbores/data/details/index.d.ts +11 -0
- package/dist/utils/wellbores/data/index.d.ts +6 -0
- package/dist/utils/wellbores/highlight-helper.d.ts +6 -0
- package/dist/utils/wellbores/intervals.d.ts +15 -0
- package/dist/utils/wellbores/labels/Label.d.ts +39 -0
- package/dist/utils/wellbores/labels/index.d.ts +2 -0
- package/dist/utils/wellbores/labels/label-helper.d.ts +3 -0
- package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -0
- package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -0
- package/dist/utils/wellbores/registries/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface EventHandlerCallbacks {
|
|
2
|
+
mousemove: (event: MouseEvent) => boolean;
|
|
3
|
+
mouseout: (event: MouseEvent) => boolean;
|
|
4
|
+
mousedown: (event: MouseEvent) => boolean;
|
|
5
|
+
mouseup: (event: MouseEvent) => boolean;
|
|
6
|
+
click: (event: Event) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface EventHandler {
|
|
9
|
+
map: L.Map;
|
|
10
|
+
element: HTMLElement;
|
|
11
|
+
callbacks: EventHandlerCallbacks;
|
|
12
|
+
register(map: L.Map, element: HTMLElement, callbacks: EventHandlerCallbacks): void;
|
|
13
|
+
unregister(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class DefaultEventHandler implements EventHandler {
|
|
16
|
+
map: L.Map;
|
|
17
|
+
element: HTMLElement;
|
|
18
|
+
callbacks: EventHandlerCallbacks;
|
|
19
|
+
register(map: L.Map, element: HTMLElement, callbacks: EventHandlerCallbacks): void;
|
|
20
|
+
unregister(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import { ModuleInterface } from './ModuleInterface';
|
|
3
|
+
import { RootUniforms } from './utils/wellbores/Shader';
|
|
4
|
+
import PointDictionary from './utils/PointDictionary';
|
|
5
|
+
/**
|
|
6
|
+
* Data assigned each point in point dictionary.
|
|
7
|
+
*/
|
|
8
|
+
interface PointData {
|
|
9
|
+
mesh: PIXI.Mesh;
|
|
10
|
+
uniforms: RootUniforms;
|
|
11
|
+
}
|
|
12
|
+
interface selection {
|
|
13
|
+
point: PointData;
|
|
14
|
+
/** Original z-index. */
|
|
15
|
+
zIndex: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Exploration layer
|
|
19
|
+
*
|
|
20
|
+
* Layer for displaying exploration wells.
|
|
21
|
+
*/
|
|
22
|
+
export default class ExplorationLayer extends ModuleInterface {
|
|
23
|
+
/** Dictionary used to manage points. */
|
|
24
|
+
pointDict: PointDictionary<PointData>;
|
|
25
|
+
/** Initial scale. */
|
|
26
|
+
prevScale: number;
|
|
27
|
+
/** Current selection */
|
|
28
|
+
selection: selection;
|
|
29
|
+
appendExploration(scale?: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* @param scale
|
|
32
|
+
* @returns Clamped scale
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
clampScale(scale: number): number;
|
|
36
|
+
highlight(lat: number, long: number): boolean;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import { ModuleInterface } from './ModuleInterface';
|
|
3
|
+
/** Data format on incoming faultlines */
|
|
4
|
+
interface FaultlineData {
|
|
5
|
+
coordinates: [number, number][];
|
|
6
|
+
geometry: string;
|
|
7
|
+
modelGuid: string;
|
|
8
|
+
omniaUpdateDate: string;
|
|
9
|
+
segID: number;
|
|
10
|
+
source: string;
|
|
11
|
+
sourceCreateDate: string;
|
|
12
|
+
sourceFileName: string;
|
|
13
|
+
sourceUpdateDate: string;
|
|
14
|
+
}
|
|
15
|
+
/** Interface for faultline config. */
|
|
16
|
+
export interface InputConfig {
|
|
17
|
+
/** Color of faultline on format 0xRRGGBB. (Default: 0x727D88) */
|
|
18
|
+
color?: number;
|
|
19
|
+
/** Alpha of faultlines. (Default: 1.0) */
|
|
20
|
+
alpha?: number;
|
|
21
|
+
/** Width of outline. (Default: 0.125) */
|
|
22
|
+
outlineWidth?: number;
|
|
23
|
+
}
|
|
24
|
+
interface Config {
|
|
25
|
+
/** Color of faultline on format 0xRRGGBB. (Default: 0x727D88) */
|
|
26
|
+
color: number;
|
|
27
|
+
/** Alpha of faultlines. (Default: 1.0) */
|
|
28
|
+
alpha: number;
|
|
29
|
+
/** Width of outline. (Default: 0.125) */
|
|
30
|
+
outlineWidth: number;
|
|
31
|
+
}
|
|
32
|
+
/** Module for displaying faultlines. */
|
|
33
|
+
export default class FaultlineModule extends ModuleInterface {
|
|
34
|
+
/** Graphic elements currently existing in world space. */
|
|
35
|
+
spawned: PIXI.Graphics[];
|
|
36
|
+
/** Pool of initialized graphic elements. */
|
|
37
|
+
pool: PIXI.Graphics[];
|
|
38
|
+
/** Default config. */
|
|
39
|
+
config: Config;
|
|
40
|
+
constructor(config?: InputConfig);
|
|
41
|
+
destroy(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Set collection of faultlines to display. Clears previous content on execution.
|
|
44
|
+
* @param data Faultlines to draw
|
|
45
|
+
* @param redraw Should pixiOverlay be redrawn after setting data? (Default: false)
|
|
46
|
+
*/
|
|
47
|
+
set(data: FaultlineData[], redraw?: boolean): void;
|
|
48
|
+
/** Clear all spawned graphic elements and return to pool. */
|
|
49
|
+
clear(): void;
|
|
50
|
+
resize(_zoom: number): void;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { ModuleInterface } from './ModuleInterface';
|
|
4
|
+
import { MeshData, MeshNormalData } from './utils/Mesh';
|
|
5
|
+
import Highlighter from './utils/fields/Highlighter';
|
|
6
|
+
import LabelManager from './utils/fields/LabelManager';
|
|
7
|
+
import TriangleDictionary from './utils/TriangleDictionary';
|
|
8
|
+
type vec3 = [number, number, number];
|
|
9
|
+
interface FillUniform {
|
|
10
|
+
col1: vec3;
|
|
11
|
+
col2: vec3;
|
|
12
|
+
opacity: number;
|
|
13
|
+
hashed: boolean;
|
|
14
|
+
hashDisp: number;
|
|
15
|
+
hashWidth: number;
|
|
16
|
+
}
|
|
17
|
+
interface OutlineUniform {
|
|
18
|
+
color: vec3;
|
|
19
|
+
width: number;
|
|
20
|
+
}
|
|
21
|
+
/** Collection of data describing colors used for fill. */
|
|
22
|
+
interface FieldStyle {
|
|
23
|
+
fillColor1: vec3;
|
|
24
|
+
fillColor2: vec3;
|
|
25
|
+
fillOpacity: number;
|
|
26
|
+
outlineColor: vec3;
|
|
27
|
+
hashed: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface Field {
|
|
30
|
+
type: string;
|
|
31
|
+
geometry: {
|
|
32
|
+
type: string;
|
|
33
|
+
/**
|
|
34
|
+
* The type of data found within coordinates depends on type.
|
|
35
|
+
* For 'Polygon', coordinates is given as [number, number][][].
|
|
36
|
+
* for 'MultiPolygon', coordinates is given as [number, number][][][].
|
|
37
|
+
*/
|
|
38
|
+
coordinates: [number, number][][] | [number, number][][][];
|
|
39
|
+
};
|
|
40
|
+
properties: {
|
|
41
|
+
discname: string;
|
|
42
|
+
group: number;
|
|
43
|
+
guid?: number;
|
|
44
|
+
hctype: string;
|
|
45
|
+
label: string;
|
|
46
|
+
lat: number;
|
|
47
|
+
long: number;
|
|
48
|
+
polygonId: number;
|
|
49
|
+
status: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface FieldMesh {
|
|
53
|
+
fill: {
|
|
54
|
+
mesh: PIXI.Mesh;
|
|
55
|
+
uniform: FillUniform;
|
|
56
|
+
};
|
|
57
|
+
outline: {
|
|
58
|
+
mesh: PIXI.Mesh;
|
|
59
|
+
uniform: OutlineUniform;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Interface for field config. */
|
|
63
|
+
interface Config {
|
|
64
|
+
/** Initial scale of field hash (Default: 1.0). */
|
|
65
|
+
initialHash?: number;
|
|
66
|
+
/** Minimum scale of field hash (Default: 0.0). */
|
|
67
|
+
minHash?: number;
|
|
68
|
+
/** Maximum scale of field hash (Default: Infinity). */
|
|
69
|
+
maxHash?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Module for displaying fields. */
|
|
72
|
+
export default class FieldModule extends ModuleInterface {
|
|
73
|
+
/** Vertex shader for the fill. */
|
|
74
|
+
static vertexShaderFill: string;
|
|
75
|
+
/** Fragment shader for the fill. */
|
|
76
|
+
static fragmentShaderFill: string;
|
|
77
|
+
/** Vertex shader for the outlines. */
|
|
78
|
+
static vertexShaderOutline: string;
|
|
79
|
+
/** Fragment shader for the outlines. */
|
|
80
|
+
static fragmentShaderOutline: string;
|
|
81
|
+
/** Collection of fields with meshes. */
|
|
82
|
+
fields: FieldMesh[];
|
|
83
|
+
/** Settings for how to render fields. */
|
|
84
|
+
config: Config;
|
|
85
|
+
dict: TriangleDictionary<number>;
|
|
86
|
+
highlighter: Highlighter;
|
|
87
|
+
labelManager: LabelManager;
|
|
88
|
+
/** Index of previously highlighted field */
|
|
89
|
+
prevField: number;
|
|
90
|
+
constructor(config?: Config);
|
|
91
|
+
set(data: Field[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Draw each polygon in a polygon collection.
|
|
94
|
+
* @param polygons
|
|
95
|
+
*/
|
|
96
|
+
drawPolygons(meshData: MeshData, outlineData: MeshNormalData, fieldStyle: FieldStyle, zIndex: number): FieldMesh;
|
|
97
|
+
/**
|
|
98
|
+
* Get the fill color of a field.
|
|
99
|
+
* @param props Properties of field
|
|
100
|
+
* @returns Color used to fill
|
|
101
|
+
*/
|
|
102
|
+
getFieldStyle(guid: number, hctype: string): FieldStyle;
|
|
103
|
+
/**
|
|
104
|
+
* Project a collection of polygons.
|
|
105
|
+
* @param points Points within polygons
|
|
106
|
+
* @returns Projected polygons
|
|
107
|
+
*/
|
|
108
|
+
projectPolygons(points: [number, number][]): Vector2[];
|
|
109
|
+
resize(_zoom: number): void;
|
|
110
|
+
highlight(lat: number, long: number): boolean;
|
|
111
|
+
tryUnselect(): void;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { ModuleInterface } from '../ModuleInterface';
|
|
4
|
+
import { EventHandler } from '../EventHandler';
|
|
5
|
+
import { default as GeoJSONMultiPolygon } from './multipolygon';
|
|
6
|
+
import { default as GeoJSONPolygon } from './polygon';
|
|
7
|
+
import { default as GeoJSONLineString } from './linestring';
|
|
8
|
+
import { default as GeoJSONPoint } from './point';
|
|
9
|
+
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
10
|
+
import { FeatureProps } from './interfaces';
|
|
11
|
+
/** Interface for config. */
|
|
12
|
+
interface Config {
|
|
13
|
+
customEventHandler?: EventHandler;
|
|
14
|
+
onFeatureHover?: (event: MouseEvent, data: any) => void;
|
|
15
|
+
outlineResize?: ResizeConfig;
|
|
16
|
+
labelResize?: LabelResizeConfig;
|
|
17
|
+
}
|
|
18
|
+
/** Module for displaying fields. */
|
|
19
|
+
export default class GeoJSONModule extends ModuleInterface {
|
|
20
|
+
onFeatureHover: (event: MouseEvent, data: any) => void;
|
|
21
|
+
points: GeoJSONPoint;
|
|
22
|
+
linestrings: GeoJSONLineString;
|
|
23
|
+
polygons: GeoJSONPolygon;
|
|
24
|
+
multipolygons: GeoJSONMultiPolygon;
|
|
25
|
+
_eventHandler: EventHandler;
|
|
26
|
+
mapmoving: boolean;
|
|
27
|
+
labelRoot: PIXI.Container;
|
|
28
|
+
config?: Config;
|
|
29
|
+
constructor(config?: Config);
|
|
30
|
+
set(data: GeoJSON.FeatureCollection, props?: (feature: any) => FeatureProps): void;
|
|
31
|
+
/**
|
|
32
|
+
* Check for features at the given coordinates.
|
|
33
|
+
* Will give a list of feature data if any are hit or an empty list if not.
|
|
34
|
+
* @param pos Target position in lat-long
|
|
35
|
+
* @returns List of features at the given position
|
|
36
|
+
*/
|
|
37
|
+
testPosition(pos: Vector2): any;
|
|
38
|
+
onAdd(map: import('leaflet').Map): void;
|
|
39
|
+
onRemove(_map: import('leaflet').Map): void;
|
|
40
|
+
resize(zoom: number): void;
|
|
41
|
+
private handleMouseMove;
|
|
42
|
+
private handleMouseOut;
|
|
43
|
+
private handleMouseClick;
|
|
44
|
+
private handleMouseDown;
|
|
45
|
+
private handleMouseUp;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Defaults {
|
|
2
|
+
static readonly DEFAULT_Z_INDEX = 1000;
|
|
3
|
+
static readonly DEFAULT_LINE_WIDTH = 0.15;
|
|
4
|
+
static readonly INITIAL_ZOOM = 20;
|
|
5
|
+
static readonly DEFAULT_FONT_FAMILY = "Arial";
|
|
6
|
+
static readonly DEFAULT_FONT_SIZE = 64;
|
|
7
|
+
static readonly DEFAULT_FONT_WEIGHT = "600";
|
|
8
|
+
static readonly DEFAULT_LABEL_COLOR = 4539717;
|
|
9
|
+
static readonly DEFAULT_LABEL_ALIGN = "center";
|
|
10
|
+
static readonly INITIAL_HASH = 1;
|
|
11
|
+
static readonly DEFAULT_MIN_HASH = 0;
|
|
12
|
+
static readonly DEFAULT_BASE_SCALE = 0.1;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as GeoJSONMultiPolygon } from './multipolygon';
|
|
2
|
+
export { default as GeoJSONPolygon } from './polygon';
|
|
3
|
+
export { default as GeoJSONLineString } from './linestring';
|
|
4
|
+
export { default as GeoJSONPoint } from './point';
|
|
5
|
+
export { default as GeoJSONModule } from './GeoJSONModule';
|
|
6
|
+
export * from './interfaces';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FeatureStyle {
|
|
2
|
+
lineColor: string;
|
|
3
|
+
lineWidth: number;
|
|
4
|
+
fillColor?: string;
|
|
5
|
+
fillColor2?: string;
|
|
6
|
+
fillOpacity?: number;
|
|
7
|
+
hashed?: boolean;
|
|
8
|
+
labelScale?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface FeatureProps {
|
|
11
|
+
id: number;
|
|
12
|
+
label: string;
|
|
13
|
+
style: FeatureStyle;
|
|
14
|
+
additionalData?: any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
/** Data for label. */
|
|
4
|
+
export type GeoJSONLabelData = {
|
|
5
|
+
position: Vector2;
|
|
6
|
+
mass: number;
|
|
7
|
+
};
|
|
8
|
+
interface Label {
|
|
9
|
+
name: string;
|
|
10
|
+
position: Vector2;
|
|
11
|
+
instance?: PIXI.BitmapText;
|
|
12
|
+
}
|
|
13
|
+
/** Class used to manage field labels. Handles scaling and grouping of labels. */
|
|
14
|
+
export default class GeoJSONLabels {
|
|
15
|
+
/**PIXI container to hold all labels*/
|
|
16
|
+
container: PIXI.Container;
|
|
17
|
+
/** The textstyle used for labels. */
|
|
18
|
+
textStyle: PIXI.TextStyle;
|
|
19
|
+
/** The font used for labels. */
|
|
20
|
+
font: PIXI.BitmapFont;
|
|
21
|
+
/** font name */
|
|
22
|
+
fontName: string;
|
|
23
|
+
/** Scale of labels when size is set to 1. */
|
|
24
|
+
baseScale: number;
|
|
25
|
+
/** Collection of single-polygon fields. */
|
|
26
|
+
labels: Label[];
|
|
27
|
+
/** Visibility */
|
|
28
|
+
visible: boolean;
|
|
29
|
+
/** construct a new label container. */
|
|
30
|
+
constructor(root: PIXI.Container, textStyle: PIXI.TextStyle, baseScale: number, fontName?: string);
|
|
31
|
+
/**
|
|
32
|
+
* Add a new label.
|
|
33
|
+
* @param name label name
|
|
34
|
+
* @param data Data for each label
|
|
35
|
+
*/
|
|
36
|
+
addLabel(name: string, data: GeoJSONLabelData): void;
|
|
37
|
+
/**
|
|
38
|
+
* Draw all labels
|
|
39
|
+
* @param root Target root for labels
|
|
40
|
+
*/
|
|
41
|
+
draw(): void;
|
|
42
|
+
hideLabels(): void;
|
|
43
|
+
showLabels(): void;
|
|
44
|
+
resize(scale: number): void;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
+
import { MeshNormalData } from '../utils/Mesh';
|
|
5
|
+
import LineDictionary from '../utils/LineDictionary';
|
|
6
|
+
import { FeatureProps, FeatureStyle } from '.';
|
|
7
|
+
import { ResizeConfig } from '../ResizeConfigInterface';
|
|
8
|
+
type vec3 = [number, number, number];
|
|
9
|
+
interface OutlineUniform {
|
|
10
|
+
color: vec3;
|
|
11
|
+
width: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FeatureMesh {
|
|
14
|
+
outline: {
|
|
15
|
+
mesh: PIXI.Mesh;
|
|
16
|
+
uniform: OutlineUniform;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Interface for field config. */
|
|
20
|
+
interface Config {
|
|
21
|
+
outlineResize?: ResizeConfig;
|
|
22
|
+
}
|
|
23
|
+
/** Module for displaying fields. */
|
|
24
|
+
export default class GeoJSONLineString {
|
|
25
|
+
/** Vertex shader for the outlines. */
|
|
26
|
+
static vertexShaderOutline: string;
|
|
27
|
+
/** Fragment shader for the outlines. */
|
|
28
|
+
static fragmentShaderOutline: string;
|
|
29
|
+
/** Collection of features with meshes. */
|
|
30
|
+
features: FeatureMesh[];
|
|
31
|
+
/** Settings for how to render fields. */
|
|
32
|
+
config: Config;
|
|
33
|
+
container: PIXI.Container;
|
|
34
|
+
pixiOverlay: pixiOverlayBase;
|
|
35
|
+
dict: LineDictionary<any>;
|
|
36
|
+
textStyle: PIXI.TextStyle;
|
|
37
|
+
currentZoom: number;
|
|
38
|
+
constructor(root: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
39
|
+
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
40
|
+
/**
|
|
41
|
+
* Draw each polygon in a polygon collection.
|
|
42
|
+
* @param polygons
|
|
43
|
+
*/
|
|
44
|
+
drawPolygons(container: PIXI.Container, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
|
|
45
|
+
/**
|
|
46
|
+
* Project a collection of polygons.
|
|
47
|
+
* @param points Points within polygons
|
|
48
|
+
* @returns Projected polygons
|
|
49
|
+
*/
|
|
50
|
+
projectPolygons(points: [number, number][]): Vector2[];
|
|
51
|
+
resize(zoom: number): void;
|
|
52
|
+
testPosition(pos: Vector2): number;
|
|
53
|
+
getOutlineRadius(zoom?: number): number;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
+
import { MeshData, MeshNormalData } from '../utils/Mesh';
|
|
5
|
+
import GeoJSONLabels from './labels';
|
|
6
|
+
import TriangleDictionary from '../utils/TriangleDictionary';
|
|
7
|
+
import { FeatureProps, FeatureStyle } from '.';
|
|
8
|
+
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
9
|
+
type vec3 = [number, number, number];
|
|
10
|
+
interface FillUniform {
|
|
11
|
+
col1: vec3;
|
|
12
|
+
col2: vec3;
|
|
13
|
+
opacity: number;
|
|
14
|
+
hashed: boolean;
|
|
15
|
+
hashDisp: number;
|
|
16
|
+
hashWidth: number;
|
|
17
|
+
}
|
|
18
|
+
interface OutlineUniform {
|
|
19
|
+
color: vec3;
|
|
20
|
+
outlineWidth: number;
|
|
21
|
+
}
|
|
22
|
+
export interface FeatureMesh {
|
|
23
|
+
fill: {
|
|
24
|
+
mesh: PIXI.Mesh;
|
|
25
|
+
uniform: FillUniform;
|
|
26
|
+
};
|
|
27
|
+
outline: {
|
|
28
|
+
mesh: PIXI.Mesh;
|
|
29
|
+
uniform: OutlineUniform;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Interface for feature config. */
|
|
33
|
+
interface Config {
|
|
34
|
+
/** Initial scale of feature hash (Default: 1.0). */
|
|
35
|
+
initialHash?: number;
|
|
36
|
+
/** Minimum scale of feature hash (Default: 0.0). */
|
|
37
|
+
minHash?: number;
|
|
38
|
+
/** Maximum scale of feature hash (Default: Infinity). */
|
|
39
|
+
maxHash?: number;
|
|
40
|
+
/**Label font family, default Arial */
|
|
41
|
+
labelFontFamily?: string;
|
|
42
|
+
/**Label font size, default 64 */
|
|
43
|
+
labelFontSize?: number;
|
|
44
|
+
/**Label font weight, default 600 */
|
|
45
|
+
labelFontWeight?: string;
|
|
46
|
+
/**Label fill color, default 0x454545 */
|
|
47
|
+
labelColor?: string | number;
|
|
48
|
+
/**Label alignment, default Center */
|
|
49
|
+
labelAlign?: string;
|
|
50
|
+
/** Resize configuration for outline. */
|
|
51
|
+
outlineResize?: ResizeConfig;
|
|
52
|
+
/** Resize configuration for labels. */
|
|
53
|
+
labelResize?: LabelResizeConfig;
|
|
54
|
+
}
|
|
55
|
+
/** Container for GeoJSON Polygon features. */
|
|
56
|
+
export default class GeoJSONMultiPolygon {
|
|
57
|
+
/** Vertex shader for the fill. */
|
|
58
|
+
static vertexShaderFill: string;
|
|
59
|
+
/** Fragment shader for the fill. */
|
|
60
|
+
static fragmentShaderFill: string;
|
|
61
|
+
/** Vertex shader for the outlines. */
|
|
62
|
+
static vertexShaderOutline: string;
|
|
63
|
+
/** Fragment shader for the outlines. */
|
|
64
|
+
static fragmentShaderOutline: string;
|
|
65
|
+
/** Collection of features with meshes. */
|
|
66
|
+
features: FeatureMesh[];
|
|
67
|
+
/** Settings for how to render data. */
|
|
68
|
+
config: Config;
|
|
69
|
+
container: PIXI.Container;
|
|
70
|
+
pixiOverlay: pixiOverlayBase;
|
|
71
|
+
dict: TriangleDictionary<any>;
|
|
72
|
+
textStyle: PIXI.TextStyle;
|
|
73
|
+
labels: GeoJSONLabels;
|
|
74
|
+
currentZoom: number;
|
|
75
|
+
constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
76
|
+
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
77
|
+
/**
|
|
78
|
+
* Draw each polygon in a polygon collection.
|
|
79
|
+
* @param polygons
|
|
80
|
+
*/
|
|
81
|
+
drawPolygons(container: PIXI.Container, meshData: MeshData, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
|
|
82
|
+
drawLabels(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Project a collection of polygons.
|
|
85
|
+
* @param points Points within polygons
|
|
86
|
+
* @returns Projected polygons
|
|
87
|
+
*/
|
|
88
|
+
projectPolygons(points: [number, number][]): Vector2[];
|
|
89
|
+
resize(zoom: number): void;
|
|
90
|
+
testPosition(pos: Vector2): number;
|
|
91
|
+
getOutlineRadius(zoom?: number): number;
|
|
92
|
+
getLabelSize(zoom?: number): number;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
+
import PointDictionary from '../utils/PointDictionary';
|
|
5
|
+
import { FeatureProps } from '.';
|
|
6
|
+
/** Module for displaying fields. */
|
|
7
|
+
export default class GeoJSONPoint {
|
|
8
|
+
/** Graphic elements currently existing in world space. */
|
|
9
|
+
spawned: PIXI.Graphics[];
|
|
10
|
+
/** Pool of initialized graphic elements. */
|
|
11
|
+
pool: PIXI.Graphics[];
|
|
12
|
+
container: PIXI.Container;
|
|
13
|
+
pixiOverlay: pixiOverlayBase;
|
|
14
|
+
dict: PointDictionary<any>;
|
|
15
|
+
textStyle: PIXI.TextStyle;
|
|
16
|
+
constructor(root: PIXI.Container, pixiOverlay: pixiOverlayBase);
|
|
17
|
+
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
18
|
+
/**
|
|
19
|
+
* Project a point coordinate.
|
|
20
|
+
* @param point x,y pair
|
|
21
|
+
* @returns Projected point
|
|
22
|
+
*/
|
|
23
|
+
projectPoint(point: [number, number]): Vector2;
|
|
24
|
+
resize(_zoom: number): void;
|
|
25
|
+
testPosition(pos: Vector2): any;
|
|
26
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
+
import { MeshData, MeshNormalData } from '../utils/Mesh';
|
|
5
|
+
import GeoJSONLabels from './labels';
|
|
6
|
+
import TriangleDictionary from '../utils/TriangleDictionary';
|
|
7
|
+
import { FeatureProps, FeatureStyle } from '.';
|
|
8
|
+
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
9
|
+
type vec3 = [number, number, number];
|
|
10
|
+
interface FillUniform {
|
|
11
|
+
col1: vec3;
|
|
12
|
+
col2: vec3;
|
|
13
|
+
opacity: number;
|
|
14
|
+
hashed: boolean;
|
|
15
|
+
hashDisp: number;
|
|
16
|
+
hashWidth: number;
|
|
17
|
+
}
|
|
18
|
+
interface OutlineUniform {
|
|
19
|
+
color: vec3;
|
|
20
|
+
outlineWidth: number;
|
|
21
|
+
}
|
|
22
|
+
export interface FeatureMesh {
|
|
23
|
+
fill: {
|
|
24
|
+
mesh: PIXI.Mesh;
|
|
25
|
+
uniform: FillUniform;
|
|
26
|
+
};
|
|
27
|
+
outline: {
|
|
28
|
+
mesh: PIXI.Mesh;
|
|
29
|
+
uniform: OutlineUniform;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Interface for feature config. */
|
|
33
|
+
interface Config {
|
|
34
|
+
/** Initial scale of feature hash (Default: 1.0). */
|
|
35
|
+
initialHash?: number;
|
|
36
|
+
/** Minimum scale of feature hash (Default: 0.0). */
|
|
37
|
+
minHash?: number;
|
|
38
|
+
/** Maximum scale of feature hash (Default: Infinity). */
|
|
39
|
+
maxHash?: number;
|
|
40
|
+
/**Label font family, default Arial */
|
|
41
|
+
labelFontFamily?: string;
|
|
42
|
+
/**Label font size, default 64 */
|
|
43
|
+
labelFontSize?: number;
|
|
44
|
+
/**Label font weight, default 600 */
|
|
45
|
+
labelFontWeight?: string;
|
|
46
|
+
/**Label fill color, default 0x454545 */
|
|
47
|
+
labelColor?: string | number;
|
|
48
|
+
/**Label alignment, default Center */
|
|
49
|
+
labelAlign?: string;
|
|
50
|
+
/** Resize configuration of outline. */
|
|
51
|
+
outlineResize?: ResizeConfig;
|
|
52
|
+
/** Resize configuration for labels. */
|
|
53
|
+
labelResize?: LabelResizeConfig;
|
|
54
|
+
}
|
|
55
|
+
/** Container for GeoJSON Polygon features. */
|
|
56
|
+
export default class GeoJSONPolygon {
|
|
57
|
+
/** Vertex shader for the fill. */
|
|
58
|
+
static vertexShaderFill: string;
|
|
59
|
+
/** Fragment shader for the fill. */
|
|
60
|
+
static fragmentShaderFill: string;
|
|
61
|
+
/** Vertex shader for the outlines. */
|
|
62
|
+
static vertexShaderOutline: string;
|
|
63
|
+
/** Fragment shader for the outlines. */
|
|
64
|
+
static fragmentShaderOutline: string;
|
|
65
|
+
/** Collection of features with meshes. */
|
|
66
|
+
features: FeatureMesh[];
|
|
67
|
+
/** Settings for how to render data. */
|
|
68
|
+
config: Config;
|
|
69
|
+
container: PIXI.Container;
|
|
70
|
+
pixiOverlay: pixiOverlayBase;
|
|
71
|
+
dict: TriangleDictionary<any>;
|
|
72
|
+
textStyle: PIXI.TextStyle;
|
|
73
|
+
labels: GeoJSONLabels;
|
|
74
|
+
currentZoom: number;
|
|
75
|
+
outlineThickness: number;
|
|
76
|
+
zIndex: number;
|
|
77
|
+
constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
78
|
+
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
79
|
+
/**
|
|
80
|
+
* Draw each polygon in a polygon collection.
|
|
81
|
+
* @param polygons
|
|
82
|
+
*/
|
|
83
|
+
drawPolygons(container: PIXI.Container, meshData: MeshData, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
|
|
84
|
+
drawLabels(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Project a collection of polygons.
|
|
87
|
+
* @param points Points within polygons
|
|
88
|
+
* @returns Projected polygons
|
|
89
|
+
*/
|
|
90
|
+
projectPolygons(points: [number, number][]): Vector2[];
|
|
91
|
+
resize(zoom: number): void;
|
|
92
|
+
testPosition(pos: Vector2): any;
|
|
93
|
+
getOutlineRadius(zoom?: number): number;
|
|
94
|
+
getLabelSize(zoom?: number): number;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared shaders for polygon and multipolygon
|
|
3
|
+
*/
|
|
4
|
+
export declare const GeoJSONVertexShaderFill = "\n attribute vec2 inputVerts;\n\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n\n varying vec2 verts;\n\n void main() {\n verts = inputVerts;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(inputVerts, 1.0)).xy, 0.0, 1.0);\n }\n ";
|
|
5
|
+
export declare const GeoJSONFragmentShaderFill = "\n precision mediump float;\n\n varying vec2 verts;\n\n uniform vec3 col1;\n uniform vec3 col2;\n uniform float opacity;\n\n uniform bool hashed;\n uniform float hashDisp;\n uniform float hashWidth;\n\n void main() {\n if(hashed && mod(verts.y + hashDisp, hashWidth * 2.0) > hashWidth) {\n gl_FragColor = vec4(col2 / 255., 1.0) * opacity;\n }\n else {\n gl_FragColor = vec4(col1 / 255., 1.0) * opacity;\n }\n }\n ";
|
|
6
|
+
/**
|
|
7
|
+
* Shared shaders for polygon, multipolygon and linestring
|
|
8
|
+
*/
|
|
9
|
+
export declare const GeoJSONVertexShaderOutline = "\n attribute vec2 inputVerts;\n attribute vec2 inputNormals;\n\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n\n uniform float outlineWidth;\n\n void main() {\n vec2 pos = inputVerts + inputNormals * outlineWidth;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(pos, 1.0)).xy, 0.0, 1.0);\n }\n ";
|
|
10
|
+
export declare const GeoJSONFragmentShaderOutline = "\n precision mediump float;\n\n uniform vec3 color;\n\n void main() {\n gl_FragColor = vec4(color / 255., 1.0);\n }\n ";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { pixiOverlayBase } from './pixiOverlayInterfaces';
|
|
2
|
+
import * as PIXI from 'pixi.js';
|
|
3
|
+
/** Class with common functions shared by all layers. */
|
|
4
|
+
export declare abstract class ModuleInterface {
|
|
5
|
+
/** Function for pixi overlay. */
|
|
6
|
+
pixiOverlay: pixiOverlayBase;
|
|
7
|
+
/** Root container for layer. */
|
|
8
|
+
root: PIXI.Container;
|
|
9
|
+
/** True if layer is currently visible. */
|
|
10
|
+
visibility: boolean;
|
|
11
|
+
/** Common constructor for all map layers. */
|
|
12
|
+
constructor();
|
|
13
|
+
destroy(): void;
|
|
14
|
+
/** Toggle the visibility of the root PIXI container. */
|
|
15
|
+
toggle(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Set visibility of the root PIXI container to a given value.
|
|
18
|
+
*
|
|
19
|
+
* @param visible Should layer be visible?
|
|
20
|
+
* @returns True if new visibility was set
|
|
21
|
+
*/
|
|
22
|
+
setVisibility(visible: boolean): boolean;
|
|
23
|
+
onAdd(_map: L.Map): void;
|
|
24
|
+
onRemove(_map: L.Map): void;
|
|
25
|
+
resize(_zoom: number): void;
|
|
26
|
+
}
|