@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
22 lines (21 loc) • 2.15 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { TILE_LAYER_RD } from '@open-formulieren/leaflet-tools';
import { FormattedMessage, useIntl } from 'react-intl';
import { NumberField, Panel } from '../../components/formio';
const DefaultZoom = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "UJTIZU", defaultMessage: [{ type: 0, value: "Zoom level for the map when it initially loads." }] });
return (_jsx(NumberField, { name: "defaultZoom", label: _jsx(FormattedMessage, { id: 'xxVNeU', defaultMessage: [{ type: 0, value: "Zoom level" }] }), tooltip: tooltip, step: 1, min: TILE_LAYER_RD.minZoom, max: TILE_LAYER_RD.maxZoom }));
};
const Latitude = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "ADTla/", defaultMessage: [{ type: 0, value: "Latitude coordinate of the initial center point of the map." }] });
return (_jsx(NumberField, { name: "initialCenter.lat", label: _jsx(FormattedMessage, { id: 'jnHPfU', defaultMessage: [{ type: 0, value: "Latitude" }] }), description: _jsx(FormattedMessage, { id: 'jiDz2v', defaultMessage: [{ type: 0, value: "Value in decimal degrees, between -90 and +90." }] }), tooltip: tooltip, placeholder: "52.1326332" }));
};
const Longitude = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "Kdgpxf", defaultMessage: [{ type: 0, value: "Longitude coordinate of the initial center point of the map." }] });
return (_jsx(NumberField, { name: "initialCenter.lng", label: _jsx(FormattedMessage, { id: 'LZc4TN', defaultMessage: [{ type: 0, value: "Longitude" }] }), description: _jsx(FormattedMessage, { id: 'z45pcO', defaultMessage: [{ type: 0, value: "Value in decimal degrees, between -180 and +180." }] }), tooltip: tooltip, placeholder: "5.291266" }));
};
const MapConfiguration = () => (_jsxs(Panel, Object.assign({ title: _jsx(FormattedMessage, { id: 'pdmkVe', defaultMessage: [{ type: 0, value: "Initial focus" }] }), collapsible: true, initialCollapsed: true }, { children: [_jsx(DefaultZoom, {}), _jsx(Latitude, {}), _jsx(Longitude, {})] })));
export default MapConfiguration;