# wsdot-elc

> JavaScript client for WSDOT ELC map service SOE

Latest version **4.0.0-0** (published 2018-06-07) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install wsdot-elc
pnpm add wsdot-elc
yarn add wsdot-elc
bun add wsdot-elc
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.0-0 |
| Published | 2018-06-07 |
| First published | 2017-09-15 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 90.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | WSDOT |
| Maintainers | jeff-jacobson |
| Keywords | ELC, state, WA, WSDOT, Washington, route, location, enterprise, class, lrs |

## Links

- npm: https://www.npmjs.com/package/wsdot-elc
- Repository: https://github.com/WSDOT-GIS/elc-js
- Homepage: https://github.com/WSDOT-GIS/elc-js#readme
- Issues: https://github.com/WSDOT-GIS/elc-js/issues
- npm.io page: https://npm.io/package/wsdot-elc

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.2

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 4.0.0-0 (latest) — 2018-06-07
- 3.1.0-beta.0 (next) — 2018-05-29
- 3.0.3 — 2017-09-15
- 3.0.2 — 2017-09-15
- 3.0.1 — 2017-09-15
- 3.0.0 — 2017-09-15

## README

# elc-js

JavaScript client library for accessing WSDOT's [Enterprise Location Class ArcGIS Server SOE].

[![Build Status](https://travis-ci.org/WSDOT-GIS/elc-js.svg)](https://travis-ci.org/WSDOT-GIS/elc-js)

## Installation

```console
npm install wsdot-elc
```

This package uses the [Fetch API]. If using this package in Node, you will also need to install a polyfill such as [isomorphic-fetch].

```javascript
// import the fetch polyfill module if fetch is not defined in current environment.
if (typeof fetch === "undefined") {
  require("isomorphic-fetch");
}
```

## Example

```typescript
// module import
import { RouteLocation, RouteLocator } from "wsdot-elc";

// Create route locator client object.
const routeLocator = new RouteLocator();

// Find route location. Minimum required parameters.

(async () => {
  const dateString = "12/31/2011";
  const rl = new RouteLocation({
    Route: "005",
    Arm: 0,
    ReferenceDate: new Date(dateString)
  });

  const params = {
    useCors: true,
    locations: [rl]
  };

  const locations = await routeLocator.findRouteLocations(params);
  // do something with the locations.
})();

// use a single reference date insteat of per-location date
(async () => {
  const dateString = "12/31/2011";
  const rl = new RouteLocation({
    Route: "005",
    Arm: 0
  });

  const params = {
    useCors: true,
    locations: [rl],
    referenceDate: new Date(dateString)
  };

  const locations = await routeLocator.findRouteLocations(params);
  // do something with locations.
})();

// find nearest route location
(async () => {
  const params = {
    useCors: true,
    coordinates: [1083893.182, 111526.885],
    referenceDate: new Date("12/31/2011"),
    searchRadius: 1,
    inSR: 2927
  };

  const locations = await routeLocator.findNearestRouteLocations(params);
  // do something with locations.
})();

// get a list of supported routes
(async () => {
  const routes = await routeLocator.getRouteList(true);
})();
```

## Modules

### RouteLocator

A class that aids in calling the ELC SOE.

### Route

A class that represents a route in WSDOT's Linear Referencing System.

### RouteId

A class that represents a route's ID.

### RouteList

A class that represents the list of routes returned from the ELC SOE's `routes` endpoint.

### RouteLocation

Represents a route location result returned from ELC SOE operations.

[enterprise location class arcgis server soe]: http://data.wsdot.wa.gov/arcgis/rest/services/Shared/ElcRestSOE/MapServer/exts/ElcRestSoe/
[fetch api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[isomorphic-fetch]: https://www.npmjs.com/package/isomorphic-fetch

---
_Source: https://npm.io/package/wsdot-elc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
