POST
|
If you try to apply an edit in this esri sample: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=editing-applyedits Observe the network request, it returns a 502 code. Here is an example fetch request that should work: fetch("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/IncidentsReport/FeatureServer/0/applyEdits", {"credentials":"omit","headers":{"content-type":"application/x-www-form-urlencoded"},"referrer":"https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=editing-applyedits","referrerPolicy":"no-referrer-when-downgrade","body":"f=json&deletes=42558","method":"POST","mode":"cors"}); It returns a 502 error for some reason. What am I doing wrong? Or is this a bug?
... View more
06-19-2019
11:04 AM
|
0
|
9
|
990
|
POST
|
I am just wondering why all features aren't shown in my example. I haven't set any definitionExpression or feature reduction properties. Shouldn't all points be shown?
... View more
06-18-2019
09:52 AM
|
0
|
1
|
2216
|
POST
|
I still don't understand this behavior. Does anyone have any ideas?
... View more
06-18-2019
08:17 AM
|
0
|
3
|
2216
|
POST
|
I am trying to allow users of my site to add a point using the Draw tool. When trying to add a point, I have noticed that the "draw-complete" event is firing about 250 milliseconds - second behind the native document event document.getElementById("viewDiv").onclick Here is a simple jsbin that shows the delay: jsbin Here is a GIF showing the problem that I am seeing. My clicks are highlighted in yellow. As you can see, it takes a fair bit of time for the "draw-complete" event to fire.
... View more
06-05-2019
10:58 AM
|
0
|
0
|
385
|
POST
|
Yep. The service is published with the popup template in the renderer already. See this link: https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/ACS_Poverty_by_Age_Boundaries/FeatureServer/1 Notice this text: HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText This means that the popup was configured on the server when the service was published. The other layer doen't have that setup: HTML Popup Type: esriServerHTMLPopupTypeNone Here is the rest feature service documentation on HTML server popups: https://developers.arcgis.com/rest/services-reference/html-popup-feature-service-.htm
... View more
05-31-2019
11:21 AM
|
2
|
0
|
710
|
POST
|
It isn't working because your different layer doesn't have it's popupTemplate defined. Here is an example log of a graphic produced from the hit test: Notice how the popupTemplate property is null? It needs to be defined to show up in the feature widget. Check out this jsbin. I have modified your original example: https://jsbin.com/nijarebega/edit?html,output
... View more
05-30-2019
03:16 PM
|
2
|
2
|
710
|
POST
|
Agreed. This does look like a bug. Not sure about a work around other than reverting to 4.10
... View more
05-30-2019
03:00 PM
|
0
|
0
|
265
|
POST
|
Here is another example: https://jsbin.com/qagezumixa/edit?html,output I am querying both the layerview and the feature layer itself. My main question is, why aren't these values the same? It appears that all of the points aren't actually being drawn for some reason. Thanks for your response.
... View more
05-30-2019
02:39 PM
|
0
|
5
|
2216
|
POST
|
Egge-Jan, Thanks for your response. I understand that I could query the featureLayer to get the correct count, however I would prefer not to make an additional server request if possible. At least some of the points have been requested and drawn on the map. It would be nice if there was a way to query and only get the points that haven't been drawn / received already. Not sure if what I am talking about makes a lot of sense. Maybe instead, if there was a way to ensure that all points were drawn in the first place. Why is the api not showing all points?
... View more
05-30-2019
09:25 AM
|
0
|
7
|
2216
|
POST
|
Hey Vincent, Have you looked into ESRI's Rest JS library? It is useful when you don't necessarily need to show a map. You could do something like this to fetch all of the features quickly: https://jsbin.com/sehunejone/edit?html,output <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>ArcGIS REST JS - AMD</title> </head> <body> Open your console to see the demo. </body> <script src="https://unpkg.com/@esri/arcgis-rest-request@2.0.3/dist/umd/request.umd.js"></script> <script src="https://unpkg.com/@esri/arcgis-rest-feature-layer@2.0.3/dist/umd/feature-layer.umd.js"></script> <script> var url = "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/earthquakes_geojson/FeatureServer/0"; async function GetRecordCount() { var { count } = await arcgisRest.queryFeatures({ url: url, returnCountOnly: true }); return count; } async function GetData() { let numRecords = await GetRecordCount(); let promises = []; let data = []; const maxRecordCount = 1000; for (var i = 0; i < numRecords; i += maxRecordCount) { let q = arcgisRest.queryFeatures({ url: url, resultOffset: i, resultRecordCount: maxRecordCount }); promises.push(q); } let dataArr = await Promise.all(promises); for (const res of dataArr) { data = data.concat(res.features); } return data; } var t0 = performance.now(); GetData().then(function(res) { var t1 = performance.now(); console.log("Query took " + Math.floor(t1 - t0) + " milliseconds."); console.log(res); }) </script> </html>
... View more
05-29-2019
10:37 AM
|
2
|
1
|
1907
|
POST
|
When running queryFeatures on a FeatureLayerView, only the features that are currently in the extent are returned. Is there any way to query for all graphics that have been drawn / downloaded from the server? I would like to be able to get statistics on a large area even if the user is zoomed in and only looking at a few features. I don't want to make any more server / rest endpoint requests, this becomes too slow. Here is a jsbin that logs the number of features to demonstrate what I am talking about. https://output.jsbin.com/jojonuhehi Thanks.
... View more
05-29-2019
10:03 AM
|
0
|
9
|
3002
|
POST
|
Why do the popup action buttons overlap the feature navigation arrows? This looks like a bug to me. Why i try to navigate between the two popups in the sample below, it zooms to the feature instead. Try clicking so that multiple features are selected in this sample: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popup-actions
... View more
05-29-2019
09:50 AM
|
0
|
1
|
500
|
POST
|
Why do the popup action buttons overlap the feature navigation arrows? This looks like a bug to me. Try clicking so that multiple features are selected in this sample: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popup-actions
... View more
05-29-2019
09:48 AM
|
0
|
1
|
1559
|
POST
|
One thing you can do to slightly improve performance is to make sure all of your requests aren't waiting for the previous query to finish before they run. You can change the doWork function to something like this: async function doWork(promiseFunctions) { var promises = []; for (var func of promiseFunctions) { promises.push(func()); } var results = []; for (var result of await Promise.all(promises)) { results = results.concat(result.features); } return results; } This way, you are awaiting all of the promises at once instead of doing them in order and having to await each one.
... View more
05-29-2019
09:03 AM
|
1
|
3
|
1907
|
POST
|
This is what we have done to limit panning outside of a certain extent. It definitely seems like a work around. But it works for us. const maxExtent = new Extent({ xmax: -12014182, xmin: -12867508, ymax: 4497591, ymin: 3571786, spatialReference: 102100 }); view.watch('extent', function(extent) { let currentCenter = extent.center; if (!maxExtent.contains(currentCenter)) { let newCenter = extent.center; if (currentCenter.x < maxExtent.xmin) { newCenter.x = maxExtent.xmin; } if (currentCenter.x > maxExtent.xmax) { newCenter.x = maxExtent.xmax; } if (currentCenter.y < maxExtent.ymin) { newCenter.y = maxExtent.ymin; } if (currentCenter.y > maxExtent.ymax) { newCenter.y = maxExtent.ymax; } let newExtent =view.extent.clone(); newExtent.centerAt(newCenter); view.extent = newExtent; } });
... View more
05-29-2019
08:48 AM
|
1
|
1
|
302
|
Title | Kudos | Posted |
---|---|---|
1 | 10-11-2019 10:42 AM | |
2 | 05-29-2019 10:37 AM | |
1 | 07-31-2019 09:53 AM | |
1 | 05-29-2019 08:48 AM | |
1 | 10-11-2019 10:41 AM |
Online Status |
Offline
|
Date Last Visited |
04-29-2022
11:52 AM
|