Skip to content
Last updated

API / geotoolkit / map / toolbar / MapOverview / MapOverview

Class: MapOverview

toolbar.MapOverview.MapOverview

This class defines a map overview toggle button that controls the display of a canvas DOM element at a specified location. It uses a new plot and map widget configured with user-defined settings. The overview widget mirrors the visible bounds of the main map widget via a rectangular viewport, and supports two-way interaction: viewport rectangle updates in real-time with the main map and allows users to drag it to navigate the main map directly.

Example

const plot = new Plot({
'canvaselement': canvas,
'root': map
});
// create new toolbar with a single button:
new Toolbar({
'buttons': [
new MapOverview({
'layers': [...], // map layers to use
'tools': plot.getTool(),
// overview canvas size and position:
'overview': {
'alignment': AnchorType.RightBottom,
'offset': 10,
'width': 200,
'height': 150
}
})
],
'orientation': Orientation.Horizontal,
'alignment': AnchorType.RightBottom,
'tools': plot.getTool()
});

Hierarchy

Table of contents

Constructors
  • [new MapOverview(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.map.toolbar.mapoverview.mapoverview.md#new mapoverview(options))
Methods

Contents

Constructors

new MapOverview(options)

• new MapOverview(options?)

Parameters

Name Type Description
Optional optionsOptionsbutton options

Overrides

Button.constructor

Methods

clear

▸ clear(tools, registry): void

Clears this button, removes all listeners and button DOM element from the document.<br> Calls user callback with the ToolsContainer provided and 'false' flag to clear the data. Removes itself from the registry list.

Parameters

Name Type Description
toolsToolsContainertools container for the user callback
registryButton[]button registry to remove itself from

Returns

void

Inherited from

Button.clear


clone

▸ clone(): Button

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

Button

clone

Inherited from

Button.clone


copyConstructor

▸ Protected copyConstructor(src): MapOverview

Copy constructor function.<br> Function used as part of the cloning mechanism.<br> Implementations should copy the given instance state to this instance.<br>

Parameters

Name Type Description
srcButtonSource to copy from

Returns

MapOverview

this

Inherited from

Button.copyConstructor


getAction

▸ getAction(): ActionCallback

Returns current action callback (if exists)

Returns

ActionCallback

Inherited from

Button.getAction


getBorder

▸ getBorder(): string

Returns button element border

Returns

string

Inherited from

Button.getBorder


getChecked

▸ getChecked(): boolean

Returns true if button is checked (for checkbox case), false otherwise

Returns

boolean

Inherited from

Button.getChecked


getClassName

▸ getClassName(): string

Returns

string

Inherited from

Button.getClassName


getColor

▸ getColor(): string

Returns button element background color

Returns

string

Inherited from

Button.getColor


getElement

▸ getElement(): HTMLElement

Returns current html DOM element used for the button

Returns

HTMLElement

Inherited from

Button.getElement


getHeight

▸ getHeight(): number

Returns fixed button height in px (if was set), null otherwise

Returns

number

Inherited from

Button.getHeight


getIcon

▸ getIcon(): string

Returns button icon

Returns

string

Inherited from

Button.getIcon


getInit

▸ getInit(): InitCallback

Returns current initialization callback to be called on toolbar init/dispose

Returns

InitCallback

initialization callback

Inherited from

Button.getInit


getName

▸ getName(): string[]

Returns current name(s) that describe group(s) that the radio button belongs to (checkbox case only). If the button should not switch automatically or is not checkbox, returns empty array

Returns

string[]

Inherited from

Button.getName


getPaddingStyle

▸ getPaddingStyle(): string

Returns button element padding style

Returns

string

Inherited from

Button.getPaddingStyle


getPlot

▸ getPlot(): Plot

Returns minimap overview plot

Returns

Plot


getTextColor

▸ getTextColor(): string

Returns button element text color

Returns

string

Inherited from

Button.getTextColor


getTitle

▸ getTitle(): string

Returns button DOM element title text

Returns

string

Inherited from

Button.getTitle


getViewPort

▸ getViewPort(): Rectangle

Returns minimap view port rectangle shape

Returns

Rectangle


getVisible

▸ getVisible(): boolean

Returns true if map overview canvas is visible

Returns

boolean


getWidget

▸ getWidget(): Map

Returns minimap overview map widget

Returns

Map


getWidth

▸ getWidth(): number

Returns fixed button width in px (if was set), null otherwise

Returns

number

Inherited from

Button.getWidth


init

▸ init(tools, registry, parent, gap, insertId, listener): MapOverview

Initializes button, creates event listeners and adds button element to the document

Parameters

Name Type Description
toolsToolsContainertools container for the user callback
registryButton[]list of buttons on the Plot, is needed for correct on/off radio buttons
parentHTMLElementparent element to add button to
gapHTMLElementgap element or null if no gap is needed
insertIdnumberinsert position index
listener(b: Button) => voidlistener callback

Returns

MapOverview

this

Inherited from

Button.init


setAction

▸ setAction(action): MapOverview

Sets current action callback

Parameters

Name Type Description
actionActionCallbackaction callback to be called when pressing the button

Returns

MapOverview

this

Inherited from

Button.setAction


setBorder

▸ setBorder(border): MapOverview

Sets button element border

Parameters

Name Type Description
borderstringcss-styled border value

Returns

MapOverview

this

Inherited from

Button.setBorder


setChecked

▸ setChecked(checked): MapOverview

Adds or removes css checked class to the DOM element

Parameters

Name Type Description
checkedbooleantrue to add checked class, false otherwise

Returns

MapOverview

this

Inherited from

Button.setChecked


setColor

▸ setColor(color): MapOverview

Sets button element background color

Parameters

Name Type Description
colorstringbackground color

Returns

MapOverview

this

Inherited from

Button.setColor


setIcon

▸ setIcon(icon): MapOverview

Set button icon

Parameters

Name Type
iconstring

Returns

MapOverview

Inherited from

Button.setIcon


setInit

▸ setInit(init): MapOverview

Sets initialization callback that is called on toolbar init/dispose

Parameters

Name Type Description
initInitCallbackinitialization callback

Returns

MapOverview

this

Inherited from

Button.setInit


setOverviewSize

▸ setOverviewSize(width, height?): MapOverview

Sets overview DOM element fixed size (in px)

Parameters

Name Type Description
widthnumberoverview element size or width
Optional heightnumberoverview element height. Equals to width, if nothing is provided.

Returns

MapOverview

this


setPaddingStyle

▸ setPaddingStyle(padding): MapOverview

Sets button element padding style

Parameters

Name Type Description
paddingstring | numberpadding (in px) or style string

Returns

MapOverview

Inherited from

Button.setPaddingStyle


setSize

▸ setSize(width, height?): MapOverview

Sets button DOM element fixed size (in px)

Parameters

Name Type Description
widthstring | numberbutton element size or width
Optional heightstring | numberbutton element height. Equals to width, if nothing is provided.

Returns

MapOverview

this

Inherited from

Button.setSize


setTextColor

▸ setTextColor(color): MapOverview

Sets button element text color

Parameters

Name Type Description
colorstringtext color

Returns

MapOverview

this

Inherited from

Button.setTextColor


setTitle

▸ setTitle(title): MapOverview

Sets button DOM element title

Parameters

Name Type Description
titlestringtitle text

Returns

MapOverview

Inherited from

Button.setTitle


setVisible

▸ setVisible(visible): MapOverview

Shows or hides map overview canvas

Parameters

Name Type Description
visiblebooleantrue to show canvas, false otherwise

Returns

MapOverview


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

Button.getClassName