// Storybook import { ComponentStory, ComponentMeta } from '@storybook/react'; // React import React from "react"; // Geovisto import { ISidebarTabProps } from 'geovisto-sidebar'; // Internal imports import { SidebarTab, SidebarTool, MarkerLayerTool } from '../react/components'; import { ISidebarTabDataProps } from '../react/types'; // Styles import '../styles/common.scss'; // Stories internal helper components import { ExportMapWrapper } from '../storiesHelpers/ExportMapWrapper'; // Data import covidCzechDistrictsCumulative from '../../static/data/covidCzechDistrictsCumulative.json'; // Config import czDefaultMapPosition from '../../static/config/defaultPosition/config-czDefaultPosition.json'; const MarkerLayerToolDemo = (props: IMarkerLayerToolDemoProps) : JSX.Element => { const extendedProps = { mapId: 'geovisto-map-marker-demo', data: covidCzechDistrictsCumulative, config: props.defaultMapPosition ? czDefaultMapPosition : undefined, ...props }; return ( ); }; export default { component: MarkerLayerToolDemo, title: 'Tools/Marker Layer Tool', argTypes: { sidebarToolEnabled: { name: "SidebarTool: Enabled", description: "Enabled property of the SidebarTool instance.", }, sidebarTabTool: { name: "SidebarTab - MarkerLayerTool", description: "Properties of the sidebar tab of the MarkerLayerTool.", }, showBaseTileLayerMap: { name: "Base tile layer: Enabled", description: "Toggles the base tiles layer.", }, toolId: { name: "Id", description: "Id property of the MarkerLayerTool instance.", }, toolName: { name: "Name", description: "Name property of the MarkerLayerTool instance.", }, toolLabel: { name: "Label", description: "Label property of the MarkerLayerTool instance.", }, toolEnabled: { name: "Enabled", description: "Enabled property of the MarkerLayerTool instance.", }, defaultMapPosition: { name: "Default map position (CZ):", description: "Enables/Disables config with the center of the map set on Czech republic.", } }, } as ComponentMeta; export type IMarkerLayerToolDemoProps = { defaultMapPosition: boolean, toolId: string; toolEnabled: boolean; toolName: string; toolLabel: string; sidebarToolEnabled: boolean; sidebarTabTool: ISidebarTabDataProps; showBaseTileLayerMap: boolean; } const Template : ComponentStory = args => export const GeovistoMarkerLayerToolStory = Template.bind({}); GeovistoMarkerLayerToolStory.storyName = 'Marker Layer Tool'; GeovistoMarkerLayerToolStory.args = { defaultMapPosition: true, toolEnabled: true, toolId: 'geovisto-marker-layer-tool-map', toolName: 'Marker Layer Tool', toolLabel: 'Marker Layer Tool label', sidebarToolEnabled: true, sidebarTabTool: { tool: 'geovisto-marker-layer-tool-map', enabled: true, name: 'Marker layer settings', icon: '', checkButton: true }, showBaseTileLayerMap: true }