|
POST
|
Hey Robert; hate to bug I have one last issue I am stuck on with this, wondering if you had any insight -- I am trying to maintain so that the smallest polygons are "on top" of the larger polygons consistently so that they can get clicked on. I've created a separate question here, https://community.esri.com/message/940208-re-reorder-order-smallest-on-top-polygons-in-feature-layer?commentID=940208&et=watches.email.thread#comment-940208 -- I have tried order by query, which updates the checkbox order, but not the drawn order, perhaps it is something with the filter -- btw, I also tried adding the order by clause within the filter as well, no errors, just no affect. It seems to be drawn in arbitrary or random order as sometimes it loads properly and yet sometimes it loads the small polygons buried behind the larger ones where they cannot be clicked.. Anything I could do here? There must be a way.
... View more
07-11-2020
11:40 AM
|
0
|
0
|
390
|
|
POST
|
Here is a better screenshot: For instance, I try to click the green shape in the middle, the largest blue circle highlights and the popup only displays the meta for that one. Cannot click the smaller inner ones. i.e. before click. i.e. after trying to click the green inner small polygon -- only outer is accessible.
... View more
07-11-2020
10:22 AM
|
0
|
2
|
2930
|
|
POST
|
I am not sure the exact interpretation of how ASC or DESC are being used; but I would like the smallest polygons shapes to be added/drawn lastly so that their index remains on top of the larger ones and are clickable. Again, sometimes this occurs with some, but then some don't seems arbitrary -- just want to consistently be able to click all my smaller polygons. Should I explore a different method?
... View more
07-10-2020
06:26 PM
|
0
|
0
|
2930
|
|
POST
|
Thank you for the reply Ken, sadly it still does not seem to be working consistently with that in regards to the overlapping -- also, in the query right before I drew the polygons i stated all * out fields, so shouldn't that work the same? I don't think that was the issue.
... View more
07-10-2020
06:01 PM
|
0
|
0
|
2930
|
|
POST
|
I have tried using the below in my initial query, and query right before drawing my polygons with class breaks. query.orderByFields = ["Shape__Area DESC"]; However this did not seem to do anything. I have also tried using grid_value field as well. You can see in the screenshot a 3.8 grid value polygon overlapping making the inner 6.5 and 7.8 grid_value polygons in accessible to click. Here is my relevant code in which I am querying and then doing the drawing... main problem is occasionally large polygons block out smaller ones.. I can mostly see them, but visibility is not the issue.. I need to be able to click them as well.. if the smaller polygons would draw on top most layer, or even higher grid values on top should solve it. I found orderByFields in the docs but doesn't seem to do anything at all... query.outFields = ["*"];
//query.orderByFields = ["Shape__Area DESC"];
query.returnDistinctValues = false;
query.returnGeometry = true;
QT.execute(query).then(function (evt) {
evt.features.forEach(function (feature) {
var att = feature.attributes
var test = geometryEngine.convexHull(feature.geometry)
var genpoly = null
if (att.grid_value <= 4.0) {
var rad = att.Shape__Length / 75
genpoly = new Circle({
center: test.centroid,
radius: rad,
radiusUnit: "meters"
})
} else {
genpoly = test
}
var polygonGraphic = new Graphic({
geometry: genpoly,
attributes: att,
type: "polygon"
});
gras.push(polygonGraphic);
});
var renderer = {
type: "class-breaks",
field: "grid_value",
classificationMethod: "esriClassifyManual",
classBreakInfos: [{
minValue: 0,
maxValue: 1.9999,
symbol: {
color: [0, 0, 0, 0],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "I (Not Felt)"
},
{
minValue: 2.0,
maxValue: 3.0,
symbol: {
color: [191, 204, 255, .3],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "II (Weak)"
},
{
minValue: 3.1,
maxValue: 3.9,
symbol: {
color: [153, 153, 255, .4],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "III (Weak)"
},
{
minValue: 4.0,
maxValue: 4.5,
symbol: {
color: [136, 255, 255, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "IV (Light)"
},
{
minValue: 4.5,
maxValue: 4.9999,
symbol: {
color: [125, 248, 148, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "V (Light)"
},
{
minValue: 6.0,
maxValue: 6.9999,
symbol: {
color: [255, 255, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VI (Strong)"
},
{
minValue: 7.0,
maxValue: 7.9999,
symbol: {
color: [255, 221, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VII (Very Strong)"
},
{
minValue: 8.0,
maxValue: 8.9999,
symbol: {
color: [255, 145, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VIII (Severe) "
},
{
minValue: 9.0,
maxValue: 9.9999,
symbol: {
color: [255, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "IX (Violent)"
},
{
minValue: 10.0,
maxValue: 10.9999,
symbol: {
color: [221, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "X"
},
{
minValue: 11.0,
maxValue: 11.9999,
symbol: {
color: [136, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "XI"
},
{
minValue: 12.0,
maxValue: 12.0,
symbol: {
color: [68, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "XII"
}
]
}
var popupTrails = {
outFields: ["*"],
"title": "Shake ID: {id}",
"content": function (feature){
let name_plc;
let dlv = document.createElement("div");
dlv.className = "popd";
dlv.innerHTML = `<b><span class='name_plc'></span></b><br>ID: <span class="ida">${feature.graphic.attributes.id}</span><br> URL: <a href="${feature.graphic.attributes.url}" target="_blank">View</a> <br> Updated: ${feature.graphic.attributes.updated} <br>Grid_value: ${feature.graphic.attributes.grid_value}<br> Event Time: ${feature.graphic.attributes.eventTime} <style>.esri-popup__navigation { display: none;}</style>`;
getName();
function getName() {
let cId = $('span.ida').text();
if (cId) {
//console.log(cId);
let q3 = new Query();
q3.where = "id = '"+ cId +"'";
q3.outFields = ["*"];
QTt.execute(q3).then(function (results) {
results.features.map(function (feat) {
let pID = feat.attributes["id"];
if (cId === pID) {
name_plc = feat.attributes["place"];
console.log(name_plc);
let tx = $('.name_plc').text();
if (tx == 0){
$(".name_plc").append(name_plc);
}
}
});
});
} else {
setTimeout(getName, 230);
}
}
return dlv;
},
};
fl = new FeatureLayer({
source: gras,
objectIdField: "ObjectID",
geometryType: "polygon",
fields: [{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}, {
name: "id",
alias: "id",
type: "string"
}, {
name: "updated",
alias: "Last Update",
type: "string"
}, {
name: "eventTime",
alias: "eventTime",
type: "string"
}, {
name: "url",
alias: "url",
type: "string"
}, {
name: "grid_value",
alias: "grid_value",
type: "double"
}],
renderer: renderer,
popupEnabled: true,
//outFields: ['*'],
popupTemplate: popupTrails,
visibleElements: [{
featureNavigation: false,
}],
});
map.add(fl); Here is my full CodePen as well.. Any way to do this client side javascript? simply change index to smallest polygons on top?! 1/3 times some of my polygons render in the correct order.. but I need to ensure they all always do, so they are visible and I can click them.
... View more
07-10-2020
06:46 AM
|
0
|
6
|
3109
|
|
POST
|
I have tried it stand alone like this: myLayer.popupTemplate = { <--- have also tried defining this as popupShake title: function(feature) { let spl = document.createElement("span"); spl.className = "name_plc"; spl.innerHTML = "<span class='name_plc'></span>"; return spl; } }; I have also tried it inline within the popuptemplate call (such as the content section, but title will not run even though documentation states it accepts strings and OR functions). i.e. let popupShake = { outFields: ["*"], "title": function (feature){ <------------- breaks popup, but content below works let spl = document.createElement("span"); spl.className = "name_plc"; dlv.innerHTML = "<span class='name_plc'></span>"; return spl; }, "content": function (feature){ let name_plc; let dlv = document.createElement("div"); dlv.className = "popd"; dlv.innerHTML = `<b><span class='name_plc'></span></b><br>ID: <span class="ida">${feature.graphic.attributes.id}</span><br> URL: <a href="${feature.graphic.attributes.url}" target="_blank">View</a> <br> Updated: ${feature.graphic.attributes.updated} <br>Grid_value: ${feature.graphic.attributes.grid_value}<br> Event Time: ${feature.graphic.attributes.eventTime}`; setTimeout(() => { getName(); }, 20); ................
... View more
07-09-2020
09:29 AM
|
0
|
0
|
705
|
|
POST
|
I was able to achieve this by running another query within 'content' as a function. Not the most elegant, but works.
... View more
07-09-2020
09:28 AM
|
0
|
0
|
1421
|
|
POST
|
I am trying to add one new pop-up field, that comes from a separate rest call, but I am unsure how to incorporate. All my other fields come from this service: https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/USGS_Seismic_Data_v1/FeatureServer/1/ But I need one piece of data from this service, the 'name' as place (which I am getting and using fine, I just can't get it into the pop-up): https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/USGS_Seismic_Data_v1/FeatureServer/0/ With my original query, I add this to get the name (or place) from second service: let plc; ............ QTt.execute(query2).then(function(results) { results.features.map(function(feat) { let magD = feat.attributes["id"]; if (id === magD) { plc = feat.attributes["place"]; ....................... And below is my attempt to call it into the pop-up: function popupContent (feature) { const div = document.createElement('div'); div.innerHTML = "<span class='name_plc'>Name: "+ plc + "</span>"; <------------ attempt return div; } let popuptemp = { title: "Shake Intensity", content: [{ type: "fields", fieldInfos: [{ fieldName: "grid_value", label: "Grid Value" }, { fieldName: "id", label: "id" }, { fieldName: "place", label: "place" }, { fieldName: "ObjectID", label: "ObjectID" }, { fieldName: "url", label: "Url" } ] }] } fl = new FeatureLayer({ source: gras, objectIdField: "ObjectID", geometryType: "polygon", fields: [{ name: "ObjectID", alias: "ObjectID", type: "oid" }, { name: "id", alias: "id", type: "string" }, { name: "place", alias: "place", type: "string" }, { name: "url", alias: "url", type: "string" }, { name: "grid_value", alias: "grid_value", type: "double" } ], renderer: renderer, popupEnabled: true, popupTemplate: popuptemp, content: popupContent, <--- attempt }); app.mapview.map.add(fl);
... View more
07-07-2020
01:05 PM
|
0
|
2
|
1521
|
|
POST
|
Thanks a lot, Robert, very helpful; I did notice the dups and got a fix for that. Will take a look at the update, nailed the issues- however I am a little curious about the query task and new query calls you are doing. How does new query(); uniquely relate to it's call initially? In other words how could I handle two calls, or more? (i.e. the below doing two calls) let QT;
let QTt;
sAta();
function sAta() {
QT = new QueryTask({
url: "https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/USGS_Seismic_Data_v1/FeatureServer/1"
});
QTt = new QueryTask({
url: "https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/USGS_Seismic_Data_v1/FeatureServer/0"
});
//console.log("data");
}
let query = new Query();
console.log(query); <-------- works but only shows first URL response
let query2 = QTt.createQuery();
console.log(query2);
... View more
06-24-2020
03:43 PM
|
0
|
2
|
1577
|
|
POST
|
It looks like it is back up now, the live codepen (with the above code) is here. I prefer the client side filter but have never gotten it to work with my graphic polygons I customized with the 'SeismicData' layer data - I have gotten the filters to work initially with the 'server-side' definitionExpression which is why I was pursuing that one, I just wasnt able to update the id definitionExpression after one was initially called.
... View more
06-23-2020
12:06 PM
|
0
|
4
|
1577
|
|
POST
|
I just noticed it was down again since about 30 minutes ago - I started on ..../mapserver/12/ service for the shake intensities but noticed that was updated as depreciated as of May 2020, the link in that message refereed me to .../featureserver/1/ as the latest recommendation. i.e. https://www.arcgis.com/home/item.html?id=af7568d8579048f7b42e534891824029 -> points to this as new version: https://www.arcgis.com/home/item.html?id=9e2f2b544c954fda9cd13b7f3e6eebce - what other options may I have? The service layer was out completely yesterday for maybe 2 hours, now it looks like the queries or object is stripped (hopefully will resume soon as well, I experienced similar outages from ../mapserver/12/ as well before realizing it was marked depreciated and moving to featureserver/1/)
... View more
06-23-2020
11:00 AM
|
0
|
6
|
1577
|
|
POST
|
I still can't seem to find the correct place to capture my layer view to use for the client side filter; I have tried on 'fl' as well as 'SeismicData' layers. Below is my complete code: (there is no syntax errors, not sure why the editor below is commenting out a closing bracket, the only errors arise are ones referencing the layerview 'eqLayerView' <html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>ArcGIS JavaScript Tutorials: Add layers to a map</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
.contn { position: absolute; bottom: 0px; left: 0px;}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.15/esri/themes/light/main.css">
<script src="https://js.arcgis.com/4.15/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/geometry/geometryEngine",
"esri/geometry/Circle",
"esri/Graphic",
"esri/layers/GraphicsLayer",
"esri/symbols/SimpleFillSymbol",
"esri/renderers/ClassBreaksRenderer",
"esri/widgets/Legend"
], function(
Map,
MapView,
FeatureLayer,
geometryEngine,
Circle,
Graphic,
GraphicsLayer,
SimpleFillSymbol,
ClassBreaksRenderer,
Legend) {
var map = new Map({
basemap: "gray"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-122, 37],
zoom: 2
});
shakeLays();
function shakeLays() {
let selectedID;
let currentShakes;
let SeismicData;
let eqLayerView;
let fl;
fetchdata();
function fetchdata(){
SeismicData = new FeatureLayer({
title: "MMI - Shake Intensity",
url: "https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/USGS_Seismic_Data_v1/FeatureServer/1/",
outFields: ["*"],
});
SeismicData.definitionExpression = "eventTime >= CURRENT_TIMESTAMP - 30 AND grid_value > 2";
//map.add(SeismicData);
};
let quakeFoldr = document.getElementById("Shakemaps").parentElement;
let onup = quakeFoldr.parentElement;
let twup = onup.parentElement;
let idElement = document.createElement("div");
let isElement = document.createElement("ul");
idElement.className += "shaked";
isElement.className += "k-group";
twup.appendChild(idElement);
idElement.appendChild(isElement);
var graphicsLayer = new GraphicsLayer();
function filterByID(event) {
console.log('filter hit');
let sqlExp = '';
let idChkBoxes = document.querySelectorAll(`.id-item`);
idChkBoxes.forEach(function(node){
if(node.checked){
sqlExp += "'" + node.getAttribute("data-id") + "' ";
}
});
sqlExp = sqlExp.replace(/' /g, "', ");
sqlExp = sqlExp.substring(0, sqlExp.length - 2);
//console.info(sqlExp);
// SeismicData.definitionExpression = "id IN (" + sqlExp + ")";
// SeismicData.refresh();
eqLayerView.filter = {
where: "id IN (" + sqlExp + ")"
};
}
view.when(SeismicData).then(function(layerView) {
var query = SeismicData.createQuery();
query.outFields = ["id"];
query.returnDistinctValues = true;
query.returnGeometry = false;
SeismicData.queryFeatures(query).then(function(results){
results.features.map(function(feat){
let id = feat.attributes["id"];
let opt = document.createElement("input");
opt.type = "checkbox";
let label = document.createElement('label')
label.innerHTML = id;
opt.className = "id-item visible-id shakeids";
opt.setAttribute("data-id", id);
opt.name = "shaks";
idElement.appendChild(opt);
idElement.appendChild(label);
getCur(event);
});
view.whenLayerView(SeismicData).then(function(layerView) {
eqLayerView = layerView;
console.log(eqLayerView);
console.log(SeismicData);
// eqLayerView.filter = {
// where: "id = ''"
// };
});
});
function getCur(event) {
let chkst = document.querySelector('.shaked');
if (chkst) {
chkst.addEventListener("click", filterByID);
} else {
getCur();
}
}
SeismicData.queryFeatures().then(function(evt) {
evt.features.forEach(function(feature) {
var att = feature.attributes
var test = geometryEngine.convexHull(feature.geometry)
var genpoly = null
if (att.grid_value <= 4.0) {
var rad = att.Shape__Length / 75
genpoly = new Circle({
center: test.centroid,
radius: rad,
radiusUnit: "meters"
})
} else {
genpoly = test
}
var polygonGraphic = new Graphic({
geometry: genpoly,
attributes: att,
type: "polygon"
});
graphicsLayer.add(polygonGraphic);
});
var renderer = {
type: "class-breaks",
field: "grid_value",
classificationMethod: "esriClassifyManual",
classBreakInfos: [{
minValue: 0,
maxValue: 1.9999,
symbol: {
color: [0, 0, 0, 0],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "I (Not Felt)"
},
{
minValue: 2.0,
maxValue: 3.0,
symbol: {
color: [191, 204, 255, .3],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "II (Weak)"
},
{
minValue: 3.1,
maxValue: 3.9,
symbol: {
color: [153, 153, 255, .4],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "III (Weak)"
},
{
minValue: 4.0,
maxValue: 4.5,
symbol: {
color: [136, 255, 255, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "IV (Light)"
},
{
minValue: 4.5,
maxValue: 4.9999,
symbol: {
color: [125, 248, 148, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "V (Light)"
},
{
minValue: 6.0,
maxValue: 6.9999,
symbol: {
color: [255, 255, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VI (Strong)"
},
{
minValue: 7.0,
maxValue: 7.9999,
symbol: {
color: [255, 221, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VII (Very Strong)"
},
{
minValue: 8.0,
maxValue: 8.9999,
symbol: {
color: [255, 145, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "VIII (Severe) "
},
{
minValue: 9.0,
maxValue: 9.9999,
symbol: {
color: [255, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "IX (Violent)"
},
{
minValue: 10.0,
maxValue: 10.9999,
symbol: {
color: [221, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "X"
},
{
minValue: 11.0,
maxValue: 11.9999,
symbol: {
color: [136, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "XI"
},
{
minValue: 12.0,
maxValue: 12.0,
symbol: {
color: [68, 0, 0, 1],
outline: {
color: [0, 0, 0, 0],
width: 0.4,
type: "simple-line",
style: "solid"
},
type: "simple-fill",
style: "solid"
},
label: "XII"
}
]
}
var popuptemp = {
title: "Shake Intensity",
content: [{
type: "fields",
fieldInfos: [{
fieldName: "grid_value",
label: "Grid Value"
},
{
fieldName: "id",
label: "id"
},
{
fieldName: "ObjectID",
label: "ObjectID"
},
{
fieldName: "url",
label: "Url"
}
]
}]
}
fl = new FeatureLayer({
source: graphicsLayer.graphics,
objectIdField: "ObjectID",
geometryType: "polygon",
fields: [{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
},{
name: "id",
alias: "id",
type: "string"
}, {
name: "url",
alias: "url",
type: "string"
}, {
name: "grid_value",
alias: "grid_value",
type: "double"
}],
renderer: renderer,
popupEnabled: true,
popupTemplate: popuptemp
});
map.add(fl);
console.log(fl);
});
});
}
});
</script>
</head>
<body>
<div id="viewDiv"></div>
<div class="contn">
<div>
<div>
<div id="Shakemaps">Shakemaps</div>
</div>
</div>
</div>
</body>
</html>
... View more
06-23-2020
08:53 AM
|
0
|
8
|
1577
|
|
POST
|
Thanks so much, Robert - I get you on the checkbox looping and building of the string... The problem is my feature layer contains some custom graphics, from some testing I could filter it with the server-side logic 'definationExpression' but was never successful with the more client-side 'using the view' solution as I am passing my initial layer data to some graphics. Will the client side 'view' filter still work in my scenario? Could I build the string like you have above with serverside 'definationExpression'? i.e. below is how I pass my initial feature layer data to some custom graphics in the form of a new layer: graphics = new FeatureLayer({ source: graphicsLayer.graphics, objectIdField: "ObjectID", geometryType: "polygon", fields: [{ name: "ObjectID", alias: "ObjectID", type: "oid" },{ name: "id", alias: "id", type: "string" }, { name: "url", alias: "url", type: "string" }, { name: "grid_value", alias: "grid_value", type: "double" }], renderer: renderer, popupEnabled: true, popupTemplate: popuptemp }); map.add(graphics); }); });
... View more
06-23-2020
07:29 AM
|
0
|
10
|
1577
|
|
POST
|
Thanks, yeah late night typo.. I have edited the above, even with the above corrected the current dilemma persists. Here the question seems clearer: arcgis javascript api - Updating/add to definition expression - Geographic Information Systems Stack Exchange
... View more
06-23-2020
06:20 AM
|
0
|
0
|
2204
|
|
POST
|
i.e. a simple demo logic, where I can't seem to update a definationExpression (add to, remove, re-add as a new), starting with none, here I try to simple add one, console log is fine, just wont seem to take a second instant of. You can see my attempt to refresh() and "" in attempt to add a new. let selectedID; let datA; layer.definitionExpression = "id IN ('')"; <-------- initial state nothing function filterByID(event) { console.log('filter hit'); selectedID = event.target.getAttribute("data-id"); console.log(selectedID); layer.refresh(); layer.definitionExpression = "id IN ('"+ selectedID +"')"; <------- attempt to update/replace with selected id }
... View more
06-22-2020
05:43 PM
|
0
|
14
|
2204
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-17-2020 03:59 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|