|
POST
|
Hey Franklin, You actually can use visual variables to your advantage here, just in a roundabout way. Here's a test app that demos this: https://codepen.io/kekenes/pen/GRWZpXY?editors=1000 Basically, you need to use Arcade to manage the sizes and scales for each unique value. This expression will return the desired feature size depending on the value and the scale level. In essence, it treats the desired size as if it were a data value. Then you need to set the minDataValue/minSize and maxDataValue/maxSize to matching limits. I set them to the overall min and max sizes across all scales, though you could theoretically do something like 1 and 100 and it would work the same. layer.renderer = {
type: "unique-value",
field: "DOM_CROP_ACRES",
uniqueValueInfos: [
{
value: "Corn",
symbol: {
type: "simple-marker",
color: "rgb(237, 81, 81)",
outline: {
width: 0.5,
color: "rgba(0,0,0,0.5)"
},
size: 4
}
},
{
value: "Wheat",
symbol: {
type: "simple-marker",
color: "rgb(20, 158, 206)",
outline: {
width: 0.5,
color: "rgba(0,0,0,0.5)"
},
size: 7
}
},
{
value: "Soybeans",
symbol: {
type: "simple-marker",
color: "rgb(167, 198, 54)",
outline: {
width: 0.5,
color: "rgba(0,0,0,0.5)"
},
size: 10
}
}
],
visualVariables: [
{
type: "size",
valueExpression: `
// sizes for each value
// at generic scale levels
var sizesAndScales = {
small: {
Corn: 2,
Wheat: 5,
Soybeans: 8
},
medium: {
Corn: 8,
Wheat: 14,
Soybeans: 20
},
large: {
Corn: 18,
Wheat: 24,
Soybeans: 32
}
}
// match scale levels with actual
// scale values
var scale = When(
$view.scale > 9244650, "small",
$view.scale <= 9244650 && $view.scale > 2311162, "medium",
$view.scale <= 2311162, "large",
"no scale"
);
// I only need to make this check because there
// are more values than three example values I wanted
// to use for the demo
if($feature["DOM_CROP_ACRES"] != "Corn" && $feature["DOM_CROP_ACRES"] != "Wheat" && $feature["DOM_CROP_ACRES"] != "Soybeans"){
return null;
}
// return desired size based on value and scale level
return sizesAndScales[scale][$feature["DOM_CROP_ACRES"]];
`,
// must be equal to or smaller
// than the smallest size in the expression
minSize: 1,
minDataValue: 1,
// must be equal to or larger
// than the largest size in the expression
maxSize: 32,
maxDataValue: 32,
// legend not needed for this VV
legendOptions: {
showLegend: false
}
}
]
}; Let me know if this doesn't solve your issue. Kristian
... View more
05-13-2021
10:37 AM
|
0
|
8
|
8403
|
|
POST
|
This is the default popup style in the 4x versions of the JS API. By "standard popup" do you mean the popup in the class map viewer (3x JS API)? If you want to take advantage of this in webmaps you can use it in any JS API 4x app, or in the map viewer beta.
... View more
04-29-2021
10:59 AM
|
0
|
1
|
1640
|
|
IDEA
|
It won't be available in ArcGIS JS API, but it will be available as a component in another library released by Esri. Similar to Calcite components - https://esri.github.io/calcite-components/?path=/story/overview-getting-started--page
... View more
04-22-2021
10:01 AM
|
0
|
0
|
6627
|
|
IDEA
|
We won't be able to implement the pie chart symbol for clusters in the near term. The JS API CIMSymbol implementation first needs to add support for chart symbols before we can add support for that. Regarding the distinct symbol, there is an undocumented/unsupported/experimental property on FeatureReductionCluster called "symbol". You can set a symbol on that property to make the cluster symbol distinct from all individual points. Give that a try and let me know if that satisfies most of your use cases. Also post if you want or need more control over rendering than just the symbol, like sizing the cluster using another stat other than feature count...field sum...field average...etc.
... View more
04-22-2021
09:56 AM
|
0
|
0
|
6510
|
|
IDEA
|
SymbolStyler will not be a widget released in the JS API. However, it will be released as a web component available for public use at some point. We don't have an estimated public release date at this point.
... View more
04-22-2021
09:47 AM
|
0
|
0
|
6634
|
|
POST
|
Hey! It looks like your Legend is limiting the layers being displayed in one of two ways. The layers that don't have a legend may have the legendEnabled property set to false OR the Legend widget itself has layerInfos set that don't include the other layers. Make sure layer.legendEnabled is true for all layers and that the Legend.layerInfos is null. If it's null the Legend widget should handle visibility of layers automatically... Let me know if that wasn't the issue... Kristian
... View more
04-21-2021
05:10 PM
|
0
|
0
|
2736
|
|
POST
|
> Is there a way to make Graphics on a GraphicsLayer scale based on zoom? No. There is no way to efficiently scale the symbols of graphics in the view graphics or in a GraphicsLayer. > If not, how could I modify the viewshed sample to use a FeatureLayer instead? You will need to create a client-side feature layer and add a simple renderer to it using the code in the sample you referenced above. Undral's comment shows how you can create a feature layer using graphics. If this is only to display temporary results in the view, you can just construct the FeatureLayer and pass the graphics to the layer.source. When you want to clear the graphics, destroy the layer. That way you avoid using applyEdits. The method of managing the graphics with applyEdits or creating a new layer every time is up to you.
... View more
04-21-2021
09:45 AM
|
1
|
0
|
3701
|
|
POST
|
Hi Kevin, Are you able to share the webmap? That sounds like a bug, but we'll need the webmap to reproduce it. Kristian
... View more
04-08-2021
07:57 AM
|
0
|
0
|
1227
|
|
POST
|
Hi, you could use Arcade to do this if you're sketching geometries. Here's a codepen showing how to encode the sketched geometries into an Arcade expression. You then use a UniqueValueRenderer to style the intersecting features how you want. https://codepen.io/kekenes/pen/GRjVvJL
... View more
01-26-2021
11:08 AM
|
1
|
0
|
2560
|
|
POST
|
Hi Michail, > Is there any plan to click and show the popup for the unique features below even when the FeatureReductionCluster is activated on the layer and the features are still clustered? Yes. You will be able to configure this in your app with the 4.18 version of the JS API, which will be available tomorrow. 🙂 We are considering making the "browse features" action available by default in another release. Keep an eye out for the sample called "Query cluster features" tomorrow afternoon. You can use the code in there to implement this. > If there are multiple points on top of each other, is there a way to show as cluster label, the number of features behind and not the number of geographic points with different coordinates? This looks like a clustering bug where two clusters are drawn on top of each other and the cluster with a size of 2 is on top. We'll need to investigate. Can you share that issue with support so we can get it into our system? The popup with six features doesn't appear to be the cluster popup since we don't provide browsing capabilities by default. Hopefully that helps! Kristian
... View more
12-16-2020
01:50 PM
|
0
|
1
|
2403
|
|
POST
|
Hey Corey, This is a known issue. We're working on tightening the tolerance for hitTest.
... View more
10-20-2020
01:14 PM
|
2
|
1
|
2221
|
|
POST
|
No ETA yet on when the plan is. This is something we are still planning for, but trying to prioritize the work with other projects is a challenge.
... View more
10-15-2020
12:25 PM
|
1
|
1
|
1515
|
|
POST
|
Understood. And thank you for continuing to voice your desire for these improvements. We are in active discussions about prioritizing this work. No ETA yet on when the plan is. We're having to navigate work on other projects as well.
... View more
10-15-2020
12:24 PM
|
1
|
1
|
1515
|
|
POST
|
Yeah, this is an Arcade limitation for now. Arcade in popups only supports returning numbers or strings, not HTML markup. It's been on our list for some time to evaluate this. It's a popular request. So unfortunately we don't support this at the moment. Kristian
... View more
09-24-2020
09:35 AM
|
1
|
0
|
4407
|
|
POST
|
Hi Alexander, This bug has been fixed in a later version of the API. You can verify it on our "next" version: <script src="https://js.arcgis.com/next/"></script>
... View more
09-22-2020
03:07 PM
|
2
|
0
|
1698
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-06-2025 03:09 PM | |
| 1 | 04-29-2025 08:36 AM | |
| 1 | 08-20-2024 08:06 AM | |
| 1 | 08-13-2024 11:53 AM | |
| 1 | 07-22-2024 11:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-06-2025
03:01 PM
|