A light js client for mapreflex service
You should generate the api key on Mapreflex cabinet
MapReflexClient is available on NPM. To install it open a terminal and run…
npm install @mapreflex/api-client --save
Not using NPM? While I would strongly recommend you to use NPM to manage your app's dependencies, you can still download it manually.
Once installed you can use it with your favorite module bundler.
// Using ES6 syntax (requires a transpiler)
import MapReflexClient from '@mapreflex/api-client';
const api = new MapReflexClient({apiKey:API_KEY});
// Using ES5 syntax
var MapReflexClient = require('@mapreflex/api-client');
var api = new MapReflexClient({apiKey:API_KEY});
Not using a module bundler? No problem! If you include MapReflexClient using a <script>
tag it will expose a global MapReflexClient
constructor which you can use.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Your regular head tags -->
</head>
<body>
<!-- Your regular body -->
<script type="text/javascript" src="https://unpkg.com/@maprelfex/api-client/dist/mapreflex-client.umd.js"></script>
<script type="text/javascript">
var api = new MapReflexClient({apiKey:API_KEY});
</script>
</body>
</html>
getByCountyNameAndStateAb(countyName: string, stateAb: string): Promise<FeatureCollection<MultiPolygon, ZctaProperties>>
getInBoundingBox(northEast: number[], southWest: number[], intersect?: boolean): Promise<FeatureCollection<MultiPolygon, ZctaProperties>>
getInRadius(latitude: number, longitude: number, radius: number): Promise<FeatureCollection<MultiPolygon, ZctaProperties>>
getByCountyNameAndStateAb(countyName: string, stateAb: string): Promise<FeatureCollection<MultiPolygon, CountyProperties>>
getInBoundingBox(northEast: number[], southWest: number[], intersect?: boolean): Promise<FeatureCollection<MultiPolygon, CountyProperties>>
getInRadius(latitude: number, longitude: number, radius: number): Promise<FeatureCollection<MultiPolygon, CountyProperties>>
getInBoundingBox(northEast: number[], southWest: number[], intersect?: boolean): Promise<FeatureCollection<MultiPolygon, StateProperties>>
getInRadius(latitude: number, longitude: number, radius: number): Promise<FeatureCollection<MultiPolygon, StateProperties>>
If you're upset that I decided to ditch jQuery don't be. I plan to write a wrapper and enable MapReflexClient to work as a jQuery plugin, though the API will break, that's for sure. You'll need to update your code if you plan to upgrade.
Run npm install on repository root
npm install
npm run build
npm run demo-server