Skip to content

Initial Search Mapclick or Searchbar

rothwell.andy@gmail.com edited this page Jul 26, 2024 · 1 revision

There are 2 ways to search an address in atlas.phila.gov:

  1. using the address search bar over the map (geocoding)
  2. clicking on a parcel on the map
initial-search

Using the address search bar

The app attempts to geocode the search input using the city's Address Info Service (AIS), by running the GeocodeStore's fillAisData() function, and stores the result as GeocodeStore.aisData

Clicking on the map

The app knows whether the PWD or DOR basemap is showing (which is based on which topic is open). The app uses the longitude and latitude of the map click to check whether a parcel that matches the parcel-type of the basemap was clicked on.

If you click in the street or the rivers, neither parcel dataset will have data for that [lng, lat], and the app will do nothing.

If the PWD basemap is showing, and there is a PWD parcel at the clicked [lng, lat], it will store that PWD parcel info as ParcelsStore.pwd. Then, if a DOR parcel is found at that [lng, lat], it will store that parcel info as ParcelsStore.dor. If there is NO PWD parcel, however, it won't even check for a DOR parcel, it will consider the click is like clicking in the street, and nothing will happen.

The same thing is true in the opposite way:

If the DOR basemap is showing, and there is a DOR parcel (or multiple DOR parcels) at the clicked [lng, lat], it will store those DOR parcels' info as ParcelsStore.dor. Then, if a PWD parcel is found at that [lng, lat], it will store that parcel info as ParcelsStore.pwd. If there is NO DOR parcel, however, it won't even check for a PWD parcel, it will consider the click is like clicking in the street, and nothing will happen.

Routing

The address bar or map clicking described above temporarily routes the app to "/search", and this route has a beforeEnter which does the following:

  1. runs the geocode or parcel search described above
  2. IF an address is found by geocoding or using a parcel address, it ends by calling routeApp(), which pushes an address to the route. Any time the route changes, the app calls the function datafetch(), which is the second search.
Clone this wiki locally