Skip to content

Instantly share code, notes, and snippets.

@TheMapSmith
Created May 10, 2018 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheMapSmith/203a2fca7e24e3f34684e3ebe8b266a7 to your computer and use it in GitHub Desktop.
Save TheMapSmith/203a2fca7e24e3f34684e3ebe8b266a7 to your computer and use it in GitHub Desktop.
Culverts Inspected in 2018
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Culverts Inspected - 2018</title>
</head>
<body>
<div class="stats">
<h1>Culverts Inspected in 2018:</h1>
<h1 id="2018-count"></h1>
</div>
<!-- require polyfills for fetch and Promise from https://polyfill.io -->
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=es5,Promise,fetch"></script>
<!-- require ArcGIS REST JS libraries from https://unpkg.com -->
<script src="https://unpkg.com/@esri/arcgis-rest-request@1.1.2/dist/umd/arcgis-rest-request.umd.js"></script>
<script>
const featureQueryUrl = 'https://maps.vtrans.vermont.gov/arcgis/rest/services/AMP/Asset_SmallCulvertInventory_Data/FeatureServer/0/query?where=LAST_INSPECTION_DATE+%3E+timestamp+%272018-01-01+00%3A00%3A00%27&returnCountOnly=true'
// when including ArcGIS REST JS all exports are available from an arcgisRest global
arcgisRest.request(featureQueryUrl).then(response => {
console.log(response);
document.getElementById("2018-count").innerHTML = response.count
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment