@mappedin/dynamic-focus
TypeScript icon, indicating that this package has built-in type declarations

6.0.1-beta.51 • Public • Published

@mappedin/dynamic-focus

An extension for Mappedin JS that manages the visibility of floors and facades on camera change.

Usage

Installation

With NPM:

npm install @mappedin/dynamic-focus

With Yarn:

yarn add @mappedin/dynamic-focus

Getting Started

import { show3dMap } from '@mappedin/mappedin-js';
import { DynamicFocus } from `@mappedin/dynamic-focus`;

const mapView = await show3dMap(...);

/**
 * Create a new Dynamic Focus controller that automatically updates the MapView scene.
 */
const df = new DynamicFocus(mapView, { autoFocus: true, setFloorOnFocus: true });

/**
 * Disable automatic updates - now you'll need to manually call `focus()` to update the view.
 */
df.updateState({ autoFocus: false });

/**
 * Manually trigger a focus update to show/hide facades and update floor visibility.
 */
df.focus();

/**
 * Clean up the controller and restore default floor visibility behavior
 */
df.destroy();

Readme

Keywords

none

Package Sidebar

Install

npm i @mappedin/dynamic-focus

Weekly Downloads

38

Version

6.0.1-beta.51

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

56.9 kB

Total Files

5

Last publish

Collaborators

  • mappedin-ops
  • mappedin-engineering