Skip to main content
Version: 1.0.0

Map Controls

Set Split Mode

Using the setSplitMode(...) API function user can change the map Split Mode between dual, swipe, or single mode. Allows the user to pass layer id's to set layer visibility per split view.

/**
* Sets the split mode of the map.
* @param splitMode Split map mode with associated layers.
* @param options A set of options to use when setting the split mode.
* @returns The new split mode of the map with associated layers.
*/
setSplitMode(splitMode: SplitMode, options?: SetSplitModeOptions): SplitModeDetails;
type SplitMode = 'single' | 'dual' | 'swipe';
type SetSplitModeOptions = {
/** An array of layer ids to show on either side of the split. Only applicable for multi-view split modes. */
layers?: string[][];
/** Boolean indicating whether views are synced. Only applicable to dual split mode. */
isViewSynced?: boolean;
/** Boolean indicating whether zoom is synced between views. Only applicable to dual split mode. */
isZoomSynced?: boolean;
};
  • NameDescription
    splitMode
    Choice between SINGLE / DUAL / SWIPE mode
    options.layers string[][]
    (Optional) Array of layer id's to set layer visibility per split view.
    • First element in the array contains the id's of the layers that should be visible in the left half of the map.
    • Second element in the array contains the id's of the layers that should be visible in the right half of the map.
    • If the id of an existing and visible layer is not listed in one or both of the elements, layer will be hidden from that half of the map.
    options.isViewSynced boolean
    (Optional) Boolean indicating whether views are synced. Only applicable to dual split mode.
    options.isZoomSynced boolean
    (Optional) Boolean indicating whether zoom is synced between views. Only applicable to dual split mode.

Set Map Controls Visibility

Using the setMapControlVisibility(...) API function user can control the visibility of map controls such as the map legend, 2D/3D view control, split map control, and map draw control.

/**
* Sets the map control visibility settings.
* @param visibility The new map control visibility settings.
* @returns The new map control visibility settings.
*/
setMapControlVisibility(visibility: Partial<MapControlVisibility>): MapControlVisibility;
/**
* Map controls that support customization.
*/
export declare type MapControls = 'legend' | 'toggle-3d' | 'split-map' | 'map-draw' | 'chart';
/**
* A map of map control component visibility.
*/
export declare type MapControlVisibility = {
[control in MapControls]: boolean;
};
  • NameDescription
    'legend' boolean
    Legend visibility
    'toggle-3d' boolean
    Map Mode control visibility
    'split-map' boolean
    Split Map control visibility
    'map-draw' boolean
    Map draw control visibility
    'chart' boolean
    Map chart control visibility