|
POST
|
Robert, Right now my code: //setup click event for buttons
query("select").forEach(function (node) {
on(node, "click", function (e) {
var target = e.target || e.srcElement;
switch (target.value) {
case "0":
defExp = "crime ='Larceny/Theft'";
break;
case "1":
defExp = "crime ='Vehicle Theft'";
break;
case "2":
defExp ="crime ='Assult'";
break;
case "6":
defExp ="crime ='Other'";
break;
case "7":
defExp ="crime ='DUII'";
break;
case "8":
defExp ="crime ='Fraud'";
break;
case "9":
defExp ="crime ='Burglary'";
break;
case "Clear":
defExp = "";
break;
case "3":
defExp2 = "Month='August'";
break;
case "4":
defExp2 = "Month='July'";
break;
case "5":
defExp2 = "Time_1 >= '1:00' AND Time_1 <= '5:00'";
break;
case "Clear2":
defExp2 = "";
break;
}
var fDefExpr = (defExp !== "") ? ((defExp2 !== "") ? defExp + " AND " + defExp2 : defExp) : ((defExp2 !== "") ? defExp2 : "");
lLayer.setDefinitionExpression(fDefExpr);
console.log((defExp !== "") ? ((defExp2 !== "") ? defExp + " AND " + defExp2 : defExp) : ((defExp2 !== "") ? defExp2 : ""));
}); I have two drop downs that can be chosen from. I am looking for three options that can be used together or independently. Basically adding a defExp3 Thank you!
... View more
05-29-2015
09:25 AM
|
0
|
3
|
1326
|
|
POST
|
I am writing a filter widget. Based on Crime Mapper I need advice on how to proceed with my widget. A demo of what my widget does (not the current version) filter demo Application. EDIT: Version 2 Filter Demo2 I used the local Layer widget and added some of my own code. At this point the widget will apply a definition expression to the layers that have been configured when setting up the widget. The user can then update the expression with pre defined values. The problem is that one definition is applied to all layers. And it is also not easy to configure. Right now to configure the definition expression someone has to open the widget.js file and update this: javascript //setup click event for buttons
query("select").forEach(function (node) {
on(node, "click", function (e) {
var target = e.target || e.srcElement;
switch (target.value) {
case "0":
defExp = "crime ='Larceny/Theft'";
break;
case "1":
defExp = "crime ='Vehicle Theft'";
break;
case "2":
defExp ="crime ='Assult'";
break;
case "6":
defExp ="crime ='Other'";
break;
case "7":
defExp ="crime ='DUII'";
break;
case "8":
defExp ="crime ='Fraud'";
break;
case "9":
defExp ="crime ='Burglary'";
break;
case "Clear":
defExp = "";
break;
case "3":
defExp2 = "Month='August'";
break;
case "4":
defExp2 = "Month='July'";
break;
case "5":
defExp2 = "Time_1 >= '1:00' AND Time_1 <= '5:00'";
break;
case "Clear2":
defExp2 = "";
break;
}
var fDefExpr = (defExp !== "") ? ((defExp2 !== "") ? defExp + " AND " + defExp2 : defExp) : ((defExp2 !== "") ? defExp2 : "");
lLayer.setDefinitionExpression(fDefExpr);
console.log((defExp !== "") ? ((defExp2 !== "") ? defExp + " AND " + defExp2 : defExp) : ((defExp2 !== "") ? defExp2 : ""));
});
}); html <div>
</center> Crime:
<select id="s5" data-dojo-id="s5" data-dojo-attach-point="test" data-dojo-type="dijit/form/Select" data-dojo-props='name:"s5", onChange: myOnClick'>
<option value="0" selected="selected">Larceny/Theft</option>
<option value="1">Vehicle Theft</option>
<option value="2">Assult</option>
<option value="6">Other</option>
<option value="7">DUII</option>
<option value="8">Fraud</option>
<option value="9">Burglary</option>
<option value="" disabled="true">----------</option>
<option value="Clear">All</option>
</select>
</br> Month:
<select id="s12" data-dojo-id="s12" data-dojo-attach-point="s12" data-dojo-type="dijit/form/Select" onclick="" data-dojo-props='name:"s12"'>
<option value="3">August</option>
<option value="4">July</option>
<option value="5">6am-1pm</option>
<option value="" disabled="true">----------</option>
<option value="Clear2" selected="selected">All</option>
</select>
</br>
</br>
</br>
<div><span id="cmap_info" class="textshadow round shadow" style="background-color:#222;color:#fff;font-size:16px;text-align:center;padding:5px 10px;z-index:99;"> Loading ..... </span>
</div>
</div> I am looking for a way to allow the person who configs the widget to edit either a json page in the config set up page and change what features and attributes to be filtered. Do you have any advice on how this could be handled or how to proceed? Thank you
... View more
05-29-2015
09:18 AM
|
0
|
4
|
5618
|
|
POST
|
Stan, Yes I am using same concept as the local layer widget to load the layer.
... View more
05-29-2015
06:09 AM
|
0
|
0
|
2170
|
|
POST
|
I am adding a layer when a widget loads. I am trying to have popups enabled when it loads. I cannot find the script to enable popup on load. I hope this is an easy option.
... View more
05-28-2015
02:45 PM
|
1
|
3
|
6772
|
|
POST
|
Yes it is possible. What I did was: Put this in widgets/About/style.css #about_panel{
height: 250px !important;
} This has to be done for each widget individually.
... View more
05-28-2015
11:37 AM
|
1
|
3
|
2180
|
|
POST
|
I am looking for some script that will count the number of features on the map and display it. I am thinking something like this: Crime Mapper I need this to change every time the filter changes.
... View more
05-28-2015
10:02 AM
|
0
|
14
|
8408
|
|
POST
|
I cannot mark one as correct, they both were helpful! How would I add to the script to show the number of states visible?
... View more
05-28-2015
08:49 AM
|
0
|
0
|
1326
|
|
POST
|
David, Look at this post: CAD to GIS The post describes how I georeference cad drawings.
... View more
05-28-2015
08:23 AM
|
0
|
0
|
5300
|
|
POST
|
Stan McShinsky, Here you go ArcGIS Web Application Type in any organizational password and it should work. If it does not I will change the basemap. It needs a lot of work and this is just a demo I came up with. I am working on a filter for crime data and will post that later today (I hope). Just open the widget to load the layer.
... View more
05-28-2015
07:36 AM
|
1
|
9
|
4744
|
|
POST
|
I was blocking cookies and it would not load. I got it to load now
... View more
05-28-2015
06:32 AM
|
0
|
0
|
2282
|
|
POST
|
Derek, The link of live sites does not work for me.
... View more
05-28-2015
06:10 AM
|
0
|
2
|
2282
|
|
POST
|
I sort of have one. I have a working version but data is confidential. I need to make another one (tomorrow) that I can show you. Right now it works on one attribute but I have the code ready for two or more.
... View more
05-27-2015
03:16 PM
|
1
|
10
|
4744
|
| 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 |