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 --saveNot 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)importMapReflexClientfrom'@mapreflex/api-client';constapi=newMapReflexClient({apiKey:API_KEY});// Using ES5 syntaxvarMapReflexClient=require('@mapreflex/api-client');varapi=newMapReflexClient({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><htmllang="en"><head><!-- Your regular head tags --></head><body><!-- Your regular body --><scripttype="text/javascript" src="https://unpkg.com/@maprelfex/api-client/dist/mapreflex-client.umd.js"></script><scripttype="text/javascript">varapi=newMapReflexClient({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