POST
|
I am adding widgets to my view like so: view.add(widget1, "top-left");
view.add(widget2, "bottom-right"); I noticed that the widgets on the top regions are stacked vertically and the widgets in the bottom regions are laid out horizontally. You can see a sample here: https://codepen.io/dschontz/pen/zgErxO Questions: Can you set the flow of widgets on a per-region basis? For example, can I have the bottom-right region stack widgets vertically? Can I have a region flow in both directions? For example, a couple widgets horizontally placed in the bottom-right corner, and another 2 widgets placed vertically above them so that they form a kind of "corner" on the map _|.
... View more
08-02-2019
12:25 PM
|
0
|
2
|
2110
|
IDEA
|
Please add an event to the LayerList widget so we can listen for changes to layer visibility. For example, in our applications, we want to save the layer configuration whenever something changes. We expected that the LayerList would notify us of changes to layer visibility, but that is currently not the case. I expect it would look something like so: const list = new LayerList({ view });
list.on('layer-visibility', (layer) => {
if (layer.visible) doSomething();
else doSomethingElse();
});
... View more
05-01-2019
03:30 PM
|
3
|
1
|
511
|
POST
|
I was afraid of that! Thank you for all your help. Yet another reason to upgrade to 4.10.
... View more
01-02-2019
09:44 AM
|
0
|
0
|
187
|
POST
|
Robert, Thank you for the reply. We are currently using ArcGIS 4.8 and cannot upgrade to 4.10 yet, so I tried changing from 4.10 to 4.8 and it stopped working. Interestingly, applyEdits didn't add the points in 4.8, but source = points did work. But the query still returns an error. I wonder if there's a bug in 4.8? CodePen sample of your suggestion in 4.8 using source = points: ArcGIS: queryFeatures - Unsupported query error - 4 wkid 102100 Edit: A quick comparison of featureLayer.capabilities.query in 4.10 and 4.8 show that 4.8 only has supportExtent = true, whereas 4.10 has a more supported queries. I've edited the example to use an extent instead of a geodesic buffer, but the error persists. I've confirmed that both the query and the featureLayer have the same spatialReference.wkid as well.
... View more
12-31-2018
09:40 AM
|
0
|
2
|
1212
|
POST
|
Makes sense. In my particular app I am using wkid 102100. When I convert the plotted points to that spatial reference the query fails again. I am no longer converting the geodesic buffer because my featureLayer and the buffer are both using wkid 102100. CodePen: ArcGIS: queryFeatures - Unsupported query error - 3 wkid 102100 I also came across this: GitHub - Esri/terraformer-arcgis-parser. I don't know if that would be a help in the case where I'm using wkid 102100. Thank you for all of your help.
... View more
12-28-2018
03:20 PM
|
0
|
4
|
1212
|
POST
|
I'll experiment with applyEdits in my actual code to see when it's needed. Is there some documentation on when and where geometry conversion is needed? e.g. query.geometry = wMU.webMercatorToGeographic(geom)
... View more
12-28-2018
09:47 AM
|
0
|
6
|
1212
|
POST
|
Thank you for the reply. That worked! I made the mistake of forking an old CodePen which was not adding the items to the feature layer. My original issue was that the query was not supported. I assume that is because I did not convert the geometry to a geographic one. Once the query was correct, I still would not receive any result if applyEdits is not used, correct? Should I be checking something like layer.capabilities.editing.supportsEditing before attempting to use applyEdits? I received the following warning: "[esri.layers.FeatureLayer]" "FeatureLayer.hasAttachments is deprecated. Use FeatureLayer.capabilities.data.supportsAttachment instead." That is never called explicitly in the code. Is that something that Esri just has not updated internally?
... View more
12-26-2018
05:36 PM
|
0
|
8
|
1212
|
POST
|
I attempted to use FeatureLayerView.queryFeatures(), but the result is the same: ArcGIS: queryFeatures - Unsupported query error - FeatureLayerView A partial response to my original question is that layer.capabilities.query should tell you what kind of queries you can make. I my case, featureLayer.capabilities.query.supportsExtent = true, but the error still persists when I use FeatureLayerView and pass an Extent for the geometry.
... View more
12-26-2018
03:43 PM
|
0
|
10
|
1212
|
POST
|
I am attempting to query some FeatureLayers, but I cannot seem to construct a query that works. If you click on the map in the following demo the promise returns an error: ArcGIS: queryFeatures - Unsupported query error message: "Unsupported query" name: "esri.layers.graphics.QueryEngine" I've tried a number of searches with different geometry types (extent, circle, geodesic buffer). I've also tried center and distance, but they are all unsupported. Question: how can I find out what kinds of queries FeatureLayers support? I have not come across docs that have helped in that regard. Besides my sample FeatureLayer there are other FeatureLayers I will be querying (e.g. remote ones) and I would like to figure out what I can and cannot send in a query. FYI, here is the code: require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/geometry/geometryEngine",
"esri/Graphic",
"esri/layers/GraphicsLayer",
"esri/tasks/support/Query",
"esri/widgets/CoordinateConversion",
"esri/geometry/support/webMercatorUtils",
"esri/geometry/Point",
"dojo/domReady!"
], function(Map, MapView, FeatureLayer, geometryEngine, Graphic, GraphicsLayer, Query, CC, wMU, Point) {
map = new Map({
basemap: "topo-vector"
});
view = new MapView({
container: "viewDiv",
map: map,
center: [-118.739851, 34.090456],
zoom: 14
});
view.ui.add(new CC({ view: view }), 'bottom-right');
featureLayer = new FeatureLayer({
id: 'dots',
title: 'dots on a map',
geometryType: 'point',
objectIdField: 'id',
spatialReference: { wkid: 4326 },
source: [],
fields: [
{
name: 'id',
alias: 'ID',
type: 'oid',
},
{
name: 'mapObject',
alias: 'mapObject',
type: 'object'
}
]
});
map.layers.add(featureLayer);
var circleGraphic;
points = [];
[
'-118.742555, 34.095076',
'-118.747447, 34.094010',
'-118.749593, 34.090811',
'-118.734658, 34.088039',
'-118.736032, 34.091735',
'-118.743070, 34.091096'
].forEach(pair => {
var ll = pair.split(', ');
addPoint(new Point({
type: 'point',
spatialReference: { wkid: 4326 },
x: ll[0],
y: ll[1]
}));
});
view.on('click', function (e) {
var centerPt = e.mapPoint;
if (e.native.ctrlKey) {
// add more points to the map
addPoint(centerPt);
} else {
// search in the clicked area for points
var geom = geometryEngine.geodesicBuffer(centerPt, 400, 'meters');
if (circleGraphic) view.graphics.remove(circleGraphic);
circleGraphic = new Graphic({
geometry: geom,
symbol: {
type: 'simple-fill',
color: [140, 140, 222, 0.5]
}
});
view.graphics.add(circleGraphic);
query = featureLayer.createQuery();
query.geometry = geom;
query.spatialRelationship = 'contains';
featureLayer.queryFeatures(query)
.then(result => {
console.log('This area contains', inPts.length, 'points');
}).catch(error => {
console.error(error);
});
}
});
function addPoint(geo) {
if (geo.spatialReference.isGeographic) {
geo = wMU.geographicToWebMercator(geo);
console.log('converting geography');
}
var pt = new Graphic({
geometry: geo,
symbol: {
type: 'simple-marker',
style: 'circle',
color: 'black',
size: '8px'
}
});
// console.log('adding point at:', pt.geometry.x, pt.geometry.y);
view.graphics.add(pt);
points.push(pt);
}
});
... View more
12-26-2018
02:59 PM
|
0
|
11
|
1851
|
POST
|
Localhost has been whitelisted in 4.9: Release notes for 4.9 | ArcGIS API for JavaScript 4.9
... View more
11-28-2018
09:40 AM
|
2
|
0
|
838
|
POST
|
I were experiencing the same problem, but as this is a customer project I cannot edit HOSTS files to get around the issue. I concur with Vladimir: Vladimir Strinski wrote: There are valid business scenarios when serving and accessing pages and layers via localhost is needed. In such cases HTTP is a good solution. Whitelisting localhost would be nice, but if that is not easily done please please please provide a configuration option that will not automatically upgrade our URLs.
... View more
11-27-2018
09:29 AM
|
0
|
0
|
1783
|
Title | Kudos | Posted |
---|---|---|
3 | 05-01-2019 03:30 PM | |
2 | 11-28-2018 09:40 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|