The City Map is the official adopted map of the city. It shows the location, dimension and grades of streets, parks, public places, and certain public easements. However, the City Map isn’t one comprehensive map; it’s a collection of many alteration maps for small areas of the City. This app brings all of the pieces of the City Map into one convenient place on the web.
You will need the following things properly installed on your computer.
git clone git@github.com:NYCPlanning/labs-streets.git
cd labs-streets
yarn
yarn run start
The Carto instance to be used when the app calls Carto's SQL API is controlled by the carto-username
key defined on the ENV
object in /config/environment.js
. When you run the project locally, by default, that should point to the planninglabs
instance. To change this, you can temporarily change the carto-username
value in environment.js
or pass in a CARTO_USER
environment variable when you run the project (See netlify.toml
for an example of how to do this)
This application uses Layers API to pull down JSON configurations that are used to call Carto's Maps API to serve vector tiles to the client. The base URL specified in the host
key on ENV
in /config/environment.js
determines which environment of Layers API you will be pointing to when running this project locally. By default, the app will point to the production layers API. To change this, you can temporarily update the host
value on the ENV
object in environment.js
or pass in a API_HOST
environment variable when you run the project (see netlify.toml
for examples of how to do this).
If you are also running Layers API locally and want to use that, you can specify the localhost with the port for host
, such as
ENV.host = 'http://localhost:3000';
or
yarn start:local-api
Streets is an Ember.js single page application (SPA). The frontend handles routing, web mapping, layout, and user interactions, and communicates with various APIs for content and data.
In this mapping iteration, we use models to manage individual layer and layer-group state. A layer group is a collection of layers, with a single visibility state. If a layer group's visibility is toggled off, that state is delegated to its related layers. These models allow for developers to reference a layer model from anywhere and manipulate its state, including layers' paint, layout, and filter states. These three properties are part of the MapboxGL Style Specification.
Carto is the primary backend resource, which provides a PostGIS database, Map Tiler, and JSON/GeoJSON data API. All of the data represented in the app starts out as a PostGIS table in Carto.
labs-search
object found in /config/environment.js
ESLint - We use ESLint with Airbnb's rules for JavaScript projects
eslint
at the command line with the --fix
flag to automatically fix some errors.Testing
ember test --serve
develop
and passes all testsYou can find us on Twitter at @NYCPlanningTech, or comment on issues and we'll follow up as soon as we can. If you'd like to send an email, use OpenSource_dl@planning.nyc.gov