|
POST
|
I haven't started using await yet but if I get a chance I'll try this out and see if I can replicate this issue. Promises returned by the JS API tend to be a little different from the standard JS promises and this could possibly be related to this issue (the type is IPromise, based on dojo/deferred): jsapi-resources/arcgis-js-api.d.ts at master · Esri/jsapi-resources · GitHub
... View more
06-20-2017
04:28 PM
|
0
|
0
|
1061
|
|
POST
|
You'll have fewer dependence this way, since you'll only be loading only the modules you need. I imagine using the older style, you're loading everything, even if you're only using a small number of classes.
... View more
06-20-2017
04:18 PM
|
0
|
0
|
1699
|
|
POST
|
I mean, is markers a JSON array? It seems to me that you want to convert var markers into an array of Graphics, but I don't know how to approach that unless I know the shape of the JSON.
... View more
06-20-2017
09:55 AM
|
1
|
7
|
2950
|
|
POST
|
What is the value of var markers = JSON.parse('<%=ConvertDataTabletoString() %>');
... View more
06-20-2017
09:40 AM
|
0
|
9
|
2950
|
|
POST
|
It looks to me like this code is converting stuff in your database to JSON. Once you've done this and sent the resulting JSON to the client, you need to convert it from JSON into instance of Esri JS API classes. This is done by passing the JSON to a constructor like var graphic = new Graphic(<Esri Graphic JSON>); Then the graphic(s) can be added to the map. You can't add raw JSON to the map.
... View more
06-20-2017
09:02 AM
|
0
|
11
|
2950
|
|
POST
|
I'm not sure if it will be included in 4.4 (but I doubt it). Please note that you can use labels in MapViews for MapImageLayers: ArcGIS API for JavaScript Sandbox
... View more
06-20-2017
06:29 AM
|
0
|
0
|
777
|
|
POST
|
It looks to me like the renderer JSON is not automatically being used to construct a new instance of esri/renderers/SimpleRenderer. This needs to happen (although technically you may be able to add a .getSymbol function to your renderer JSON and have it work fine, I would not recommend this). I'm not sure if it matters whether you make the call to create a new renderer or if the API is smart enough to recognize that it needs to make the call. If you're starting from JSON, you can use SimpleRenderer.fromJSON(<renderer JSON>) in the 4.XX API or new SimpleRenderer(<renderer JSON>) in the 3.XX API.
... View more
06-20-2017
05:58 AM
|
0
|
0
|
1063
|
|
POST
|
Try adding a return to the function body, like: gIntersects = allPolygons.filter(function (graphic) { return geometryEngine.intersects(graphic.geometry, parcelGeometry) }); ES6 has the concept of implicit returns if you keep your function on one line without curly braces.
... View more
06-19-2017
04:17 PM
|
1
|
1
|
4398
|
|
POST
|
Interesting solution, if it works I'd go with it. Another option would be to use a debounce function. So each time the zoom changes that function would be called but the actual logic would be delayed until the function hasn't been called in some user defined amount of time (maybe 200 ms would be good for something like this). I always copy the underscore.js debounce function when I need this: underscore.js
... View more
06-19-2017
01:10 PM
|
1
|
2
|
7199
|
|
POST
|
Check out: Legend | API Reference | ArcGIS API for JavaScript 4.3
... View more
06-19-2017
01:06 PM
|
0
|
4
|
1785
|
|
POST
|
Whenever I've had to join two tables, I set up the join in arcmap, and then I queried for related records in the browser. My recollection is that the relationship has to be set on the service, and once that's been set, then the browser can query based on that relationship. I don't remember the exact details of this process, but it wouldn't surprise me if there's no way to perform a join from the browser alone.
... View more
06-19-2017
10:28 AM
|
0
|
0
|
836
|
|
POST
|
Okay, you should be able to manually query the feature service for graphics (which will include attributes). I would load all features when the page loads and then query against those features based on the user input later. Revised sample: // do this on page load
let featureLayer = new FeatureLayer({
url: <FeatureLayer URL>,
outFields: ["*"]
});
let allPolygons = [];
featureLayer.load().then(fl => {
featureLayer.queryFeatures().then(results => {
allPolygons = results.features;
});
});
// call this when user submits polygon to query against all other
// polygons
function findPolygons(searchPolygon, graphics){
// if there's no graphics then there are no intersections
if (graphics.length === 0) return [];
// test each of them using geometryEngine.intersects against the search polygon
return graphics.filter(graphic => geometryEngine.intersects(graphic.geometry, searchPolygon));
} I should mention that if the graphics returned by the manual query don't have attributes, you may have to pass in a Query to queryFeatures. The query needs a .where of "1=1" and an outFields of "*." Let me know if you run into difficulties with that.
... View more
06-19-2017
10:16 AM
|
2
|
3
|
4398
|
|
POST
|
Are you using the 4 or 3 API? Here's a function you could use in the 4 API: function findPolygons(searchPolygon, layer, view){
// get layerView, this contains the client-side graphics
let layerView = view.allLayerViews.find(lv => lv.layer === layer);
// if there's no layerview then there are no intersections
if (!layerView) return [];
// get all features in the client in the specified layer
// test each of them using geometryEngine.intersects against the search polygon
return layerView.loadedGraphics.filter(graphic => geometryEngine.intersects(graphic, searchPolygon)).toArray();
} This will return an array of graphics, which will have the attributes. It should be somewhat similar for 3.X, you'll also want to use the geometryEngine.intersects method. There's not concept of a layerView in 3.X though, so you'll access the graphics in the client differently.
... View more
06-19-2017
09:23 AM
|
2
|
6
|
4398
|
|
POST
|
Here are some URLs that demonstrate the issue: example 1 example 2 If I understand correctly, postal codes in the UK should have 2 more letters/digits, so something is going wrong here. I don't have any clue what the problem is, but I agree with Mir that this is probably an issue in the geocoding service rather than a front-end problem. I don't know where the best place to ask about this is, but you might try the REST API forum: https://community.esri.com/community/developers/web-developers/arcgis-rest-api
... View more
06-19-2017
06:15 AM
|
1
|
0
|
2103
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-03-2017 08:23 AM | |
| 1 | 11-02-2017 08:36 AM | |
| 1 | 11-02-2017 09:23 AM | |
| 1 | 09-20-2017 02:07 PM | |
| 1 | 10-06-2017 05:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|