@2gis/mapgl-gltf
Advanced tools
Comparing version 1.2.1 to 1.3.0
import { GltfPlugin } from './plugin'; | ||
export { GltfPlugin }; | ||
export * from './types'; |
@@ -0,1 +1,2 @@ | ||
import * as THREE from 'three'; | ||
import type { Map as MapGL } from '@2gis/mapgl/types'; | ||
@@ -7,2 +8,3 @@ import { Evented } from './external/evented'; | ||
export declare class GltfPlugin extends Evented<GltfPluginEventTable> { | ||
private isThreeJsInitialized; | ||
private renderer; | ||
@@ -23,2 +25,3 @@ private camera; | ||
private modelOptions; | ||
private linkedIds; | ||
/** | ||
@@ -49,2 +52,7 @@ * The main class of the plugin | ||
constructor(map: MapGL, pluginOptions?: PluginOptions); | ||
private onStyleLoad; | ||
private addLinkedIds; | ||
private removeLinkedIds; | ||
private getLinkedIds; | ||
setOptions(pluginOptions: Pick<Required<PluginOptions>, 'groundCoveringColor'>): void; | ||
/** | ||
@@ -66,6 +74,18 @@ * Add the list of models to the map | ||
* @param modelOptions An array of models' options | ||
* @param ids An array of idenifiers of the models that must be added to the scene | ||
* @param ids An array of identifiers of the models that must be added to the scene | ||
*/ | ||
addModelsPartially(modelOptions: ModelOptions[], ids: Id[]): Promise<void>; | ||
/** | ||
* Remove models from the map and cache or from the map only | ||
* | ||
* @param id An array of models identifiers to delete | ||
* @param preserveCache Flag to keep the model in the cache | ||
*/ | ||
removeModels(ids: Id[], preserveCache?: boolean): Promise<void>; | ||
/** | ||
* @internal | ||
* @hidden | ||
*/ | ||
getModelRendererInfo: () => THREE.WebGLInfo; | ||
/** | ||
* Add model to the map | ||
@@ -103,2 +123,8 @@ * | ||
addRealtyScene(scene: BuildingOptions[], state?: BuildingState): Promise<void>; | ||
/** | ||
* Remove interactive realty scene from the map | ||
* | ||
* @param preserveCache Flag to keep the model in the cache | ||
*/ | ||
removeRealtyScene(preserveCache?: boolean): void; | ||
private invalidateViewport; | ||
@@ -108,10 +134,5 @@ private initEventHandlers; | ||
private initThree; | ||
private addThreeJsLayer; | ||
private addLayers; | ||
private startModelLoading; | ||
private addModelFromCache; | ||
/** | ||
* Delete from memory all allocated objects by Object3D | ||
* https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects | ||
*/ | ||
private disposeObject; | ||
} |
@@ -7,4 +7,5 @@ import type { Map as MapGL } from '@2gis/mapgl/types'; | ||
private poiSources; | ||
private activePoiGroupOptions?; | ||
constructor(map: MapGL, poiConfig: PluginOptions['poiConfig']); | ||
addIcons(): void; | ||
onMapStyleUpdate(): void; | ||
add(groupOptions: PoiGroupOptions, state?: BuildingState): Promise<void>; | ||
@@ -11,0 +12,0 @@ remove(origId: Id): void; |
@@ -23,5 +23,11 @@ import * as THREE from 'three'; | ||
private scene; | ||
private groundCoveringSource; | ||
private undergroundFloors; | ||
constructor(plugin: GltfPlugin, map: MapGL, eventSource: EventSource, models: Map<string, THREE.Object3D>, options: typeof defaultOptions); | ||
addRealtyScene(scene: BuildingOptions[], originalState?: BuildingState): Promise<void>; | ||
resetGroundCoveringColor(): void; | ||
isUndergroundFloorShown(): boolean; | ||
destroy(preserveCache?: boolean): void; | ||
private bindRealtySceneEvents; | ||
private unbindRealtySceneEvents; | ||
private createControlOptions; | ||
@@ -31,2 +37,5 @@ private setMapOptions; | ||
private getPopupOptions; | ||
private onSceneMouseOver; | ||
private onSceneMouseOut; | ||
private onSceneClick; | ||
private poiClickHandler; | ||
@@ -42,2 +51,4 @@ private floorChangeHandler; | ||
private getPopupHtml; | ||
private switchOffGroundCovering; | ||
private switchOnGroundCovering; | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { Id, ModelOptions, PoiOptions } from '../types/plugin'; | ||
import type { Id, ModelOptions, PoiOptions } from './plugin'; | ||
export type PoiGeoJsonProperties = PoiOptions & { | ||
@@ -3,0 +3,0 @@ /** |
@@ -5,3 +5,3 @@ export type Id = string | number; | ||
/** | ||
* Color represantation can be rgb(), hsl(), or hex value | ||
* Color representation can be rgb(), hsl(), or hex value | ||
*/ | ||
@@ -108,2 +108,6 @@ export type ColorRepresentation = ColorModelString | HexColorString | number; | ||
hoverHighlight?: HightlightOptions; | ||
/** | ||
* Color for the ground covering when an underground floor's plan is shown. | ||
*/ | ||
groundCoveringColor?: string; | ||
} | ||
@@ -110,0 +114,0 @@ /** |
@@ -51,2 +51,8 @@ import type { Id, PoiGroupOptions, ModelOptions } from './plugin'; | ||
mapOptions?: MapOptions; | ||
/** | ||
* Specifies whether a floor's plan is underground. | ||
* If value is `true` the map will be covered with a ground geometry | ||
* so that only the floor's plan will stay visible. | ||
*/ | ||
isUnderground?: boolean; | ||
} | ||
@@ -53,0 +59,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import * as THREE from 'three'; | ||
export declare function clamp(value: number, min: number, max: number): number; | ||
@@ -6,1 +7,13 @@ export declare function degToRad(degrees: number): number; | ||
export declare function createCompoundId(modelId: string | number, floorId?: string | number): string; | ||
export type RequiredExcept<T, K extends keyof T> = T & Required<Omit<T, K>>; | ||
type RequiredOptional<T extends object> = Exclude<{ | ||
[K in keyof T]: T extends Record<K, T[K]> ? never : K; | ||
}[keyof T], undefined>; | ||
export type DefaultOptionalOptions<T extends object> = Required<Pick<T, RequiredOptional<T>>>; | ||
export declare function applyOptionalDefaults<T extends object>(params: T, defaults: DefaultOptionalOptions<T>): Required<T>; | ||
/** | ||
* Delete from memory all allocated objects by Object3D | ||
* https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects | ||
*/ | ||
export declare function disposeObject(inputObj: THREE.Object3D): void; | ||
export {}; |
{ | ||
"name": "@2gis/mapgl-gltf", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Plugin for the rendering glTF models with MapGL", | ||
@@ -12,3 +12,4 @@ "main": "dist/bundle.js", | ||
"files": [ | ||
"dist/*" | ||
"dist/libs", | ||
"dist/types" | ||
], | ||
@@ -26,2 +27,3 @@ "scripts": { | ||
"test:screenshots": "webpack --env type=test && TEST_SUITE=screenshots jest --colors", | ||
"test:screenshots:watch": "webpack --env type=test && TEST_SUITE=screenshots jest --colors --watchAll", | ||
"test:screenshots:update": "webpack --env type=test && TEST_SUITE=screenshots jest -u", | ||
@@ -28,0 +30,0 @@ "test:typings": "tsc -p tsconfig.typings.validation.json", |
@@ -47,7 +47,13 @@ # mapgl-gltf | ||
1. Add a release description | ||
1. Click the «Publish release» button | ||
1. Click the «Publish release» button | ||
1. Go to https://github.com/2gis/mapgl-gltf/actions and wait for completing the release workflow | ||
## Testing | ||
If you write screenshot tests, you will need run `npm run docker:test` after coding. | ||
This command runs your tests on the docker image that is used in pipeline build. | ||
This guarantees the authenticity of the screenshots used. | ||
## Documentation | ||
You can find the more information in the official [documentation](https://docs.2gis.ru/ru/mapgl/examples/gltf-plugin). |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
100
59
3942123
32
888
21