UNPKG

leaflet-geosearch

Version:

Adds support for address lookup (a.k.a. geocoding / geoseaching) to Leaflet.

43 lines 2.32 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; /* eslint-disable react/prop-types */ import React from 'react'; import * as headings from 'gatsby-theme-docz/src/components/Headings'; import { Link } from 'docz'; import { Code } from 'gatsby-theme-docz/src/components/Code'; import { Layout } from 'gatsby-theme-docz/src/components/Layout'; import { Playground } from 'gatsby-theme-docz/src/components/Playground'; import { Pre } from 'gatsby-theme-docz/src/components/Pre'; import { Props as BaseProps } from 'gatsby-theme-docz/src/components/Props'; import styles from './custom.module.css'; // use client side router for local links const a = (props) => props.href.startsWith('http://') || props.href.startsWith('https://') ? (React.createElement("a", Object.assign({}, props, { target: "_blank", rel: "noreferrer nofollow" }), props.children)) : (React.createElement(Link, { to: props.href }, props.children)); // reformat props table // this could be even better, but we need to override some defaults components // see for inspiration, see https://github.com/storybookjs/storybook/issues/9395 const Props = (_a) => { var { props } = _a, rest = __rest(_a, ["props"]); Object.keys(props).forEach((key) => { const type = props[key].type; type.name = type.name .replace(/\| undefined$/, '') .replace(/"/g, "'") .replace(); if (type.name[0] === '(' && type.name[type.name.length - 1] === ')') { type.name = type.name.substr(1, type.name.length - 2); } }); return (React.createElement("div", { className: styles.props }, React.createElement(BaseProps, Object.assign({}, rest, { props: props })))); }; export default Object.assign(Object.assign({}, headings), { code: Code, a, playground: Playground, pre: Pre, layout: Layout, props: Props }); //# sourceMappingURL=index.js.map