Skip to content

Update documentation to include examples of ES6-style imports (import * as .... from 'esri-leaflet-geocoder')Β #293

Open
@TannerJuby1

Description

I installed this project via npm as well as it's types for my Gatsby (react) project, but I am unable to use it thru the leaflet package as the documentation suggests.

I ran npm i esri-leaflet-geocoder --save and npm i @types/esri-leaflet-geocoder --save which installed properly, but when I go to use the geocode like the documentation suggests:

L.esri.Geocoder.reverseGeocode(...

I get a runtime error that Geocoder is undefined.

I can get around this by importing the package directly:

import * as ELG from 'esri-leaflet-geocoder'

ELG.reverseGeocode(....

However, when I do it this way. I run into issues with the api key that I've opened another issue about

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions