POST
|
Update: this no longer seems to work at ArcGIS JavaScript API 4.17. Reached out to ESRI support for advice.
... View more
11-20-2020
01:35 PM
|
0
|
2
|
965
|
POST
|
If I have an ImageryLayer or ImageryTileLayer in my ArcGIS JavaScript API map, how do I change the colors of the renderer. Is it possible? I cannot get it to work. Here is a CodePen of what I've tried. Basically I'm trying to replace the colorRamp with a new one and then update the renderer. This is basically a copy of an ESRI sample that shows how you can change all other properties of the RasterStretchRenderer on a LERC-based Raster layer. I assumed that this was possible as you can change colors and complete styles for SimpleRenderers on vector data. I haven't yet looked at other types of Renderers to see what happens there. Hoping I don't have to create a new layer. I'd like avoid requiring the client from having to pull all the data down each time the renderer is changed. Thoughts advice are welcome. Ryan
... View more
08-29-2020
04:23 PM
|
0
|
6
|
2134
|
POST
|
ESRI Canada Technical support got back to me with this regarding performance differences between ClassBreaks and the StretchRenderer: ..the primary difference between the two is that the Class Breaks Renderer consumes more resources because it must query the attribute information on the layer first before determining how best to categorize each pixel in each class. So there is a lot of computation and logic involved behind the scenes when this renderer does its work to put each pixel value into each group. This is passed to the client, and explains the performance decrease when you dynamically change this renderer. The documentation notes this: 'ClassBreaksRenderer defines the symbol of each feature in a Layer based on the value of a numeric attribute. Symbols are assigned based on classes or ranges of data. Each feature is assigned a symbol based on the class break in which the value of the attribute falls.' The Stretch Renderer is working less hard as it does not have to consider all attribute values and how they may be placed into groups of categories. It is simply just changing the values on pixels. This has less impact on the client, as is seen in your sample. The documentation on this renderer notes: 'RasterStretchRenderer defines the symbology with a gradual ramp of colors for each pixel in a ImageryLayer based on the pixel value.' Makes sense. There was also confirmation that there isn't much in the way of other options for a client-side renderer on an ImageryTileLayer. So sounds like for now we'll opt for this approach despite it's limitations and hope that the RasterStretchRenderer will be extended to filter values at some later point by ESRI. If anyone comes up with better solutions or workarounds would love to hear.
... View more
08-27-2020
03:15 PM
|
0
|
3
|
973
|
POST
|
[updated 2020-09-06: added some CodePen examples with what I've tried] I have a use case for an app where I would like to enable users to filter pixels based on value from an ImageryTileLayer (formerly TileImageryLayer) in a map by adjusting a UI widget. Looking through the API however I cannot see any way to do this. Is there a recommended approach for a situation like this? If I switched to a regular ImageryLayer I believe I could accomplish this via a PixelFilter (although I haven't implemented yet). Update: Here is a CodePen example showing how I've created a dynamically rendered raster layer clientside with a RasterStretchRenderer. Unfortunately, from what I've read the RasterStretchRenderer does not seem to support filtering of values (this is consistent with other platforms like Desktop). Not sure why this is. Here is a second CodePen example showing an approach where I tried using a ClassBreaksRenderer, creating my own breaks to mimic a stretchRenderer and then enabling filtering by setting specific breaks to be transparent. It accomplishes what I am after although the performance when a user adjusts the color scheme is much worse. It could be something with my code-- note that I run functions to dynamically recalculate colors and stops-- but looking at tests these seem to be running under 2-3ms. @ESRI Is there a better way of doing this? An ESRI support person indicated that perhaps the RasterStretchRenderer has some optimization for dynamic display but the API documentation only says, The RasterStretchRenderer works well when you have a large range of values to display, such as in imagery, aerial photographs, or elevation models. I'm wondering why dynamically adjusting a ClassBreaksRenderer would be so much worse. Any advice, guidance, is welcome.
... View more
07-22-2020
11:11 AM
|
0
|
4
|
1029
|
POST
|
Thanks for your response and clarification. To be clear for anyone else looking at this: I don't think the "avg", "stddev" values have any effect on rendering using the "min/max" method; they just need to be set for the REST request to work properly. I believe it's sufficient to set them as 0 as a placeholder. Correct me if I'm wrong though. Followup: If you have any advice on what OutputMin, OutputMax do that would be great. Documentation says: The outputMin denotes the output minimum, which is the lowest pixel value for the histogram. The outputMin and outputMax will set the range of values that will then be linearly contrast stretched. But its not clear to me how that is supposed to be used.
... View more
06-17-2020
11:30 AM
|
1
|
1
|
3886
|
POST
|
I'm trying to render an ImageryLayer by assigning it a Renderer to stylize it. I'm using a RasterStretchRenderer but it is not behaving as I would expect. Here is a CodePen sample of what I've got set up. I expected that if I changed the statistics ```min``` or ```max``` values in my codePen the colors would change as per below from ArcMap: Set to 0 - 3000 Now change the max to 2000: I want my example to behave akin to this ESRI JS Sample when you adjust the slider on the "min-max" stretch type for a TileImageryLayer. The statistics properties I'm setting have no effect. The stretch is always based on the min, max values of the data itself. I'm thinking the problem has something to do with me not understanding how to set that up. I've also looked at the OutputMin, OutputMax values, and can't understand what they are doing. Changing the latter has similar effects to above but the numbers are all wrong. Any advice, thoughts is welcome.
... View more
06-15-2020
09:31 PM
|
1
|
3
|
4168
|
IDEA
|
This isn't an exciting new feature. Its a fix to a problem with the API. If you look at the ESRI ArcGIS JavaScript API documentation you'll see: FeatureLayerView.queryFeatures() and GeoJSONLayerView.queryFeatures() results do not include the z-values when called in 2D MapView even if returnZ is set to true . What is up with that? There's lots of instances where I would like to be able to have access to my data's z-values even if I'm querying it clientside via a 2D Map. I can see why this capability might be disabled by default but not why its not possible at all. I would like to know if this is under consideration for future versions and if not, why not? What's the obstacle? PS> Also, why isn't there an arcgis javascript api category?
... View more
05-15-2020
04:58 PM
|
1
|
1
|
705
|
IDEA
|
This isn't an exciting new feature idea. It's just a fix to a vexing problem with ESRI's ArcGIS JavaScript API that I think needs to be looked at. In the API you can have a single map instance utilized by several Views. This is great. In apps I've worked on we often have a 2d MapView and a 3D SceneView sharing a Map instance and running simultaneously in the browser. A 2D MapView does not support 3D Layer types like ElevationLayer, BuildingSceneLayer, or whatnot. And the 3D SceneView doesn't support some other layer types like KmlLayer. Fine, makes sense. But, the problem is that instead of a 2D View recognizing standard 3D layer types and ignoring them (perhaps with a graceful warning in the browser console), it tries to add them to the view and fails, throwing errors like below: Above example is with an ElevationLayer in a MapView. I haven't tested but assume simular behaviour w. incompatible layer types. (tested at 4.15) This clutters our logs, confuses users, and suggests that the JavaScript API could be wasting resources trying to create a layerView when it cannot. We should be able to expect if we're using an ESRI defined layer type that is not compatible with the View type that the API will handle it gracefully and not throw errors.
... View more
05-01-2020
04:41 PM
|
2
|
0
|
488
|
POST
|
Just want to confirm: Is this still really the case? We can't even spin down the ArcGIS Server site and rename the directories manually? (Add a GIS server folder in ArcGIS Desktop—Documentation | Documentation for ArcGIS Enterprise)
... View more
03-02-2020
03:57 PM
|
1
|
1
|
1433
|
POST
|
I just noticed after recently updating our ArcGIS JavaScript API to 4.14 that hitting "z" to undo a vertex on a polyline in edit or sketch mode is now removing the last **2** vertices placed. Took a look and the behavior seems also to occur in the ESRI sample online. Just wanted to confirm this is a **bug** and not some intended behaviour. Also if anyone has found a workaround or hack fix would love to hear. There's some improvements at 4.14 that we'd otherwise really like to take advantage of.
... View more
02-10-2020
11:37 AM
|
0
|
2
|
3749
|
POST
|
Taking a second look this morning I see how you can take a collection of graphics and set them as a source for a new FeatureLayer. That way you have access to queryFeatures and related functionality. I thought that a FeatureLayer required a REST endpoint or Map/FeatureService as it's source.
... View more
11-14-2019
09:46 AM
|
0
|
0
|
1945
|
POST
|
I could be wrong but I don't see how you can get a LayerView class from a GraphicsLayer. Seems a GraphicsLayer creates a GraphicsLayerView which only has queryGraphics(). The example and link above works only for a FeatureLayer. If either of you were indeed able to do the above would love to see a code sample of how you got this: specifically a LayerView from a GraphicsLayer in a map.
... View more
11-13-2019
06:17 PM
|
0
|
1
|
1945
|
POST
|
Above pattern works but would be nice to figure out how to use storeNode since this seems to be what is recommended in the API. Had same question with how to use and method not being found on widget.
... View more
05-22-2019
11:45 AM
|
0
|
0
|
552
|
POST
|
Makes sense. Looks the same as the native Fetch() method with the benefit that it works on IE. Thanks for your help.
... View more
03-30-2019
07:40 AM
|
0
|
0
|
374
|
POST
|
I would like to fetch an ArcGIS featurelayer and get information on its properties and capabilities but I have no interest in rendering it in a map or a table. Is there a trick to load the featurelayer without inserting it in a map and view? Unless I do that I cannot figure out how to get its loaded property to be true. var featureLayer = new FeatureLayer({
url: url
});
featureLayer.when(function () {
// fires when layer is loaded:
console.log(featureLayer.capabilities);
//... do something with capabilities here...
});
// Do I really need to load the map and view modules?
var map = new Map({
basemap: "oceans",
layers: featureLayer
});
var view = new MapView({
map: map,
container: "viewDiv"
});
// after above is complete, layer will be loaded but is there
// a better way to avoid loading all this extra stuff? I'm currently doing a straight fetch to get the layer's JSON information and parsing it manually but obviously would like to use the ArcGIS Javascript API to reduce the work and lines of code.
... View more
03-29-2019
08:54 PM
|
0
|
2
|
483
|
Title | Kudos | Posted |
---|---|---|
2 | 11-07-2023 01:10 PM | |
1 | 10-27-2023 02:01 PM | |
1 | 05-15-2020 04:58 PM | |
1 | 04-15-2021 09:08 AM | |
1 | 04-06-2021 10:29 AM |
Online Status |
Offline
|
Date Last Visited |
03-15-2024
06:57 PM
|