|
POST
|
Kelly, Yes, that makes more sense. Try this JS Bin - Collaborative JavaScript Debugging, it is not exactly what you are looking for. This script does what you want in reverse. Try this code. I am not sure what you service areas are but this might work. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Select with feature layer</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.12/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.12/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding: 0;
margin: 0;
height: 100%;
}
#messages{
background-color: #fff;
box-shadow: 0 0 5px #888;
font-size: 1.1em;
max-width: 15em;
padding: 0.5em;
position: absolute;
right: 20px;
top: 20px;
z-index: 40;
}
</style>
<script src="http://js.arcgis.com/3.12/"></script>
<script>
var map;
require([
"esri/map", "esri/layers/FeatureLayer", "esri/layers/GraphicsLayer",
"esri/tasks/query", "esri/geometry/Circle",
"esri/graphic", "esri/InfoTemplate", "esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer",
"esri/config", "esri/Color", "dojo/dom", "dojo/domReady!"
], function(
Map, FeatureLayer, GraphicsLayer,
Query, Circle,
Graphic, InfoTemplate, SimpleMarkerSymbol,
SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer,
esriConfig, Color, dom
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [-95.249, 38.954],
zoom: 16,
slider: true
});
var censusPoints = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/1",{
infoTemplate: new InfoTemplate("Block: ${BLOCK}", "${*}"),
mode: FeatureLayer.MODE_SELECTION,
outFields: ["POP2000","HOUSEHOLDS","HSE_UNITS", "TRACT", "BLOCK"]
});
var censusBlocks = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0");
var censusBlocksGL = new GraphicsLayer();
var bSymbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([247, 34, 101, 0.9]),
1
),
new Color([247, 34, 101, 0.3])
);
// selection symbol used to draw the selected census block points within the buffer polygon
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([247, 34, 101, 0.9]),
1
),
new Color([207, 34, 171, 0.5])
);
censusPoints.setSelectionSymbol(symbol);
map.addLayers([censusPoints, censusBlocks, censusBlocksGL]);
censusBlocks.on("click", function(e){
censusBlocksGL.clear();
//select point features within the clicked census block
if(e.graphic && e.graphic.geometry){
var gra = new Graphic(e.graphic.geometry, bSymbol);
censusBlocksGL.add(gra);
var query = new Query();
query.geometry = e.graphic.geometry;
censusPoints.selectFeatures(query);
}
});
});
</script>
</head>
<body>
<span id="messages">Click on the map to select census block points within the group.</span>
<div id="mapDiv"></div>
</body>
</html> If this does not work I might be able to find more examples.
... View more
04-28-2015
11:16 AM
|
2
|
0
|
877
|
|
POST
|
Kelly, I am confused exactly what you are looking for. What is being filtered by a click? Are you looking for related fields?
... View more
04-28-2015
10:38 AM
|
0
|
2
|
877
|
|
POST
|
Clinton, There are 5 samples widgets already downloaded with Developer edition. These can be found here: (your save location)\arcgis-web-appbuilder-1.1\client\stemapp\widgets\samplewidgets I am using the CustomWidgetTemplate for my custom widget.
... View more
04-28-2015
07:24 AM
|
4
|
2
|
1080
|
|
POST
|
Mark, Can you post a link to your app so we can look at it?
... View more
04-27-2015
03:27 PM
|
2
|
1
|
1549
|
|
POST
|
Chad, The LayerList Widget's code for check boxes can be found in the LayerListView.js and Setting.js I don't know how difficult it would be but there is where I would look first. Both scripts use this: 'dijit/form/CheckBox'
... View more
04-27-2015
02:27 PM
|
0
|
0
|
634
|
|
POST
|
Josh, The layers need to have a popup configured in the Arcgis Online map that you are using. All the configurations from AGOL should carry over to AppBuilder. After they are configured you should be able to select a feature and get a resulting popup.
... View more
04-27-2015
02:23 PM
|
1
|
1
|
629
|
|
POST
|
Here is an updated video for WAB 1.1: Customizing and Extending
... View more
04-27-2015
12:10 PM
|
4
|
0
|
1828
|
|
BLOG
|
Josh White, Yes you can use the script (it is mostly all from Esri JavaScript Samples) and not flex though. Open the map, right click on the View Page Source option (in chrome). The result will show my script. I did not really use any outside scripts for this webapp. Michael Jenkins, I agree that is an issue, this year we are getting 2-4 terabytes of storage added. That will mean we will be able to create those cashes to zoom in as far as the aerial photo.
... View more
04-27-2015
07:42 AM
|
0
|
0
|
868
|
|
POST
|
Robert Scheitlin, GISP I believe this will work. I am going to make the buttons drop lists that way two can be selected at once.
... View more
04-24-2015
09:41 AM
|
0
|
7
|
1520
|
|
BLOG
|
I just recreated my Cemetery App. The last version did not use AMD style JavaScript. This made my old script really long, ugly, and bulky. Old version New version I have been able to add more features to my current version because ESRI was converting to AMD when I started so I got my original code. This has become my favorite app. I taught myself (mostly) JavaScript during the time it took me to write the app. My initial app took about 5 months to complete. Part of the process was updating our 19 thousand graves. CREATION I based my script off of the DataGrid JavaScript template. I then added in custom basemap switcher, location, home, help, and other features. During the winter I added a script to make snow fall across the webapp. MOBILE This app is also designed (sorta) for mobile. The main page will automatically direct you to "mobile" version. To only major differences are the size and ability to zoom in. The ability to find your location while out at a cemetery is important. Trying to find a headstone can be difficult. We are also in the process of updating/taking photos of every headstone. Right now we have over 4500. USE The Cemetery application helps residents find family and friends located in any of the cities cemeteries. Click on the Search Options Pane. In the text box, input the First Name, Last Name, Year of Death, or Year of Birth of the Person of Interest. Only one name or date can be searched for at one time. Click Search. All records that contain the search parameters are displayed down below. Click on any part of the row of the desired person. The map will automatically zoom to the desired plot. Click on the highlighted plot (if two or more are in view pick the center most plot or keep clicking until desired name is found). Information about the plot will be displayed. application helps residents find family and friends located in any of the cities cemeteries. If you have questions or suggestions for the cemetery app please contact me at: fiter (at) ashland.or.us UPDATE: In 2019 I have updated this site once again. This time using the WAB developer edition. -- Rickey, GIS Analyst City of Ashland, Public Works 20 East Main Street, Ashland OR 97520
... View more
04-24-2015
08:23 AM
|
4
|
5
|
1763
|
|
POST
|
What I am really trying to do is change this JSFiddle so that this works: on(node, "click", function (e) {
switch (e.srcElement.value) {
case "EastCoast":
this.defExp = " SUB_REGION='East North Central' AND STATE_NAME IN( 'New York', 'New Jersey', 'Delaware')";
break;
case "ENCentral":
defExp = "SUB_REGION='East North Central'";
break;
case "Pacific":
this.defExp2 ="SUB_REGION='Pacific'";
break;
case "Clear":
defExp = "";
break;
case "SQMI":
defExp2 = "SQMI>20000";
break;
case "AVE_FAM_SZ":
defExp2 = "AVE_FAM_SZ<3";
break;
case "PopMil":
defExp2 = "POP2007>1000000";
break;
}
states.setDefinitionExpression(defExp + " and " + defExp2);
});
... View more
04-24-2015
07:10 AM
|
0
|
11
|
1520
|
|
POST
|
I have tried that but then it says defExp2 is not defined.
... View more
04-23-2015
03:17 PM
|
0
|
13
|
1520
|
|
POST
|
I am looking for a way to add two variables together into a string. My two variables are var defExp = "SUB_REGION='East North Central'";
var defExp2 = "STATE_NAME IN( 'New York', 'New Jersey', 'Delaware')"; I need them to stay separate until they are in: states.setDefinitionExpression(defExp OR defExp2); I know this works: var defExp = "SUB_REGION='East North Central' OR STATE_NAME IN( 'New York', 'New Jersey', 'Delaware')";
states.setDefinitionExpression(defExp); But I need two separate variables. Thank you
... View more
04-23-2015
02:45 PM
|
0
|
15
|
5902
|
|
POST
|
Matthew Starry, I would try Tips and Observations for getting Web AppBuilder - Developer Edition Installed written by Rebecca Strauch.
... View more
04-22-2015
01:52 PM
|
1
|
2
|
1743
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:53 PM | |
| 1 | 08-24-2022 09:40 AM | |
| 1 | 07-19-2018 04:41 PM | |
| 1 | 04-05-2024 03:12 PM | |
| 1 | 07-04-2024 11:42 AM |