Esri / Esri/esri-leaflet-geocoder

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

Open
#293 10 comments 1 reaction 0 assignees View on GitHub
Documentation Good First Issue
Dominant language
JavaScript
Stars
251
Forks
101
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.