JSFiddle - React, Tailwind, and code Playground
by Alex Azuero
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Selection with query geometry from another task (GP result)</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.27/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.27/esri/css/esri.css">
<style>
html, body {
padding:0;
margin:0;
height:100%;
}
#mapDiv {
height: 500px;
}
</style>
<script src="https://js.arcgis.com/3.27/"></script>
<script>
var map, censusBlockPointsLayer, query;
require([
"esri/map", "esri/InfoTemplate",
"esri/graphic", "esri/layers/FeatureLayer",
"esri/tasks/query", "esri/tasks/QueryTask",
"esri/tasks/Geoprocessor", "esri/tasks/FeatureSet",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol", "esri/config",
"esri/Color", "dojo/dom", "dojo/domReady!"
], function(
Map, InfoTemplate,
Graphic, FeatureLayer,
Query, QueryTask,
Geoprocessor, FeatureSet,
SimpleMarkerSymbol, SimpleFillSymbol,
SimpleLineSymbol, esriConfig,
Color, dom
) {
esriConfig.defaults.io.proxyUrl = "/proxy/";
esriConfig.defaults.io.alwaysUseProxy = false;
map = new Map("mapDiv", {
basemap: "streets",
center: [-95.249, 38.955],
zoom: 14
});
//listen for when map is loaded and then add query functionality
map.on("load", initFunctionality);
censusBlockPointsLayer = new FeatureLayer("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0", {
mode: FeatureLayer.MODE_SELECTION,
infoTemplate: new InfoTemplate("Block: ${BLOCK}", "${*}"),
...