POST
|
Both of your geometries are valid as far as the JS API is concerned. I was able to create graphics from each one and add it to a map. I would take a look at server logs to get a more complete picture of what's going wrong here.
... View more
12-07-2017
08:37 AM
|
1
|
1
|
861
|
POST
|
Try setting your CSS rule on view.surface rather than view.container. ie view.surface.style.cursor = "pointer";
... View more
12-06-2017
08:46 AM
|
3
|
1
|
2330
|
POST
|
I'm not sure what's wrong here, but here's a simple sample that creates a feature layer in the client from an array of randomly generated graphics and symbolizes them with symbols that have callouts: https://codepen.io/solowt/pen/LOadjd?editors=1000#0 One thing to take a look at is verticalOffset. If you're zoomed out and have a maxWorldLength of 200, it's quite possible you won't be able to notice the callouts. It may be better to just use screenLength sometimes.
... View more
12-04-2017
10:40 AM
|
0
|
1
|
1146
|
POST
|
I've successfully used callouts with client-side graphics. Can you post a simple code sample?
... View more
12-04-2017
09:51 AM
|
0
|
3
|
1146
|
POST
|
The cursor is set from CSS. So setting the view container's style.cursor attribute to "wait" will do this. ie: var el; // the element containing your map (3.X) or view (4.X)
el.style.cursor = "wait"; In the 4.X API, you should be able to get a reference to the surface element using view.surface. From here, you can set the "data-cursor" attribute to change the cursor: view.surface.setAttribute("data-cursor", "wait"); // set to wait
view.surface.setAttribute("data-cursor", "default"); // back to default
... View more
12-04-2017
05:47 AM
|
2
|
0
|
794
|
POST
|
Setting outSpatialReference somewhere might help you if you're trying to query a Feature Service. Another option is to pull in webMercatorUtils from esri/geometry/support/webMercatorUtils and use that module to convert between Web Mercator and WGS84 Latitude/Longitude. webMercatorUtils | API Reference | ArcGIS API for JavaScript 4.5 I would specifically look at the "webMercatorToGeographic" function, which will convert a geometry from Web Mercator to WGS84 longitude/latitude.
... View more
11-30-2017
06:14 AM
|
0
|
1
|
1372
|
POST
|
Robert's answer is a good client-side method. Another option is to do this on the backend with an IdentifyTask: IdentifyTask | API Reference | ArcGIS API for JavaScript 4.5 or just by querying a feature service with some geometry (a circle maybe). These are only possible if your data is contained in a feature service/map service.
... View more
11-29-2017
01:51 PM
|
0
|
4
|
1860
|
POST
|
You can pass "expanded: true" into the widget's constructor, ie: var expand = new Expand({
expanded: true,
...
});
... View more
11-28-2017
01:40 PM
|
1
|
2
|
1055
|
POST
|
You might be better off using localStorage for this. var extents = [...] // pretend this is an array of extents
// turn our array into a string.
// we can only store strings in localStorage
var stringifiedExtents = JSON.stringify(extents.map(extent => extent.toJSON());
// store in local storage
localStorage.setItem("myBookmarks", stringifedExtents);
// read from localStorage
function readBookmarks(){
try {
var extentArray = JSON.parse(localStorage.getItem("myBookmarks"));
// use the Extent.fromJSON method to get an Esri Extent from
// the JSON you stored. This is the way to do this in 4.X
return extentArray.map(extentJSON => Extent.fromJSON(extentJSON));
} catch(e) {
console.warn("Could not parse bookmark JSON", e);
}
}
... View more
11-28-2017
08:10 AM
|
2
|
0
|
1429
|
POST
|
This is definitely possible, though you may not be able to use layer events, I'm not sure. The approach I would take is to make sure both of your layers have a fullExtent set on them. This property is part of the feature service. If this is set, you can set this up manually pretty easily, ie: on mouse move, check for intersection with neither, both, or one of the fullExtents on your data sets and then highlight them accordingly and fill in information in the side popup. In terms of merging two extents, you can do this using the geometry engine union function in order to merge two polygons or two extents however you like (I would guess two extents should normally be merged into a polygon, unless one totally contains the other). Here's simple example showing how to test for intersection with a feature layer's fullExtent on mouse-move and draw the fullExtent if the mouse is inside. JS Bin - Collaborative JavaScript Debugging It should be pretty simple to extend this so it works on however many layers you need and it merges the extents of all layers being intersected using geometryEngine.union. In terms of how you handle the side popup, I don't really know what that would involve, whether there's a pre-existing tool you're using or if it's something you've built yourselves.
... View more
11-20-2017
02:05 PM
|
0
|
0
|
599
|
POST
|
I'm pretty clueless on what could be causing this. It seems to me that it's probably a JS API/client-side issue. If I understand correctly, the problem is that your attributes are not being posted to the feature service at all, which suggests they're being stripped before your request is sent. One approach to figuring this out might be to manually send an applyEdits request without using esri/request. The REST API documentation describes how you can do this: ArcGIS REST API. If you can successfully send an applyEdits request using XMLHTTPRequest/http library of your choice, then we can pretty sure this is an issue with the JS API. It's strange that this is an issue in your production environment but not during development. Obvious things to check might be browser versions and using the same webserver to host your app in both environments, little things like that.
... View more
11-20-2017
06:51 AM
|
1
|
0
|
1167
|
POST
|
Which version of the API are you using and which coordinate system are you interested in seeing coordinates in? I can provide a sample for this if I know the details.
... View more
11-20-2017
06:45 AM
|
0
|
0
|
305
|
POST
|
view.on(...) returns a handle. The handle has a remove method, which will remove the listener. so you could do something like: var handle = view.on("drag", ...); and then call handle.remove() when you're done with the listener.
... View more
11-16-2017
11:15 AM
|
1
|
1
|
1897
|
POST
|
If you can replicate the issue you're running into in a sample I'd be happy to to take a look at it and see if I can help. I'm not sure where to begin though. I assume you're asking for a sample of this, from the docs: Pick a local origin position, approximately at the center of your data. Subtract the local origin position from all positional data (vertex data, uniforms, etc.) before passing it into WebGL. Also subtract the local origin from the translational part of the view transformation matrix. My feeling is that the first two bullets are fairly straightforward: pick a point at roughly the center of your data, transform it into rende coordinates, and subtract it from every vertex that you plan to use to create Three.js geometries. I'm not completely sure about the third bullet, but I guess that you're meant to subtract your local origin, in render coordinates, from elements 13, 14, and 15 (ie the last three elements) in the view transformation matrix, which is the output of externalRenderers.renderCoordinateTransformAt.
... View more
11-15-2017
08:30 AM
|
0
|
0
|
611
|
POST
|
Instead of passing in a Graphic to apply Edits, try just passing in an object like: let graphicObj = {
attributes: {
objectId: 1,
attr1: 5,
attr2: "hi"
}
}
featureLayer.applyEdits({
updateFeatures: [graphicObj]
}).then(...)
You could also try getting the object by doing let json = graphic.toJSON() and then delete json.geometry.
... View more
11-10-2017
08:48 AM
|
1
|
1
|
1011
|
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
|