How to use the leaflet-geosearch.EsriProvider function in leaflet-geosearch

To help you get started, we’ve selected a few leaflet-geosearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webdevstar / Dashborad / client / src / components / generic / MapData.tsx View on Github external
position: 'absolute',
  } as React.CSSProperties,
  center: {
    width: '50px',
    height: '50px',
    position: 'relative',
    top: 'calc(50% - 80px)',
    left: 'calc(50% - 25px)',
  } as React.CSSProperties,
  spinner: {
    margin: 0,
    padding: 0,
  } as React.CSSProperties
};

const provider = new EsriProvider(); // does the search from address to lng and lat 

interface IMapDataProps extends IGenericProps {
  mapProps: any;
  props: {
    searchLocations: boolean;
  };
}

interface IMapDataState extends IGenericState {
  markers: Array<{ position: string[] }>;
  locations: any[];
}

export default class MapData extends GenericComponent {

  static defaultProps = {
github Azure / ibex-dashboard / client / src / components / generic / MapData.tsx View on Github external
position: 'absolute',
  } as React.CSSProperties,
  center: {
    width: '50px',
    height: '50px',
    position: 'relative',
    top: 'calc(50% - 80px)',
    left: 'calc(50% - 25px)',
  } as React.CSSProperties,
  spinner: {
    margin: 0,
    padding: 0,
  } as React.CSSProperties
};

const provider = new EsriProvider(); // does the search from address to lng and lat 

interface IMapDataProps extends IGenericProps {
  mapProps: any;
  props: {
    searchLocations: boolean;
  };
};

interface IMapDataState extends IGenericState {
  markers: Object[];
  locations: any[];
}

export default class MapData extends GenericComponent {

  static defaultProps = {
github DefinitelyTyped / DefinitelyTyped / types / leaflet-geosearch / leaflet-geosearch-tests.ts View on Github external
(async () => {
  async function search(
    provider: BaseProvider,
    options = { query: 'Where is my home?' },
  ) {
    return provider.search(options);
  }

  [
    await search(new OpenStreetMapProvider()),
    await search(new BingProvider({ key: 'BING_API_KEY' })),
    await search(new EsriProvider()),
    await search(new GoogleProvider({ key: 'GOOGLE_MAPS_API_KEY ' })),
  ].forEach(([{ x, y, bounds, label, raw }]) => ({ x, y, bounds, label, raw }));
})();
github smeijer / leaflet-geosearch / docs / snippets / esri.js View on Github external
import L from 'leaflet';
import {
  GeoSearchControl,
  EsriProvider,
} from 'leaflet-geosearch';

const provider = new EsriProvider();

const searchControl = new GeoSearchControl({
  provider: provider,
});

const map = new L.Map('map');
map.addControl(searchControl);

leaflet-geosearch

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

MIT
Latest version published 3 months ago

Package Health Score

80 / 100
Full package analysis