Skip to content

Instantly share code, notes, and snippets.

@bmweiner
Created July 17, 2017 22:45
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 bmweiner/1ee40d1455c91d34198f4c2d4a62c50d to your computer and use it in GitHub Desktop.
Save bmweiner/1ee40d1455c91d34198f4c2d4a62c50d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"dojo/domReady!"
], function(Map, MapView, FeatureLayer) {
var map = new Map({
basemap: "topo-vector"
});
var fl = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3",
definitionExpression: "STATE_NAME = 'Montana'"
});
map.add(fl); // adds the layer to the map
var view = new MapView({
container: "viewDiv",
map: map,
center: [-96.6994872,39.2160784],
zoom: 3
});
});</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment