New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@2gis/mapgl-gltf

Package Overview
Dependencies
Maintainers
9
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@2gis/mapgl-gltf - npm Package Compare versions

Comparing version 1.3.1 to 2.0.0

dist/types/labelGroups.d.ts

5

dist/types/constants.d.ts
import type { GeoJsonSourceOptions } from '@2gis/mapgl/types';
export declare const PLUGIN_PREFIX = "__mapglPlugins_mapgl-gltf2";
export declare const GROUND_COVERING_SOURCE_DATA: GeoJsonSourceOptions['data'];
export declare const GROUND_COVERING_SOURCE_PURPOSE = "__mapglPlugins_mapgl-gltf";
export declare const GROUND_COVERING_SOURCE_PURPOSE: string;
export declare const GROUND_COVERING_LAYER_ID: string;
export declare const GROUND_COVERING_LAYER: {

@@ -12,1 +14,2 @@ id: string;

};
export declare const pluginEvents: readonly ["click", "mousemove", "mouseover", "mouseout"];

6

dist/types/control/index.d.ts
import type { Map as MapGL, ControlOptions } from '@2gis/mapgl/types';
import type { Id } from '../types/plugin';
import type { ControlShowOptions } from './types';
import { Control } from './control';
/**
* A control for change floor layer level on the plugin.
* A control for change floor layer level in the plugin.
* It appears on the map only if you set the `floorControl` option within @type PluginOptions to `true`.

@@ -12,3 +11,2 @@ * @hidden

export declare class GltfFloorControl extends Control {
private _map;
private _root;

@@ -25,3 +23,3 @@ private _content;

private _controlHandler;
switchCurrentFloorLevel(modelId: Id, floorId?: Id): void;
private _switchCurrentFloorLevel;
}

@@ -1,7 +0,6 @@

import { Id } from '../types/plugin';
/**
* Floor level data
* Floor level data.
*/
export interface FloorLevel {
floorId?: Id;
modelId: string;
text: string;

@@ -11,21 +10,20 @@ icon?: 'parking' | 'building' | string;

/**
* Options for the method show
* Options for the show method.
*/
export interface ControlShowOptions {
modelId: Id;
floorId?: Id;
buildingModelId: string;
activeModelId: string;
floorLevels?: FloorLevel[];
}
/**
* Event that emitted on button presses of the control
* Event that emitted on button presses of the control.
*/
export interface FloorChangeEvent {
modelId: Id;
floorId?: Id;
modelId: string;
}
export interface ControlEventTable {
/**
* Emitted when floor's plan was changed
* Emitted when floor's plan was changed.
*/
floorChange: FloorChangeEvent;
floorchange: FloorChangeEvent;
}
/**
* Event emitter
* Event emitter.
*/

@@ -11,25 +11,29 @@ export declare class Evented<M> {

/**
* Registers event listener
* @param type Event type
* @param listener Event handler
* Registers event listener.
*
* @param type Event type.
* @param listener Event handler.
*/
on<K extends keyof M>(type: K, listener: (ev: M[K]) => void): this;
/**
* Registers event listener which will be called once
* @param type Event type
* @param listener Event handler
* Registers event listener which will be called once.
*
* @param type Event type.
* @param listener Event handler.
*/
once<K extends keyof M>(type: K, listener: (ev: M[K]) => void): this;
/**
* Removes event listener registered with `on`
* @param type Event type
* @param listener Event handler
* Removes event listener registered with `on`.
*
* @param type Event type.
* @param listener Event handler.
*/
off<K extends keyof M>(type: K, listener: (ev: M[K]) => void): this;
/**
* Calls all event listeners with event type `type`
* @param type Event type
* @param data Data transferred to events
* Calls all event listeners with event type `type`.
*
* @param type Event type.
* @param data Data transferred to events.
*/
emit<K extends keyof M>(type: K, data?: M[K]): this;
}

@@ -1,34 +0,22 @@

import * as THREE from 'three';
import type { Map as MapGL } from '@2gis/mapgl/types';
import { Evented } from './external/evented';
import type { Id, PluginOptions, ModelOptions, BuildingState, PoiGroupOptions } from './types/plugin';
import type { BuildingOptions } from './types/realtyScene';
import type { GltfPluginEventTable } from './types/events';
import type { PluginOptions, ModelOptions, BuildingState, LabelGroupOptions } from './types/plugin';
import { Evented } from './external/evented';
import { ModelStatus } from './types/plugin';
export declare class GltfPlugin extends Evented<GltfPluginEventTable> {
private isThreeJsInitialized;
private renderer;
private camera;
private scene;
private tmpMatrix;
private viewport;
private map;
private options;
private loader;
private poiGroups;
private eventSource?;
private onPluginInit;
private waitForPluginInit;
private models;
private labelGroups;
private realtyScene?;
private modelOptions;
private linkedIds;
private isDestroyed;
/**
* The main class of the plugin
* The main class of the plugin.
*
* Example:
* ```js
* const plugin = new GltfPlugin (map, {
* const plugin = new GltfPlugin(map, {
* modelsLoadStrategy: 'waitAll',
* dracoScriptsUrl: 'libs/draco/',
* ambientLight: { color: 'white', intencity: 2.5 },
* modelsBaseUrl: 'https://url_to_models',
* });

@@ -41,93 +29,111 @@ *

* modelUrl: 'models/cube_draco.glb',
* rotateX: 90,
* scale: 1000,
* rotateZ: 90,
* scale: 2,
* },
* ]);
* ```
* @param map The map instance
* @param pluginOptions GltfPlugin initialization options
* @param map The map instance.
* @param pluginOptions GltfPlugin initialization options.
*/
constructor(map: MapGL, pluginOptions?: PluginOptions);
private onStyleLoad;
private addLinkedIds;
private removeLinkedIds;
private getLinkedIds;
/**
* Destroys the plugin.
*/
destroy(): void;
/**
* Sets options of the plugin.
*
* @param pluginOptions Plugin options that are available for setting.
*/
setOptions(pluginOptions: Pick<Required<PluginOptions>, 'groundCoveringColor'>): void;
/**
* Add the list of models to the map
* Use this method if you want to add
* a list of models to the map at the same time
* Adds a model to the map.
*
* @param modelOptions An array of models' options
* @param modelToLoad Options of a model.
* @param hideOnLoad Set to `true` if a model should be hidden on loading completion.
*/
addModels(modelOptions: ModelOptions[]): Promise<void>;
addModel(modelToLoad: ModelOptions, hideOnLoad?: boolean): Promise<void>;
/**
* Add the list of models to the map partially
* Use this method if you want to add to the map
* some models from the list of models and want
* to preserve remaining ones in the cache without
* adding them to the map
* Adds a list of models to the map.
*
* @param modelOptions An array of models' options
* @param ids An array of identifiers of the models that must be added to the scene
* @param modelsToLoad An array of options of models.
* @param modelIdsToShow An array of ids of models that should be shown. If it's not provided
* all models will be shown.
*/
addModelsPartially(modelOptions: ModelOptions[], ids: Id[]): Promise<void>;
addModels(modelsToLoad: ModelOptions[], modelIdsToShow?: string[]): Promise<void>;
/**
* Remove models from the map and cache or from the map only
* Returns a current status of a model.
* There can be no model or it can be loading or loaded.
*
* @param id An array of models identifiers to delete
* @param preserveCache Flag to keep the model in the cache
* @param id A model id.
*/
removeModels(ids: Id[], preserveCache?: boolean): Promise<void>;
getModelStatus(id: string): ModelStatus;
/**
* @internal
* @hidden
* Removes a model from the map.
*
* @param id A model id.
*/
getModelRendererInfo: () => THREE.WebGLInfo;
removeModel(id: string): void;
/**
* Add model to the map
* Removes models from the map.
*
* @param modelOptions The models' options
* @param id Model ids.
*/
addModel(modelOptions: ModelOptions): Promise<void>;
removeModels(ids: string[]): void;
/**
* Remove the model from the map and cache or from the map only
* Shows a model on the map.
*
* @param id Identifier of the model to delete
* @param preserveCache Flag to keep the model in the cache
* @param id A model id.
*/
removeModel(id: Id, preserveCache?: boolean): void;
showModel(id: string): void;
/**
* Add the group of poi to the map
* Shows models on the map.
*
* @param options Options of the group of poi to add to the map
* @param state State of the active building to connect with added the group of poi
* @param id Model ids.
*/
addPoiGroup(options: PoiGroupOptions, state?: BuildingState): Promise<void>;
showModels(ids: string[]): void;
/**
* Remove the group of poi from the map
* Hides a model on the map.
*
* @param id Identifier of the group of poi to remove
* @param id A model id.
*/
removePoiGroup(id: Id): void;
hideModel(id: string): void;
/**
* Add the interactive realty scene to the map
* Hides models on the map.
*
* @param scene The options of the scene to add to the map
* @param state State of the active building to connect with added scene
* @param id Model ids.
*/
addRealtyScene(scene: BuildingOptions[], state?: BuildingState): Promise<void>;
hideModels(ids: string[]): void;
/**
* Remove interactive realty scene from the map
* Adds a group of labels to the map.
*
* @param preserveCache Flag to keep the model in the cache
* @param options Options of the group of labels.
* @param state A state of active building and floor a group of labels is associated with.
*/
removeRealtyScene(preserveCache?: boolean): void;
private invalidateViewport;
private initEventHandlers;
private render;
private initThree;
private addLayers;
private startModelLoading;
private addModelFromCache;
addLabelGroup(options: LabelGroupOptions, state?: BuildingState): void;
/**
* Removes a group of labels from the map.
*
* @param id A label group id.
*/
removeLabelGroup(id: string): void;
/**
* Adds an interactive realty scene to the map.
*
* @param scene Options of the scene to add to the map.
* @param state A state of building and floor that should be active on realty scene initialization.
*/
addRealtyScene(scene: BuildingOptions[], state?: BuildingState): Promise<void>;
/**
* Shows a hidden realty scene on the map.
*/
showRealtyScene(): void;
/**
* Hides a shown realty scene on the map.
*/
hideRealtyScene(): void;
/**
* Removes an interactive realty scene from the map.
*/
removeRealtyScene(): void;
}

@@ -1,7 +0,4 @@

import * as THREE from 'three';
import type { Map as MapGL } from '@2gis/mapgl/types';
import { EventSource } from '../eventSource';
import { GltfPlugin } from '../plugin';
import { defaultOptions } from '../defaultOptions';
import type { Id, BuildingState } from '../types/plugin';
import { type BuildingState, type PluginOptions } from '../types/plugin';
import type { BuildingOptions } from '../types/realtyScene';

@@ -11,42 +8,27 @@ export declare class RealtyScene {

private map;
private eventSource;
private models;
private options;
private activeBuilding?;
private activeModelId?;
private control?;
private activePoiGroupIds;
private container;
private buildingFacadeIds;
private prevHoveredModelId;
private popup;
private scene;
private buildings;
private floors;
private undergroundFloors;
private state;
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>;
private control;
private popup?;
constructor(plugin: GltfPlugin, map: MapGL, options: Required<PluginOptions>);
private getBuildingModelId;
private setState;
init(scene: BuildingOptions[], state?: BuildingState): Promise<void>;
resetGroundCoveringColor(): void;
isUndergroundFloorShown(): boolean;
destroy(preserveCache?: boolean): void;
private bindRealtySceneEvents;
private unbindRealtySceneEvents;
private createControlOptions;
show(): void;
hide(): void;
destroy(): void;
private setMapOptions;
private isFacadeBuilding;
private getPopupOptions;
private onStyleLoad;
private onSceneMouseOut;
private onSceneMouseOver;
private onSceneMouseOut;
private onSceneClick;
private poiClickHandler;
private floorChangeHandler;
private buildingClickHandler;
private addFloorPoi;
private clearPoiGroups;
private makeUniqueFloorIds;
toggleHighlightModel(modelId: Id): void;
private showPopup;
private hidePopup;
private getPopupHtml;
private switchOffGroundCovering;
private switchOnGroundCovering;
}

@@ -1,66 +0,48 @@

import type { Id, ModelOptions, PoiOptions } from './plugin';
export type PoiGeoJsonProperties = PoiOptions & {
/**
* Identifier of the building's model
*/
modelId?: Id;
/**
* Identifier of the floor's model
*/
floorId?: Id;
/**
* Type of the poi
*/
type?: string;
};
import type { ModelOptions, LabelOptions } from './plugin';
export interface ModelTarget {
/**
* Type of the target
* The type of a target.
*/
type: 'model';
/**
* The targeted model
* A targeted model.
*/
data: ModelOptions;
/**
* Identifier of the building's model
* An identifier of the building's or floor's model.
*/
modelId?: Id;
/**
* Identifier of the current floor
*/
floorId?: Id;
modelId: string;
}
export interface PoiTarget {
export interface LabelTarget {
/**
* Type of the target
* The type of a target.
*/
type: 'poi';
type: 'label';
/**
* The targeted poi
* A targeted label.
*/
data: PoiGeoJsonProperties;
data: LabelOptions;
/**
* Identifier of the building's model
* An identifier of the building's model.
*/
modelId?: Id;
buildingId?: string;
/**
* Identifier of the current floor
* An identifier of the current floor.
*/
floorId?: Id;
floorId?: string;
}
/**
* The event type for pointer-related plugin events
* Event type for pointer-related plugin events.
*/
interface GltfPluginPointerEvent {
/**
* The original DOM event
* An original DOM event.
*/
originalEvent: MouseEvent | TouchEvent;
/**
* Geographical coordinates of the event
* Geographical coordinates of an event.
*/
lngLat: number[];
/**
* Screen coordinates of the event
* Screen coordinates of an event.
*/

@@ -70,16 +52,16 @@ point: number[];

/**
* The event type for pointer-related plugin events emitted by the poi
* Event type for pointer-related plugin events emitted by a label.
*/
export interface GltfPluginPoiEvent extends GltfPluginPointerEvent {
export interface GltfPluginLabelEvent extends GltfPluginPointerEvent {
/**
* Target of the poi event
* A target of a label event.
*/
target: PoiTarget;
target: LabelTarget;
}
/**
* The event type for pointer-related plugin events emitted by the model
* Event type for pointer-related plugin events emitted by a model.
*/
export interface GltfPluginModelEvent extends GltfPluginPointerEvent {
/**
* Target of the model event
* A target of a model event.
*/

@@ -89,22 +71,22 @@ target: ModelTarget;

/**
* The list of events that can be emitted by the glTF plugin instance
* List of events that can be emitted by the GLTF plugin instance.
*/
export interface GltfPluginEventTable {
/**
* Emitted when model or poi are clicked
* Emitted when a model or a label is clicked.
*/
click: GltfPluginPoiEvent | GltfPluginModelEvent;
click: GltfPluginLabelEvent | GltfPluginModelEvent;
/**
* Emitted when the user moves the pointer over the model or the poi
* Emitted when user moves pointer over a model or a label.
*/
mousemove: GltfPluginPoiEvent | GltfPluginModelEvent;
mousemove: GltfPluginLabelEvent | GltfPluginModelEvent;
/**
* Emitted when the user hovers over the model or the poi
* Emitted when user hovers over a model or a label.
*/
mouseover: GltfPluginPoiEvent | GltfPluginModelEvent;
mouseover: GltfPluginLabelEvent | GltfPluginModelEvent;
/**
* Emitted when the user moves the mouse away from the model or the poi
* Emitted when user moves mouse away from a model or a label.
*/
mouseout: GltfPluginPoiEvent | GltfPluginModelEvent;
mouseout: GltfPluginLabelEvent | GltfPluginModelEvent;
}
export {};

@@ -1,37 +0,3 @@

export type Id = string | number;
export type ColorModelString = `${'rgb' | 'hsl'}(${string})`;
export type HexColorString = `#${string}`;
import type { LabelImage } from '@2gis/mapgl/types';
/**
* Color representation can be rgb(), hsl(), or hex value
*/
export type ColorRepresentation = ColorModelString | HexColorString | number;
/**
* Options for an ambient light
*/
export interface AmbientLightOptions {
/**
* Color of the ambient light.
* @default '#ffffff'
*/
color: ColorRepresentation;
/**
* Numeric value of the light's strength/intensity.
* @default 3
*/
intencity: number;
}
/**
* Configuration of the poi
*/
export interface PoiConfigGranular {
/**
* Size of the font
*/
fontSize?: number;
/**
* Color of the font
*/
fontColor?: string;
}
/**
* Possible positions of the control.

@@ -45,3 +11,3 @@ */

/**
* Position of the control.
* A position of the control.
*/

@@ -51,59 +17,52 @@ position: ControlPosition;

/**
* Options for the highlight color of hovered models
* Options for the hover state of models.
*/
export interface HightlightOptions {
export interface HoverOptions {
/**
* Color of the hover
* @default '#ffffff'
* A hover color.
*/
color?: ColorRepresentation;
color: string;
}
export interface LabelGroupDefaults {
/**
* Intensity of the color on the hover in the range from 0 to 1
* @default 0.0
* A font size of labels in a group.
*/
intencity: number;
fontSize?: number;
/**
* A font color of labels in a group.
*/
fontColor?: string;
/**
* Image settings for a text background of labels in a group.
*/
image?: LabelImage;
}
/**
* Options for the plugin
* Options for the plugin.
*/
export interface PluginOptions {
/**
* Settings for an ambient light
* A URL which is used for resolving of a model's relative path.
*/
ambientLight?: AmbientLightOptions;
/**
* The url where scripts for the draco decoder are located
*/
dracoScriptsUrl?: string;
/**
* The url which is used for resolving of a model's relative url
*/
modelsBaseUrl?: string;
/**
* Strategies for the loading of models:
* - dontWaitAll - show models as soon as possible
* - waitAll - show models only when all models are ready for the rendering
* Strategies for loading and rendering of models:
* - dontWaitAll - show every model on its loading completion. In case of a realty scene it allows to download less data and
* show every model in the scene as soon as possible, but there will be a delay between switching floor plans if they are not loaded.
* - waitAll - show models only when all models are loaded. In case of a realty scene it leads to an increase in amount of
* loaded data and time of rendering scene, but it allows to avoid a delay between switching floor plans.
*/
modelsLoadStrategy?: 'dontWaitAll' | 'waitAll';
/**
* Configuration of poi
* Defaults for any label group used when such options aren't specified in label group options directly.
*/
poiConfig?: {
/**
* Configuration the primary poi
*/
primary?: PoiConfigGranular;
/**
* Configuration the secondary poi
*/
secondary?: PoiConfigGranular;
};
labelGroupDefaults?: LabelGroupDefaults;
/**
* Settings for floors' control
* Settings for floors' control.
*/
floorsControl?: ControlOptions;
/**
* Settings of the highlighted models
* Settings of hovered models.
*/
hoverHighlight?: HightlightOptions;
hoverOptions?: HoverOptions;
/**

@@ -113,70 +72,76 @@ * Color for the ground covering when an underground floor's plan is shown.

groundCoveringColor?: string;
/**
* Draw order of plugin objects (models and labels).
* It may be useful when other map objects (such as markers, shapes, etc.) need to be added
* on the map so that user could manage draw order of the plugin and these objects.
*/
zIndex?: number;
}
/**
* State for the building's scene
* State for the building's scene.
*/
export interface BuildingState {
/**
* Identifier of the building's model
* An identifier of the building's model.
*/
modelId: Id;
buildingId: string;
/**
* Identifier of the floor's model
* An identifier of the floor's model.
*/
floorId?: Id;
floorId?: string;
}
/**
* Options for a model
* Options for a model.
*/
export interface ModelOptions {
/**
* Identifier of the model should be unique for every model
* An identifier of a model should be unique for every model.
*/
modelId: Id;
modelId: string;
/**
* Geographical coordinates [longitude, latitude]
* Geographical coordinates [longitude, latitude].
*/
coordinates: number[];
/**
* Url where the model is located
* URL where a model is located.
*/
modelUrl: string;
/**
* Rotation of the model in degrees about the X axis
* Rotation of a model in degrees about the X axis.
*/
rotateX?: number;
/**
* Rotation of the model in degrees about the Y axis
* Rotation of a model in degrees about the Y axis.
*/
rotateY?: number;
/**
* Rotation of the model in degrees about the Z axis
* Rotation of a model in degrees about the Z axis.
*/
rotateZ?: number;
/**
* Offset of the model along the X axis in meters
* Offset of a model along the X axis in meters.
*/
offsetX?: number;
/**
* Offset of the model along the Y axis in meters
* Offset of a model along the Y axis in meters.
*/
offsetY?: number;
/**
* Offset of the model along the Z axis in meters
* Offset of a model along the Z axis in meters.
*/
offsetZ?: number;
/**
* Scale of the model
* Scale of a model.
*/
scale?: number;
/**
* List of buildings' identifiers that should be hidden
* A list of buildings' identifiers that should be hidden.
*/
linkedIds?: string[];
/**
* User specific data
* User specific data.
*/
userData?: any;
/**
* Interactivity of model. All models are interactive by default
* Interactivity of a model. The model isn't interactive by default.
*/

@@ -186,58 +151,75 @@ interactive?: boolean;

/**
* Options for a poi
* Options for a label.
*/
export interface PoiOptions {
export interface LabelOptions {
/**
* Coordinate of the poi
* Coordinates of a label.
*/
coordinates: [number, number];
/**
* Elevation of the poi
* An elevation of a label in meters.
*/
elevation?: number;
/**
* Elevation of the poi
* A text of a label.
*/
label: string;
text: string;
/**
* User specific data
* User specific data.
*/
userData?: any;
/**
* Interactivity of a label. The label isn't interactive by default.
*/
interactive?: boolean;
}
/**
* Options for a poi group
* Options for a label group.
*/
export interface PoiGroupOptions {
export interface LabelGroupOptions {
/**
* Identifier of the poi group to add
* An identifier of a label group to add.
*/
id: Id;
id: string;
/**
* Type of the poi
* An elevation of a label group in meters.
*/
type: 'primary' | 'secondary';
/**
* Elevation of the group of poi
*/
elevation: number;
/**
* Array of poi to add on the map
* An array of labels to add on the map
*/
data: PoiOptions[];
labels: LabelOptions[];
/**
* Minimum display styleZoom of the poi group
* A minimum display styleZoom of a label group.
*/
minZoom?: number;
/**
* Maximum display styleZoom of the poi group
* A maximum display styleZoom of a label group.
*/
maxZoom?: number;
/**
* Size of the poi's font
* A size of a label's font.
*/
fontSize?: number;
/**
* Color of the poi's font
* A color of a label's font.
*/
fontColor?: string;
/**
* Image settings for labels' text background.
*/
image?: LabelImage | 'default';
/**
* Interactivity of a label group. The label group isn't interactive by default.
*/
interactive?: boolean;
}
/**
* Status of a model.
* There can be no model or it can be loading or loaded.
*/
export declare enum ModelStatus {
NoModel = 0,
Loading = 1,
Loaded = 2
}

@@ -1,20 +0,21 @@

import type { Id, PoiGroupOptions, ModelOptions } from './plugin';
import { FloorLevel } from '../control/types';
import type { ModelOptions, LabelGroupOptions } from './plugin';
/**
* Options for the map
* Options for the map.
*/
export interface MapOptions {
/**
* Geographical center of the map
* Geographical center of the map.
*/
center?: number[];
/**
* Map's pitch angle in degrees
* Map's pitch angle in degrees.
*/
pitch?: number;
/**
* Map's rotation angle in degrees
* Map's rotation angle in degrees.
*/
rotation?: number;
/**
* Map's zoom
* Map's zoom.
*/

@@ -24,27 +25,27 @@ zoom?: number;

/**
* Options for a floor's plan on the realty scene
* Options for a floor's plan in the realty scene.
*/
export interface BuildingFloorOptions {
/**
* Identifier of the floor's plan
* An identifier of the floor's plan.
*/
id: Id;
id: string;
/**
* Text to add to the floors' control
* A text to add to the floors' control.
*/
text: string;
/**
* Url of a model that represents the current floor's plan
* A URL of a model that represents the current floor's plan.
*/
modelUrl: string;
/**
* Icon to add to the floors' control
* An icon to add to the floors' control.
*/
icon?: 'building' | 'parking' | string;
/**
* List of poi groups connected with the floor's plan
* A list of groups of labels connected with the floor's plan.
*/
poiGroups?: PoiGroupOptions[];
labelGroups?: LabelGroupOptions[];
/**
* Map's options to apply after selecting the particular floor
* Map's options to apply after selecting the particular floor.
*/

@@ -60,15 +61,15 @@ mapOptions?: MapOptions;

/**
* Options of popup that appears on hover of buildings
* Options of popup that appears on hover of buildings.
*/
export interface PopupOptions {
/**
* Popup's coordinates
* Popup's coordinates.
*/
coordinates: number[];
/**
* Popup's title
* A popup's title.
*/
title: string;
/**
* Popup's description
* A popup's description.
*/

@@ -78,17 +79,40 @@ description?: string;

/**
* Options for a building on the realty scene
* Options for a building in the realty scene.
*/
export interface BuildingOptions extends ModelOptions {
/**
* Map's options to apply after selecting the particular building
* Map's options to apply after selecting the particular building.
*/
mapOptions?: MapOptions;
/**
* List of the floors' plans connected with the particular building
* A list of the floors' plans connected with the particular building.
*/
floors?: BuildingFloorOptions[];
/**
* Popup options
* Popup options.
*/
popupOptions?: PopupOptions;
}
/**
* @hidden
* @internal
*/
export interface RealtySceneState {
activeModelId?: string;
buildingVisibility: Map<string, ModelOptions | undefined>;
status: 'visible' | 'hidden' | 'destroyed';
}
/**
* @hidden
* @internal
*/
export type BuildingOptionsInternal = Omit<BuildingOptions, 'floors'> & {
floors: FloorLevel[];
};
/**
* @hidden
* @internal
*/
export type BuildingFloorOptionsInternal = BuildingFloorOptions & {
buildingOptions: ModelOptions;
};

@@ -1,8 +0,1 @@

import * as THREE from 'three';
export declare function clamp(value: number, min: number, max: number): number;
export declare function degToRad(degrees: number): number;
export declare function radToDeg(radians: number): number;
export declare function clone<T>(obj: T): T;
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<{

@@ -13,7 +6,2 @@ [K in keyof T]: T extends Record<K, T[K]> ? never : K;

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 {};
export declare function concatUrl(baseUrl: string, path: string): string;
/**
* Checks whether passed url is absolute, i.e. it begins
* Checks whether passed URL is absolute, i.e. it begins
* with http://, https:// or //
*
* @param url - checked url
* @param url - checked URL
*/
export declare function isAbsoluteUrl(url: string): boolean;
{
"name": "@2gis/mapgl-gltf",
"version": "1.3.1",
"version": "2.0.0",
"description": "Plugin for the rendering glTF models with MapGL",

@@ -12,3 +12,2 @@ "main": "dist/bundle.js",

"files": [
"dist/libs",
"dist/types",

@@ -40,13 +39,9 @@ "dist/docs.json",

"license": "BSD-2-Clause",
"peerDependencies": {
"three": "~0.151.3"
},
"devDependencies": {
"@2gis/mapgl": "1.37.2",
"@2gis/mapgl": "^1.47.0",
"@documentalist/compiler": "^2.8.1",
"@types/geojson": "^7946.0.10",
"@types/jest": "^27.4.0",
"@types/jest-image-snapshot": "^4.3.1",
"@types/puppeteer": "^5.4.4",
"@types/three": "~0.150.1",
"@types/geojson": "^7946.0.10",
"clean-webpack-plugin": "^4.0.0",

@@ -62,4 +57,5 @@ "copy-webpack-plugin": "^11.0.0",

"puppeteer": "^13.3.2",
"raw-loader": "^4.0.2",
"style-loader": "^1.3.0",
"ts-jest": "^27.1.3",
"style-loader": "^1.3.0",
"ts-loader": "^9.4.2",

@@ -69,5 +65,4 @@ "typescript": "^4.9.4",

"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"raw-loader": "^4.0.2"
"webpack-dev-server": "^4.11.1"
}
}

@@ -38,14 +38,2 @@ # mapgl-gltf

## Release
1. Update the package version by running `npm version patch|minor|major`. This command returns a new package version. Let assume it's 1.2.3
1. Push changes to github and merge them to the «master» branch
1. Go to https://github.com/2gis/mapgl-gltf/releases/new
1. Click the «Choose tag» button and create a new tag according to the version in package.json, for example v1.2.3
1. Make sure the release target is the «master» branch
1. Paste the release tag into the «Release title» field, for example v1.2.3
1. Add a release description
1. Click the «Publish release» button
1. Go to https://github.com/2gis/mapgl-gltf/actions and wait for completing the release workflow
## Testing

@@ -59,2 +47,2 @@

You can find the more information in the official [documentation](https://docs.2gis.ru/ru/mapgl/examples/gltf-plugin).
You can find the more information in the official [documentation](https://docs.2gis.com/en/mapgl/immersive/gltf2-plugin).

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc