UNPKG

terriajs

Version:

Geospatial data visualization platform.

29 lines 975 B
import { action } from "mobx"; import { createElement } from "react"; import FeatureLink from "../Generic/FeatureLink"; import CustomComponent from "./CustomComponent"; /** * A `<settingspanel>` custom component, that shows a link like button which when clicked * opens the settings panel. * * Props accepted * - title - The text to use as alt link content * - children - The link text * * Example: <settingspanel title="Open settings panel">Change base map</settingspanel> */ export default class SettingsPanelLinkCustomComponent extends CustomComponent { get name() { return "settingspanel"; } get attributes() { return ["title"]; } processNode(_context, node, children) { return createElement(FeatureLink, { title: node.attribs?.title, onClick: action((viewState) => viewState.openSettingsPanel()) }, ...children); } } //# sourceMappingURL=SettingsPanelLinkCustomComponent.js.map