|
POST
|
Ok, so in the case where it doesn't zoom properly, you're having the view go to an extent whose xmin is -180 and xmax is 180. This is impossible to display on a globe, so it zooms out to show as much of the globe as it can, and centers at the center of the extent, which happens to be the Prime Meridian (where x = 0). The solution is to detect cases that wrap around the International Dateline, and build an extent whose xmin is on the left of it, and whose xmax is on the right of it. This means the xmax will be greater than 180, but that's ok, because the API is capable of handling wrapping. To start with, you can remove our function from previously called "fixExtent". Then you can add this function in its place: function adjustExtent(extent) {
if (extent.xmin < 0) {
extent = extent.clone();
extent.xmax += 360;
extent.xmin += 360;
}
return extent;
} Then, we change the main code to this: var isSplit = false;
var extents = [];
var extent;
for (var i = 0; i < objCoordinates.length; i++) {
//etc...
extent = polygon.extent;
if (i === 0)
extents.push(extent.clone());
else {
extents.push(extent);
if (Math.abs(extent.xmin - extents[i-1].xmax) > 90)
isSplit = true;
}
}
if (isSplit) {
extent = adjustExtent(extents[0]);
for (var x = 1; x < extents.length; x++)
extent.union(adjustExtent(extents[x]));
} else {
extent = extents[0];
for (var x = 1; x < extents.length; x++)
extent.union(extents[x]);
}
this.view.goTo(extent).catch(this.catchAbortError); In the first (main) loop, we capture all the extents, and see if they're split across the dateline. Afterwards, we loop through them again, and process them according to whether or not they're split across the dateline. If they are, the ones the right side of the dateline are wrapped around the world once so their x values are greater than 180. This will enable us to produce the smallest extent that crosses the dateline.
... View more
01-13-2023
10:23 AM
|
0
|
5
|
2625
|
|
POST
|
Maybe try this instead: function remove(ev) {
var listItem = ev.target.parentNode;
listItem.parentNode.removeChild(listItem);
}
... View more
01-12-2023
09:45 AM
|
0
|
1
|
1544
|
|
POST
|
I personally haven't implemented this, but support for contingent attributes values within a FeatureForm became available in 4.23. It appears if you set this up properly in ArcGIS Pro before publishing your service, it will just automatically work in your application.
... View more
01-12-2023
09:36 AM
|
0
|
0
|
1435
|
|
POST
|
Actually, it wasn't terribly difficult to find out which ones aren't supported. The following CSS cursors don't work with view.cursor, but do with view.container.style.cursor: none wait cell text vertical-text alias no-drop not-allowed all-scroll col-resize row-resize zoom-in zoom-out url-based (custom) cursors, e.g. "url(https://myServer/myCursors/cursor1.cur),auto" Most of those nobody would probably ever use, but four of those (one being the url-based) are found in my applications.
... View more
01-11-2023
04:40 PM
|
1
|
0
|
5971
|
|
POST
|
If the 'x' values of your polygons range from -180 to 180, then it's WGS 84...if they're much larger, then it's almost certainly Web Mercator. I have a workaround in mind, but need to know which coordinate system it is.
... View more
01-11-2023
03:11 PM
|
0
|
7
|
2633
|
|
POST
|
What coordinate system are these geometries using? Is it WGS 84, Web Mercator, or something else?
... View more
01-11-2023
08:37 AM
|
0
|
9
|
2640
|
|
POST
|
As stated previously, "We should clone the extent because we plan to modify the values of that extent object". In the first pass of the loop, we clone the first polygon's extent, because in each subsequent pass, that object will be modified in place by the union function.
... View more
01-11-2023
08:21 AM
|
0
|
0
|
2347
|
|
POST
|
Thanks for going through the trouble of creating and posting that. It turns out it works just fine for me, so I went back to the example I tried before my first post, and found it working, so I was a bit dumbfounded. But then I realized I used a different cursor on this try (progress) than previously (wait). So then I tried it with the "wait" cursor, and it doesn't work in my example or yours. So in your example, if you change it to: view.cursor = "wait"; it doesn't work, but if you change it to: view.container.style.cursor = "wait"; it does work. It makes me wonder how many cursors behave like this? I don't really have the bandwidth to figure it out though, so I'll probably just stick with the latter approach...
... View more
01-10-2023
01:39 PM
|
1
|
0
|
5992
|
|
POST
|
Although there is no documentation I know of regarding this, you can "opt out" of this behavior. The short of it is that you would add this in a script tag prior to loading the API: var dojoConfig = {
has: {
"featurelayer-snapshot-enabled": 0 // disable snapshot
}
}; This is derived from this thread, at the end of the solution post. For reference, these settings are found in the esri/core/has.js file.
... View more
01-10-2023
09:23 AM
|
1
|
0
|
1200
|
|
POST
|
Hmm...I'm writing directly in JavaScript with AMD; are you using a different approach?
... View more
01-09-2023
01:48 PM
|
0
|
0
|
6017
|
|
POST
|
As far as I know, the short answer is no, since IdentityManager has no means of knowing when different host names refer to the same host. However, the workaround is otherwise simple. If you intend to use multiple host names that refer to the same host, you can simply call registerToken for each host name with the same token: IdentityManager.registerToken({server:"https://server1/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://server2/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://192.168.1.2/server/rest/services", token:tokenValue});
... View more
01-09-2023
01:42 PM
|
0
|
0
|
1245
|
|
POST
|
Although the bulk of that is correct, there is no documented "cursor" property for the objects that inherit View, and trying to use it makes no difference for me. I've always had to use view.container.style.cursor, e.g.: view.container.style.cursor = "progress";
... View more
01-09-2023
10:20 AM
|
0
|
0
|
6025
|
|
POST
|
Ok, this makes it somewhat difficult, because the full width of the calculated extent is the full width of the coordinate system itself. The map therefore centers at the Prime Meridian. Does your dataset include data throughout the world, or just the US and the Pacific?
... View more
01-09-2023
10:04 AM
|
0
|
11
|
2361
|
|
POST
|
We should clone the extent because we plan to modify the values of that extent object, and we eliminate the potential of those changes causing problems for the owning polygon object. (In this particular case, it probably wouldn't matter, but it's just good practice.) In the line: extent.union(polygon.extent); only "extent" is modified, not "polygon.extent", so there is no need to clone "polygon.extent".
... View more
01-09-2023
10:01 AM
|
0
|
2
|
2361
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-19-2024 10:37 AM | |
| 1 | 03-31-2026 02:34 PM | |
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM |