1.1.1 • Published 1 year ago

@jibestream-dev/jmap-mapui-kit v1.1.1

Weekly downloads
45
License
ISC
Repository
github
Last release
1 year ago

MapUiKit

Kit for working with Jibestream Map UI Components

Kind: global class

new MapUiKit(control, options)

Create a Map UI Kit

ParamTypeDefaultDescription
controljmap.JControllerThe currently initialised control
optionsObjectOptions for how the Map UI Kit should be rendered
options.padding 'Array' .<Number>0, 0, 0, 0Padding for the UI Kit given as pixels from the edge of the container top, right, bottom, left
options.classNameString"map-ui-container"The class name for the DOM element that contains all of the UI Kit components

mapUiKit.renderCompass(options) ⇒ DOMElement

Render or update the compass components

Kind: instance method of MapUiKit
Access: public

ParamTypeDefaultDescription
optionsObjectHow to render the compass
options.svgIconStringWhat SVG to use for the SVG (given as a data URI)
options.rotatedSvgIconStringWhat SVG to use for when the compass is rotated (given as a data URI)
options.resetRotationOnTapBooleantrueWhether the map should reset rotation on tap of the compass
options.position 'Array' .<Number>1, 0Where the compass should be placed, given as x, y with x and y being 0 <= x/y <= 1
options.paddingObject0, 0, 0, 0How much padding the compass should have
options.widthObject
options.heightObject

mapUiKit.renderFloorSelector(options) ⇒ DOMElement

Render of update the floor selector

Kind: instance method of MapUiKit
Access: public

ParamTypeDescription
optionsObject
options.inactiveStylejmap.core.StyleHow the inactive state should be styled
options.inactiveFontjmap.core.FontHow the inactive state's font should appear
options.activeStylejmap.core.StyleHow the active state should be styled
options.activeFontjmap.core.FontHow the active state's font should appear
options.position 'Array' .<Number>Where the floor selector should be placed, given as x, y with x and y being 0 <= x/y <= 1
options.padding 'Array' .<Number>How much padding the floor selector should have
options.verticalBooleanWhether the floor selector should appear vertically or horizontally

mapUiKit.renderZoomButtons(options) ⇒ DOMElement

Render or update the zoom buttons

Kind: instance method of MapUiKit
Access: public

ParamTypeDescription
optionsObject
options.inactiveStylejmap.core.StyleHow the inactive state should be styled
options.inactiveFontjmap.core.FontHow the inactive state's font should appear
options.activeStylejmap.core.StyleHow the active state should be styled
options.activeFontjmap.core.FontHow the active state's font should appear
options.position 'Array' .<Number>Where the zoom buttons should be placed, given as x, y with x and y being 0 <= x/y <= 1
options.zoomInTextStringWhat text the zoom in button should have
options.zoomOutTextStringWhat text the zoom out button should have
options.padding 'Array' .<Number>How much padding the zoom buttons should have

mapUiKit.renderSearch(options) ⇒ DOMElement

Render or update the search bar

Kind: instance method of MapUiKit
Access: public

ParamTypeDescription
optionsObject
options.inactiveStylejmap.core.StyleHow the inactive state should be styled
options.inactiveFontjmap.core.FontHow the inactive state's font should appear
options.activeStylejmap.core.StyleHow the active state should be styled
options.activeFontjmap.core.FontHow the active state's font should appear
options.position 'Array' .<Number>Where the search bar should be placed, given as x, y with x and y being 0 <= x/y <= 1
options.placeholderStringWhat text should appear in the search bar as placeholder
options.searchArray 'Array' .<Object>What objects to search through/display
options.maxResultsNumberHow many results should be displayed
options.onSelectfunctionA function that's run on click of a result (with the result as the first parameter passed to the function)
options.padding 'Array' .<Number>How much padding the search should have

mapUiKit.renderPopup(options) ⇒ DOMElement

Render a popup

Kind: instance method of MapUiKit
Access: public

ParamTypeDescription
optionsObject
options.coordinates 'Array' .<Number>Where on the map should the popup be placed
options.mapObjectOn what map should the popup be placed
options.titleTextStringThe popup's title text
options.titleTextStylejmap.core.FontHow the title text should be style
options.subTextStringThe popup's subtitle text
options.subTextStylejmap.core.FontHow the subtitle text should be styled
options.showActionButtonBooleanWhether the action button should be shown
options.actionButtonTextStringThe action button's text
options.actionButtonTextStylejmap.core.FontHow the action button's text should be styled
options.actionButtonInactiveStylejmap.core.StyleThe inactive style for the action button
options.actionButtonStylejmap.core.StyleThe active style for the action button
options.actionButtonCallbackfunctionA function that's called when the action button is clicked
options.popupStylejmap.core.StyleHow the popup should be styled