|
POST
|
This was fixed in version 4.22, presumably as a result of the "MapView.hitTest improvements for GraphicsLayer" mentioned in the release notes.
... View more
12-22-2021
10:04 AM
|
1
|
0
|
898
|
|
POST
|
New to the 4.21 ArcGIS API for JavaScript is a bug that occurs when using click-based tools in the SketchViewModel module. In particular, it occurs whenever the create method is called with createOptions.mode being set to "click", regardless of geometry type. The problem itself is that a click from any mouse button is treated the same as a left-click. This can be seen in the sample "Edit features with the Editor widget". Select any feature type to create, and you can place or draw the feature the same way by using any mouse button. If you use the sandbox to change the version to 4.20, only left-clicks are used to place or draw as one would expect. This is not a problem for all workflows, but is for some. For example, in one workflow, the create tool is repeatedly activated after each feature is created, so the user can continue creating features without manually clicking to activate every time. At any time, the user may want to right-click an existing feature in the same or different layer, and choose from various actions in a right-click menu. However, in 4.21, the right-click no longer results in a context menu being shown, but a new feature being unexpectedly created. If you have a locally hosted copy of the API, my recommended workaround is to make the following change in the esri/views/draw/DrawOperation module: Search for: f._onImmediateClick=function(a){ Replace with: f._onImmediateClick=function(a){if(a.button!==0)return;
... View more
11-08-2021
11:06 AM
|
0
|
2
|
1073
|
|
POST
|
Update: this issue with TextSymbol graphics being clipped was fixed in 4.21.
... View more
11-02-2021
05:35 PM
|
0
|
0
|
7041
|
|
POST
|
After upgrading to 4.21, I have found this issue is indeed fixed. Thank you!
... View more
11-02-2021
04:33 PM
|
0
|
0
|
1145
|
|
POST
|
I'm seeing a similar issue in 4.20, this time involving graphics symbolized with TextSymbol in a client-side FeatureLayer getting clipped. Label OK Label Clipped Can this be fixed in the next release?
... View more
07-26-2021
04:35 PM
|
0
|
1
|
7586
|
|
POST
|
Starting in 4.19, and including 4.20, setting the effect property on instances of ImageryLayer has no effect. This can be verified in the sandbox for the sample Intro to ImageryLayer. In the constructor for the layer on line 39, you can add an effect property like so: const layer = new ImageryLayer({
effect: "grayscale(100%)",
url:
"https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer",
format: "jpgpng" // server exports in either jpg or png format
}); When you refresh the sample using the Refresh button at the top-right of the page, you see the layer in full color as before. Now, go to line 16 and change the API version to 4.18 like so: <script src="https://js.arcgis.com/4.18/"></script> When you refresh the sample again, the layer now renders in grayscale, as it should. Other 4.19 layer types, like FeatureLayer, MapImageLayer, and TileLayer work just fine in this regard; the issue seems limited to ImageryLayer. I can't fully explain the issue, as I don't fully understand it, but the following workaround is working for me in version 4.19 (I'm unable to verify it in 4.20 since it's not available for download yet). If you have a locally hosted copy of the API, make the following change in esri\views\2d\layers\ImageryLayerView2D.js: Search for: this.watch("timeExtent",()=>{ Replace with: this.watch("layer.effect",()=>{this.subview.container.effect=this.get("layer.effect")}),this.watch("timeExtent",()=>{
... View more
07-15-2021
05:41 PM
|
1
|
3
|
1447
|
|
BLOG
|
@JoseBanuelos, thank you for providing that clarification; it is definitely helpful. I do have one other question as well. Starting in 4.20, Locator (and everything else in the tasks namespace) has been deprecated, and we're directed to use locator instead. This is well and good, except that in at least one case, the API itself still requires the use of esri.tasks.Locator. For example, when using the Search widget against a locator service, the locator property of LocatorSearchSource still requires an instance of esri.tasks.Locator. Will or can this be addressed in the next release?
... View more
07-06-2021
12:33 PM
|
0
|
0
|
1499
|
|
BLOG
|
Thank you for the information and hard work done on this release, I'm looking forward to putting it to use. Between now and then, could you please explain the breaking change "RotateEventInfo.angle is now reported in degree by the SketchViewModel"? The documentation for that property is still exactly the same as it was in 4.19.
... View more
07-02-2021
12:15 PM
|
1
|
0
|
1600
|
|
POST
|
The value property of a UniqueValueInfo instance can be either a String or a Number, as documented. Therefore, the documentation also indicates that the removeUniqueValueInfo method of the UniqueValueRenderer class accepts either a String or a Number. However, this method will not remove UniqueValueInfo instances if their value property has a numeric value, regardless of whether you pass a String or a Number to the function. The reason for this can be seen inside the definition of the removeUniqueValueInfo function: for (let b = 0; b < this.uniqueValueInfos.length; b++)
if (this.uniqueValueInfos[b].value === a + "") {
delete this._valueInfoMap[a];
this.uniqueValueInfos.splice(b, 1);
break
} In the "if" statement of line 2 above, the variable "a" contains the value passed into the function. In this same line, if the left-hand side of the comparison is a Number, then the result will always be false, because the identity/strictly equals operator (===) is used, and the right-hand side will always be a String. My fix for 4.19 is to make the following change in the init.js file (assuming a locally hosted API): Search For: if(this.uniqueValueInfos[N].value===S+"") Replace With: if(this.uniqueValueInfos[N].value+""===S+"") Note, I've verified the same problem goes back at least as far as 4.16, but this fix is specific to 4.19.
... View more
06-30-2021
02:34 PM
|
0
|
4
|
5123
|
|
POST
|
As a revision to what I said about the issue earlier, the problem occurs whenever the geometry being edited isn't normalized to the view. That is, it occurs in cases where the geometry's x values don't fall within the range of the view's xmin and xmax, but because of wrapping, the geometry still displays within the view. As a result, I gave up on trying workarounds, and went straight to the heart of the issue, which turns out to be the toScreen function of the MapView. When using interactive geometry editing with the SketchViewModel, it uses an internal GraphicsLayer to display the rotation and resizing handles (etc). As you move the mouse, it constantly checks to see if the mouse is over one of those handles, and it does so in part by using the _intersectDistance2D function of the esri/views/interactive/GraphicManipulator class. Within this function is a call to MapView.toScreen. If the geographic coordinates of those handles are not within the xmin and xmax of the view's extent, the returned ScreenPoint's x value will be off the charts (i.e. well outside of your screen's width). It shouldn't work this way since the handle is clearly on the screen. As a result, _intersectDistance2D concludes the mouse pointer is nowhere near the handle, and so you ultimately can't use it. As it turns out, I was already dealing with this kind of issue elsewhere, so I had a custom function added directly to the Point prototype called normalizeToView. Here is the implementation (note that spatialReferenceUtils is the module esri/geometry/support/spatialReferenceUtils): Point.prototype.normalizeToView = function(view) {
var point = this.clone();
if ((view) && (view.extent) && (!view.extent.intersects(this))) {
var info = spatialReferenceUtils.getInfo(view.spatialReference);
if (info) {
var extents = view.extent.clone().normalize();
var nPoint = this.clone().normalize();
var intersects = false;
for (var x = 0; x < extents.length; x++) {
if (extents[x].intersects(nPoint)) {
intersects = true;
break;
}
}
if (intersects) {
var worldWidth = info.valid[1] * 2;
while (point.x < view.extent.xmin)
point.x += worldWidth;
while (point.x > view.extent.xmax)
point.x -= worldWidth;
}
}
}
return point;
}; Therefore, I just revised the toScreen function to use this if it was available. In the file esri/views/MapView.js, I did the following: Search for: U=this._normalizeInput(U); Replace with: U=this._normalizeInput((((U)&&(typeof U.normalizeToView=="function"))?U.normalizeToView(this):U));
... View more
06-11-2021
07:45 PM
|
0
|
0
|
1057
|
|
POST
|
This was fixed in version 4.19. However, the fix has caused new problems, as seen here.
... View more
06-04-2021
05:04 PM
|
0
|
1
|
2241
|
|
POST
|
Although an issue with incorrect symbology was fixed in the 4.19 Legend widget, the fix has caused new problems of a different nature. Starting in version 4.19, the Legend widget will send numerous, duplicated requests to retrieve the symbology for the same map service. In particular, for instances of MapImageLayer and TileLayer, it will send a legend request for each visible sublayer in the service (or each sublayer regardless of visibility, if respectLayerVisibility is false). These requests have the exact same URL, and the exact same response, and are therefore duplicated and wasteful. All the Legend samples in the SDK involve instances of FeatureLayer, which don't exhibit this problem. However, to reproduce the issue, you can go to the Sandbox for the Legend widget sample, and replace the code within the second script tag with this: require(["esri/views/MapView", "esri/widgets/Legend", "esri/WebMap"], function(MapView, Legend, WebMap) {
var webmap = new WebMap({
portalItem: {
// autocasts as new PortalItem()
id: "ab51d5972c4f4c5282ebae7a24d4fcf6"
}
});
var view = new MapView({
container: "viewDiv",
map: webmap
});
view.when(function() {
webmap.layers.forEach(function(layer) {
if (layer.sublayers)
layer.sublayers.forEach(function(subLayer){subLayer.visible=true;})
});
var legend = new Legend({
respectLayerVisibility: false,
view: view
});
// Add widget to the bottom right corner of the view
view.ui.add(legend, "bottom-right");
});
}); After replacing the code, open your browser's developer tools, and then in the browser window, click the "Refresh" button at the top-right of the page (note, this is a button in the page itself, not the browser's refresh button). By watching the network tab in your browser's developer tools, you'll watch the browser go berserk with legend requests. By my count, it makes nearly 260 legend requests to do what could be done with only 16. If you zoom in, you'll watch even more legend requests being sent for information the application already has. The Legend widget has a cache, which is intended to prevent this kind of waste. However, as with the previous problem that resulted in incorrect symbology, it's the keys for this cache that are once again the culprit. Last time, they weren't "unique enough"; this time they're "too unique". My suggested fix previously involved using keys based upon the layers' url property, and once again it appears to solve this new problem as well. My workaround for 4.19 involves 3 find-and-replace operations in esri/widgets/Legend.js; the first two implement the use of layer URLs in the cache keys (rather than layer UID and sublayer ID), and the third prevents additional duplicated requests by using the cache to store promises (in addition to the legend responses it normally stores). Part 1: Search for (in function buildLegendElementsForTools): this._getLegendLayers(`${a.uid}-default`) Replace with: this._getLegendLayers(`${a.url}-default`) Part 2: Search for (in function _generateSymbolTableElementForSublayer): this._getLegendLayers(K||`${this.layer.uid}-${a.id}-default`,K) Replace with: this._getLegendLayers(K||`${this.layer.url}-default`,K) Part 3: Search for (in function _getLegendLayers) return r?Promise.resolve(r):this._legendRequest(g) Replace with: return r?((r.constructor==Promise)?r:Promise.resolve(r)):xa[a]=this._legendRequest(g)
... View more
06-04-2021
05:00 PM
|
0
|
1
|
1165
|
|
POST
|
Although there's no mention of it in the release notes, this has been fixed in 4.19.
... View more
06-04-2021
12:25 PM
|
0
|
0
|
1153
|
|
POST
|
I've found a consistent and reproducible case for this kind of behavior that may be the cause of what you're experiencing. Please see this post: SketchViewModel geometry editing bug 4.19
... View more
06-03-2021
06:13 PM
|
0
|
0
|
713
|
|
POST
|
The interactive geometry-editing utility of the SketchViewModel will not work if the view's extent is not normalized. This can be verified in the sample "Edit features with the Editor widget" with the following steps: Load the sample. Pan east (or west) until you go all the way around the world. This will go much faster if you zoom way out, pan, and then zoom back in to the editable features. In the "Editor" widget, click "Edit feature". Click on a polygon feature; this puts the feature into interactive geometry-editing mode. Move the mouse cursor over the rotation handle; note that rotation handle doesn't become highlighted like it should. Click and drag on the rotation handle; the feature is not rotated, and the map is panned instead. The same occurs if you attempt to use the resize handles or drag the feature to a new location. This was observed in 4.18 and 4.19; I don't know if it worked in previous versions or not. I haven't attempted to troubleshoot the API code itself. Instead, my current workaround is to detect if the view's extent is normalized before using the SketchViewModel, and if it is not, to normalize it before allowing further action to take place.
... View more
06-03-2021
06:09 PM
|
0
|
2
|
1150
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM | |
| 3 | 11-26-2025 09:11 AM | |
| 1 | 10-02-2025 01:14 PM |