Skip to content

agrc/vista

vista Build Status

A web app that is embedded within the Vista application

Query Parameters

This application is configurable/controllable via URL query parameters.

Initial Extent

The initial extent of the map is defined by one of three parameters. They are, in order of precedence: zip, precinctID, and county.

URL Parameters

zip

A five digit zip code (e.g. 84124) as defined by the ZIP5 field within SGID10.Boundaries.ZipCodes.

precinctID

The precinct ID (e.g. LA23:I-N-) as defined by the VistaID field within SGID10.Political.VistaBallotAreas.

county

The county number (e.g. 9 or 15) as defined by the COUNTYNBR field within SGID10.Boundaries.Counties.

districts

A switch (yes or no) that controls the visibility of political district data being displayed on map click popups and in the hidden form fields.

precinct

A switch (yes or no) that controls the visibility of the precinct data being displayed on map click popups and in the hidden form fields.

map

A switch (c (current), p (proposed)) for controlling the version of the precinct dataset. Current is SGID10.Political.VistaBallotAreas and proposed is SGID10.Political.VistaBallotAreas_Proposed. This effects the precinct layer that is drawn on the map in addition to the data shown in the popup and hidden form field.

db

A parameter that is passed on to the vista web service.

query

If this parameter is present, the app sends a request to the vista web service and displays the returned data as white points on the map.

currentX & currentY

If both of these coordinates (UTM) are present, then the application displays a blue dot at their location on the map.

firebug

A switch (yes or no) that controls weather Firebug Lite is loaded in the page. This is helpful for debugging in a web control that doesn't have developer tools.

Hidden Form Fields

There are several form input elements that are hidden. These provide a way for vista to read data from this app. Their element ids are: XCoord, YCoord, Precinct, House, Senate, FedHouse, CountyID, selectedID, and Address.

All element values are updated when a user clicks on the map (not on an existing point) except for selectedID and Address. selectedID and Address are updated when the user clicks on an existing white vista point. The document title is also update to reflect the same data as selectedID when an existing point is clicked.

Moving Existing Points

When a user has selected an existing white vista point, if they click somewhere else on the map (not on another existing point), the point location is updated along with associated the hidden form fields.

Development

Execute pnpm start to start a web server and view the website

Test Urls: http://localhost:3000?precinctID=LA23:I-N-&precinct=yes&districts=no&currentX=423283.80&currentY=4549881.24&db=T&map=c&county=6 http://localhost:3000?precinctID=WJD015:00&precinct=yes&districts=no&currentX=420861.16&currentY=4497950.82&query=331035967&db=L&map=c&county=18 Large numbers of features: http://localhost:3000?zip=84050&precinct=yes&districts=no&currentX=-1&currentY=-1&db=T&map=c&county=15

Notes

The current Vista servers are running Windows 7. When I tried upgrading the Esri JS API to 4.12, it caused a bug that prevented any point graphics from being displayed. So until the Vista server OSs are upgraded, the project needs to remain at 4.10.

esri-loader is copied locally so that I could patch it because of CDN/redirect issues. I realized after the fact that I could have just used the url param 🤦. Either way, the issue only seemed to affect v4.10. So when this app is upgraded to another version (see note above), then the patched version of esri-loader can be trashed.

About

Web app that is embedded in the Vista application

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5