POST
|
Like @AndyGup said, it's a regression. If you override `fetchTile()` I'd suggest to extend `BaseTileLayer` https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html which is better suited for extensibility.
... View more
12-15-2022
09:20 AM
|
1
|
0
|
1029
|
IDEA
|
Hi Jonas, Your function is the way to go. This is not possible to change RefreshableLayer.refresh() for a couple of reasons. - Layers are not aware of the views and layerviews. Multiple MapViews can display a same map and layers. So that function can only be done from the application code that knows about both the view and the layer. - There is no way to detect when a refresh is actually finished. While the layerview is refreshing, the user can still pan and zoom, and "updating" will remain true until the data is fully updated. Here's another version of your function that ensure the layerview is updating then not updating: async function refreshLayer(layer, view) {
layer.refresh();
const layerView = view.allLayerViews.find((layerView) => layerView.layer === layer);
await reactiveUtils.once(() => layerView.updating);
await reactiveUtils.once(() => !layerView.updating);
} Your goal is to detect when a refresh has failed. It can mean a lot of things. In the case of a tile layer for example, we can't consider that the refresh has failed because one tile failed to refresh. For feature layers, data is fetched using different strategies depending on the server capabilities. It would be helpful to get more information about the information you would need, and how it would translate in the UX. The only way to detect that some data failed to be fetched at the moment is to create a log interceptor https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#log to intercept the messages in the console.
... View more
04-13-2022
09:25 AM
|
0
|
0
|
1472
|
POST
|
Hi Shanon, We don't have a proper way to disable pbf at the moment. You are on the right track to use interceptors. It would work if you intercept the call to the service info, and override the supported query formats to only have JSON. esriConfig.request.interceptors.push({
urls: /FeatureServer\/\d+$/,
after: function (response) {
response.data.supportedQueryFormats = "JSON";
}
}); Cheers Yann
... View more
08-26-2020
04:24 PM
|
3
|
3
|
6531
|
POST
|
I'm sorry your are running into this. API Classes moved away from `dojo/_base/declare` and internals have changed. We never supported extending classes using native ES classes, and it worked by chance. We might support it at some point, after more refactoring, but it's not immediate work. See Implementing Accessor | ArcGIS API for JavaScript 4.16 const ExtendedFeatureLayer = FeatureLayer.createSubclass({
additionalMethod() {
}
})
You can make it work with ES classes, but this is not supported and will likely change in the future class ExtendedLayer extends FeatureLayer {
constructor(props) {
super(props);
this.postscript();
}
}
... View more
07-29-2020
11:51 AM
|
0
|
2
|
1193
|
POST
|
It was updated. UniqueValueRenderer | ArcGIS API for JavaScript 4.16
... View more
07-29-2020
08:37 AM
|
2
|
0
|
2308
|
POST
|
Hi, UniqueValueRenderer works with GeoJSONLayer as well. This is missing in the documentation, we'll update. Thanks! Yann
... View more
07-11-2020
10:52 PM
|
3
|
2
|
2308
|
POST
|
The whole API is barely based on dojo now and declare is just one of the last things to stop using from dojo.
... View more
12-18-2019
10:56 AM
|
1
|
1
|
1556
|
POST
|
That's a good question. esri/widgets/Widget already extends esri/core/Evented actually. It's not documented to let us make any modifications faster. When a module is documented we need to support it and any modification would go through deprecation etc. (we are still trying to improve the deprecation/change process). esri/core/Evented changed as the multi-inheritance was removed for example. I managed to get this done in a single release cycle. If the module had been public it wouldn't have been possible.
... View more
12-18-2019
08:10 AM
|
1
|
3
|
1556
|
POST
|
Hi Nicolas, By removing `declare` we can't anymore extend both dojo's classes and Accessor for example. As a matter of fact the API is using its own version of Evented as a mixin, which is not from Dojo. There is a couple of quick ways you can mix in Evented from Dojo while extending Accessor. Since `dojo/Evented` is a very simple class with no constructor and internal state, the fastest solution is to use directly the functions from `dojo/Evented`. require([
"esri/core/Accessor",
"dojo/Evented"
], (Accessor, Evented) => {
function EventedMixin(Base) {
return Base.createSubclass({
on: Evented.prototype.on,
emit: Evented.prototype.emit
})
}
var MyClass = EventedMixin(Accessor);
var instance = new MyClass();
instance.on("event", () => console.log("event received"));
instance.emit("event");
}); Here I created a mixin EventedMixin which creates a subclass of the provided Base and which adds the on and emit methods from dojo/Evented. Another option would be to copy the implementations from dojo in the mixin instead of referencing them. Thanks Yann
... View more
12-17-2019
02:42 PM
|
3
|
5
|
1556
|
POST
|
Hi Roman, We are designing the API to make such feature possible with the webgl rendering. In 4.10 unfortunately you will have to work around it by handling 2 views. Yann
... View more
12-20-2018
10:07 AM
|
0
|
1
|
979
|
POST
|
I see, The layerview is probably clearing the trail at every frame when it sets the canvas size which clears the previous content. What you can do is create your own canvas, draw the data in it, then use drawImage(canvas) on the context of the layerview.
... View more
12-19-2018
03:45 PM
|
0
|
4
|
2548
|
POST
|
Hi Nick, I checked out the project locally, pretty cool To integrate properly in 2D you will have to implement a custom layerview by extending the BaseLayerView2D. See https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html Basically you implement the base class and its render function. This function is called at each frame with the current view state as well as a canvas' ContextRendering2D that you can use to draw. Then we compose the canvas with the rest of the webgl content. The base class also gives you information about tiles if you want this kind of info. Cheers Yann
... View more
12-19-2018
02:54 PM
|
0
|
6
|
2548
|
POST
|
Hi, This is a normal behavior. Here is an snippet using JS Promise that reproduce the same behavior: Promise.resolve().then(
() => {
throw new Error("throwing in the then() callback")
},
(error) => {
console.error("not catching the error", error);
}
)
.catch(error => {
console.error("catching the error", error);
});
You will see that the error callback won't react to what's happening in the success callback. As a good practice, I never use the error callback, only chain with .catch Promise.resolve().then(
() => {
throw new Error("throwing in the then() callback")
}
)
.catch(error => {
console.error("catching the error", error);
})
Your code snippet would look like: var view = new MapView({
"container": "viewDiv",
"map": map,
"zoom": 7
});
view.when(function(view) {
throw new Error("This error is displayed in the browser console");
})
.catch(function(error) {
console.error(error);
});
Also, make sure to first assign view to the MapView instance. // DON'T
var view = new MapView().when(); // view is a promise
// DO
var view = new MapView(); // view is a MapView
var promise = view.when();
... View more
01-26-2018
08:33 AM
|
1
|
0
|
617
|
POST
|
The reason is that we want to give some buffer between us and the browser to get a chance cancel requests. The implementation of the queuing is rather simple, we need heuristics and also to make use of tileServers to determine how many requests at a single time. > I don't see an easier way to do this without bringing in more of the undocumented API, but I do think it's something that could be exposed to the user without too much trouble in the future. It should just work. Exposing low level configurations like this one is not something we want as it generates more bugs than improves the experience.
... View more
12-12-2017
03:44 PM
|
1
|
0
|
1099
|
Title | Kudos | Posted |
---|---|---|
1 | 12-15-2022 09:20 AM | |
3 | 08-26-2020 04:24 PM | |
1 | 07-18-2016 04:44 PM | |
1 | 12-12-2017 11:01 AM | |
1 | 12-12-2017 03:44 PM |
Online Status |
Offline
|
Date Last Visited |
03-19-2024
10:23 PM
|