Simple Renderer - Visual Variables - RealWorldSize

03-29-2019 08:53 AM
Occasional Contributor

(API 4.11)

Hi, i am trying to visualize Trees in real world size and it is working fine. The Problem is that when I measure the displayed diameter with the measure widget the size is correct for the "planar" mode but I actually want them to have the real world size in "geodesic" mode.

Here is the code I use to render the FeatureLayer:

var sr = new SimpleRenderer({
     symbol: new SimpleMarkerSymbol({
          color: [34,139,34, 0.7],  
          outline: {
            color: [34,139,34],
            width: 1
        label: "stamm",
        visualVariables: [{
          type: "size",
          field: "KRONENDURC",
          valueUnit: "meters", // values of Width_EW are expressed in feet
          valueRepresentation: "diameter"

As u can see the sample below shows a tree Feature with a diameter of 11 meters in planar mode. I actually want it to be 11 meters in Geodesic mode.

Is there a way to do some math with size gathered through the "KONENDURC" field?

0 Kudos
1 Reply
Esri Regular Contributor

Thanks for pointing this out. This appears to be a documentation issue. You will always want to use the correct measurement as represented by the coordinate system. Since web mercator is a projected coordinate system the variable used to drive the RealWorldSize visual variable should be in planar coordinates so it fits with the features in the other layers, including the basemap. In this case, you don't want to use geodesic measurements for visual purposes because the sizes in this coordinate system are already distorted. For things like measurement widget, popups, tables, and labels, it makes sense to display the geodesic measurement for accuracy purposes. But for the purpose of drawing a graphic/feature in the view it should be sized according to the planar measurement since that is what is assumed by the view's spatial reference.