nyc-lib is a set of common libraries used to develop NYC mapping applications
yarn add nyc-lib && yarn global add postcss-cli
The following libraries are extenal requiremnents that must be included separately in your build or in your HTML page:
- proj4
- ol
- jquery
The following libraries are extenal requiremnents that may be optionally included separately depending on desired functionality:
- shapefile
- papaparse
- leaflet
Note: If you plan on load testing an application that uses this library you must do so using a staging URL provided by the DoITT GIS Unit
<link href="https://maps.nyc.gov/nyc-lib/vX.X.X/css/nyc-ol-lib.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.1.3/build/ol.js"></script>
<script src="https://maps.nyc.gov/nyc-lib/vX.X.X/js/babel-polyfill.js"></script>
<script src="https://maps.nyc.gov/nyc-lib/vX.X.X/js/nyc-ol-lib.js"></script>
<link href="https://maps.nyc.gov/nyc-lib/vX.X.X/css/nyc-lib.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js"></script>
<script src="https://maps.nyc.gov/nyc-lib/vX.X.X/js/babel-polyfill.js"></script>
<script src="https://maps.nyc.gov/nyc-lib/vX.X.X/js/nyc-leaf-lib.js"></script>
- Set environment variable
NODE_ENVtodev,stg, orprd - Contact author for addition evnvironment variables that should be included in your
.envfile - If you plan on load testing an application that uses this library you must do so using a staging build
- Once the environment is set run
yarn build
- To use
nyc.Geoclientas the implementation ofnyc.Geocoderyou must first get your Geoclient App ID and App Key from the [NYC Developer Portal] (https://developer.cityofnewyork.us/api/geoclient-api)- Register if you don't have an NYC Developer Portal account
- Developer Management > View or Create a New Project...
- If you work for NYC you may contect the DoITT GIS unit for your App ID and App Key to use a DoITT hosted and supported version of Geoclient