POST
|
Hi Rachael, I forgot I asked this question and added a sample page. I then rewrote my project because I decided that building it from the ground up in javascript was simpler than building with widgets. For others this may not be the case. So, just a warning that test page is not made in app builder. However, What I initially did was create my own widget/tile which I formatted how I wanted with css. I hid the filter widget but could access the values using the css id's. So any changes in my widget would transfer. Then, you can set up an apply button that clicks the widgets apply. It worked, however, it was inconsistent. I found using the javascript definition query was more consistent and performance increased. Which is why that test page is different. I hope this will be some help for you. Good luck with your project.
... View more
10-14-2019
08:43 AM
|
0
|
0
|
1142
|
POST
|
I'm trying to add my own feature layer to the query features from a feature layer. However, when I try, I get a query failed response. I'm not sure what I'm missing. Below are the lines that I've changed. I've attached the working code as well.
const view = new MapView({
container: "sceneDiv",
map: map,
center: [-94.961833, 29.567433],
zoom: 9,
padding: {
right: 300
}
});
const featureLayer = new FeatureLayer({
url: "http://atlas.texascoastalatlas.com/arcgis/rest/services/IkeDike/InundationDamages/FeatureServer/0",
outFields: ["*"],
definitionExpression:"year = 'Present' AND spine = 'False' AND storm = '10' AND slr = 'False'"
});
map.add(featureLayer);
let graphics;
view.whenLayerView(featureLayer).then(function(layerView) {
layerView.watch("updating", function(value) {
if (!value) { // wait for the layer view to finish updating
// query all the features available for drawing.
layerView.queryFeatures({
geometry: view.extent,
returnGeometry: true
}).then(function(results) {
graphics = results;
const fragment = document.createDocumentFragment();
results.forEach(function(result, index) {
console.log("results:", result)
const attributes = result.attributes;
const name = attributes.damages + "all the damage"
Create a list zip codes in NY
const li = document.createElement("li");
li.classList.add("panel-result");
li.tabIndex = 0;
li.setAttribute("data-result-id", index);
li.textContent = name;
fragment.appendChild(li);
});
// // Empty the current list
listNode.innerHTML = "";
listNode.appendChild(fragment);
}).catch(function(e) {
console.error("query failed: ", e);
});
}
});
});
... View more
06-13-2018
11:16 AM
|
0
|
2
|
1476
|
POST
|
I'm glad you suggested that this is more difficult than I would expect. It has been quite frustrating. By the time you answered yesterday I had made some headway. And this morning, I was going to show you where my code was going wrong, and see if you had a better idea.Then I changed one line and fixed it: Test Page (note: not all the data is there so only the first button currently works.) So what I did was add this code to the top of the widget.html and the css from here. <div>
<p> Turn on the coastal spine rise:</p>
<div class="Spineonoffswitch">
<input type="checkbox" name="Spineonoffswitch" class="Spineonoffswitch-checkbox" id="Spinemyonoffswitch" data-dojo-attach-event="ondijitclick:_onClickSpine">
<label class="Spineonoffswitch-label" for="Spinemyonoffswitch">
<span class="Spineonoffswitch-inner"></span>
<span class="Spineonoffswitch-switch"></span>
</label> And then the following code after the style on the widget.js file. _onClickSpine: function() {
var SLR = document.getElementById("dijit_form_ValidationTextBox_0");
if (SLR.value === "True"){
SLR.value = "False";
} else{ SLR.value = "True";
}
document.getElementById("dijit_form_ValidationTextBox_0").value = SLR.value;
document.getElementsByClassName("header")[0].click();
I then hid all of the original text boxes using css: visibility: hidden; Which allows me to use the boxes still but not see them. Its not optimal, but it seems to work.
... View more
10-17-2017
08:42 AM
|
1
|
2
|
1142
|
POST
|
I have one filter that I would like to add to a web map. It will filter one file, but has four options, three which are binary. While one has 4 options. I'd prefer for the filter to have buttons instead of drop downs since most of the options are binary. And perhaps a slider for the last option. Would turn into : I'm struggling to tweak the final interface to look how I want. Initially, I wanted to just hide the actual filters, and create my own buttons and use Javascript to change the drop downs to preconfigured values. I tried adding this into the widget.html file but can't seem to pass working javascript through the widget. Does anybody have any better ideas how I can configure this?
... View more
10-16-2017
11:13 AM
|
0
|
4
|
1583
|
DOC
|
Yup, that fixed it. Thank you for taking you time to help me this morning! Its greatly appreciated.
... View more
07-23-2015
07:15 AM
|
0
|
0
|
3237
|
DOC
|
Oops sorry I had not uploaded it to the server I was using the app builder. Its now updated through that link.
... View more
07-23-2015
06:48 AM
|
0
|
0
|
3237
|
DOC
|
Thanks for the response. I tried turning off the AutoZoom feature. It still is having the same issues.
... View more
07-23-2015
06:35 AM
|
0
|
0
|
3237
|
DOC
|
Hi Robert, I'm having trouble with your e-search widget. I have several features that I have set up queries. They are all designed so that results are added as a layer, and it should open the attribute table. Some of the queries won't show up in either. You can see in my page below. Two examples are Property Values (tract) which works as it should, while the Habitat Priority does not. https://newcoastalatlas.tamug.edu/javamap/index.html I'm not sure why this is occurring. Thanks Will Update: it looks like the console error I'm getting "results.features.geometry is null"
... View more
07-22-2015
09:27 AM
|
0
|
0
|
3237
|
Title | Kudos | Posted |
---|---|---|
1 | 10-17-2017 08:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|