A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/en/javascript/jsapi/vectorfieldrenderer-amd.html below:

VectorFieldRenderer | API Reference | ArcGIS API for JavaScript 3.46

require(["esri/renderers/VectorFieldRenderer"], function(VectorFieldRenderer) { /* code goes here */ });
Description

(Added at v3.13)

The VectorFieldRenderer function creates a a U-V or Magnitude-Direction visualization for an instance of

ArcGISImageServiceVectorLayer

.

Samples

Search for

samples

that use this class.

Class hierarchy
esri/renderers/Renderer
|_esri/renderers/VectorFieldRenderer
Constructors Constants FLOW_FROM Flow from angle FLOW_TO Flow to angle STYLE_BEAUFORT_FEET Beaufort point symbol (feet) STYLE_BEAUFORT_KM Beaufort point symbol (kilometers) STYLE_BEAUFORT_KN Beaufort point symbol (knots) STYLE_BEAUFORT_METER Beaufort point symbol (meters) STYLE_BEAUFORT_MILE Beaufort point symbol (miles) STYLE_CLASSIFIED_ARROW Classified arrow point symbol STYLE_OCEAN_CURRENT_KN Ocean current point symbol (knots) STYLE_OCEAN_CURRENT_M Ocean current point symbol (meters) STYLE_SCALAR Simple scalar point symbol STYLE_SINGLE_ARROW Single arrow point symbol STYLE_WIND_BARBS Barb wind speed point symbol Properties Methods

Constructor Details

Creates a new VectorFieldRenderer object. Please note that

sizeInfo

and

visualVariables

should not be set as part of the constructor options. Instead, use

setVisualVariables

to handle this.

Please see the snippet below which demonstrates this.

Parameters: <Object> options Optional Optional parameters. See options list. options properties: <String> flowRepresentation Optional Sets the flow direction of the data. This can be modified to display meteorologically (the direction it is flowing from) or climatologically (the direction it is flowing to). See the Constants table for valid FLOW values. <Symbol> singleArrowSymbol Optional A symbol that can be defined if the style is set to STYLE_SINGLE_ARROW. <String> style Optional A predefined style. See the Constants table for valid STYLE values. NOTE: All the styles defined in the VectorFieldRenderer have very fixed symbology in terms of the graphic shape and color scheme. The only thing that can change is size. It is not possible to specify a different value for the min and max data values if working with STYLE_WIND_BARBS. Sample:
 vectorLayer = new ArcGISImageServiceVectorLayer(url);

    var sizeInfoVar = {
      type: "sizeInfo",
      minSize: 3,
      maxSize: 100,
      minDataValue: 0.04,
      maxDataValue: 32
    };

    var visualVariables = [];
    visualVariables.push(sizeInfoVar);
  
    var renderer = new VectorFieldRenderer({
      style: VectorFieldRenderer.STYLE_BEAUFORT_KN,
      flowRepresentation: VectorFieldRenderer.FLOW_TO
    });
    renderer.setVisualVariables(visualVariables);
    vectorLayer.setRenderer(renderer);       

    map.addLayer(vectorLayer);

Property Details

Deprecated. As of v3.13 use visualVariables instead. The object specification table defined here provides the specification for opacityInfo objects within the visualVariables property.

An object that describes how opacity of features is calculated. See the object specifications table below for properties of the opacityInfo object. (Added at v3.11)

Object Specifications:

<legendOptions>

<Boolean> showLegend Optional Indicates whether to show the opacity ramp in the legend. <String> title Optional Text that describes the visualization. This is displayed as the title of the corresponding opacity ramp in the Legend and takes precedence over the field alias or valueExpressionTitle.

<opacityInfo>

<String> field Required Name of the feature attribute field that contains the data value. <Object> legendOptions Optional An object providing options for displaying the opacity ramp in the legend. See the object specification table for legendOptions above. <Number> maxDataValue Required Maximum data value. <Number> minDataValue Required Minimum data value. <String> normalizationField Optional Name of the feature attribute field used to normalize the data value. <Number[]> opacityValues Required An array of opacity values. Each value must be a number ranging from 0.0 to 1.0. The first value is used for features with minimum data value (or lower), the last value is used for features with maximum data value (or higher). At least two values are required. If there are three or more, the intermediate ones are applied proportionally between the first and last values. You need to specify either opacityValues or stops. <Object[]> stops Required An array of objects, each with two properties: value and opacity. At least two stops are required. You need to specify opacityValues or stops. If you specify stops, then you do not need minDataValue and maxDataValue. <String> type Required This value must be opacityInfo. <String> valueExpression Optional An Arcade expression evaluating to a number. This expression can reference field values using the $feature global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. Therefore, this property is typically used as an alternative to field in visual variables. <String> valueExpressionTitle Optional The title identifying and describing the associated Arcade expression as defined in the valueExpression property. This is displayed as the title of the corresponding opacity ramp in the Legend in the absence of a provided title in the legendOptions property. Sample:
var opacityInfo = {
  field:"fieldname",
  normalizationField: "normalizationField",
  minDataValue:  0,
  maxDataValue:  100,
  // stops: [
  //   { value: 10, opacity: 0   }, 
  //   { value: 39, opacity: 0.5 },  
  //   { value: 68, opacity: 1   }   
  // ]
         
  // OR, you can specify alphaValues using:
  opacityValues:   [ 0, 1 ]
};
Deprecated. As of v3.13 use visualVariables instead. The object specification table defined here provides the specification for rotationInfo objects within the visualVariables property.

Defines how marker symbols are rotated. Use rotation to depict wind direction, vehicle heading etc. Specify an object with the following properties. (Added at v3.7)

Object Specifications:

<rotationInfo>

<String | Function> field Required

Name of the feature attribute field that contains the angle of rotation. Or a function that returns the angle of rotation.

A function is useful in cases where the angle of rotation is not available in an attribute field but needs to be computed using a mathematical expression or formula. For example, you can specify a function to compute wind or current direction when the underlying data is stored as U or V vectors. View example below.

<String> rotationType Optional

Defines the origin and direction of rotation depending on how the angle of rotation was measured. Can be one of the following:

The default value is "geographic".

<String> type Required This value must be rotationInfo. <String> valueExpression Optional An Arcade expression evaluating to a number. This expression can reference field values using the $feature global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. Therefore, this property is typically used as an alternative to field in visual variables. Sample:
// field value contains rotation variable
var rotationInfo = {
  type: "rotationInfo",
  field: "WindDirection",
  rotationType: "geographic"
};

// custom function defines rotation
var rotationInfo = {
  type: "rotationInfo",
  field: function(graphic){
    var U = graphic.attributes.U,
    V = graphic.attributes.V;

    //Oceanographic Convention
    return 360 + (180 / Math.PI) * Math.atan2(U,V);
  }
};
Deprecated. As of v3.13 use visualVariables instead. The object specification table defined here provides the specification for sizeInfo objects within the visualVariables property.

Defines the size of the symbol where feature size is proportional to data value. Note: prior to v3.12, this property was known as proportionalSymbolInfo. See the object specifications table below for a list of its available properties.

Symbol size rendering can be applied to two types of data:

In addition, regardless of the type of data described above, you can map a range of data values to a range of symbol sizes.

For point features, maker size is varied in proportion to the data value. For line features, stroke width is varied.

(Added at v3.7)

Object Specifications:

<legendOptions>

<Number[]> customValues Optional An array of numbers representing the values to use for the stops in the legend. For example, if the size stops in the legend are 13, 171, 286, 404, and 534, you can adjust the stops in the legend to use more rounded numbers by setting them to this property. For example, sizeInfo.legendOptions.customValues = [10, 150, 300, 400, 500]. See the example snippet below. <Boolean> showLegend Optional Indicates whether to show the size ramp in the legend. <String> title Optional Text that describes the visualization. This is displayed as the title of the corresponding size ramp in the Legend and takes precedence over the field alias or valueExpressionTitle.

<sizeInfo>

<String> expression Optional Deprecated. As of v3.19 use valueExpression instead. Allows a size to be defined based on the scale. "view.scale" is the only expression currently supported. Added at 3.14 <String | Function> field Required Required name of the feature attribute field that contains the data value. Or a function that returns the data value. <Object> legendOptions Optional An object providing options for displaying the size ramp in the legend. See the object specification table for legendOptions above. <Number> maxDataValue Optional Maximum data value. <Object> maxSize Required Specifies the largest marker size to use at any given map scale. Note: This is required if valueUnit is set to "unknown". In version 3.13, this could only be set as a number which represented the symbol size in pixels. Beginning with 3.14, it now is an object that contains:
  "maxSize": {
    "type": "sizeInfo",
    "expression": "view.scale",
    "stops": [
      {"value": 1128, "size": 80},
      {"value": 288895, "size": 80},
      {"value": 73957191, "size": 50},
      {"value": 591657528, "size": 25}
    ]
  }
<Number> minDataValue Required Minimum data value (required if valueUnit is "unknown"). <Object> minSize Required Specifies the smallest marker size to use at any given map scale. Note: This is required if valueUnit is set to "unknown". In version 3.13, this could only be set as a number which represented the symbol size in pixels. Beginning with 3.14, it now is an object that contains:
  "maxSize": {
    "type": "sizeInfo",
    "expression": "view.scale",
    "stops": [
      {"value": 1128, "size": 80},
      {"value": 288895, "size": 80},
      {"value": 73957191, "size": 50},
      {"value": 591657528, "size": 25}
    ]
  }
<String> normalizationField Optional Name of the feature attribute field used for data normalization. The data value obtained from field is divided by the value obtained from normalizationField before calculating the symbol size. <Object[]> stops Required Added at 3.14 An array of objects that define the size of the symbol. It takes the following properties:
var stops = 
 [
   { "value": 1128, "size": 16 },
   { "value": 288895, "size": 16 },
   { "value": 73957191, "size": 9 },
   { "value": 591657528, "size": 2 }
 ]
<String> type Required This value must be sizeInfo. <String> valueExpression Optional An Arcade expression evaluating to a number. This expression can reference field values using the $feature global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. Therefore, this property is typically used as an alternative to field in visual variables. <String> valueExpressionTitle Optional The title identifying and describing the associated Arcade expression as defined in the valueExpression property. This is displayed as the title of the corresponding size ramp in the Legend in the absence of a provided title in the legendOptions property. <String> valueRepresentation Required Specifies what the data value measures if it represents a real world distance (required if valueUnit is not "unknown"). The following values are supported: <String> valueUnit Required Required unit of measurement if the data represents a real world distance quantity. Valid values are: "unknown","inches", "feet", "yards", "miles", "nautical-miles", "millimeters", "centimeters", "decimeters", "meters", "kilometers", "decimal-degrees".

If the data value represents a non-distance quantity (for example traffic count, census data) then valueUnit should be set to "unknown".

Sample:

Data representing

distance

quantity:

{
  field: "tree_canopy",
  valueUnit: "meters",
  valueRepresentation: "diameter"
}
//ground area covered by trees measured in square feet. 
{
  field: "GroundArea", 
  valueUnit: "feet",
  valueRepresentation: "area"
}

Specify

minSize

and

maxSize

to smooth out outliers.

Data representing a non-distance quantity.

{
  field: "avg_daily_traffic",
  valueUnit: "unknown",
  minSize: 1000,
  minDataValue: 8
}

Specify

maxSize

to smooth out outliers.

Map a range of data values to a range of symbol sizes:

{
  field: "avg_daily_traffic",
  valueUnit: "unknown",
  minSize: 1,
  maxSize: 10,
  minDataValue: 1000,
  maxDataValue: 100000
}

To use

legendOptions

:

renderer.sizeInfo({
  field: "POP_PER_DOC",
  minSize: 2,
  maxSize: 20,
  minDataValue: 100,
  maxDataValue: 10000,
  valueUnit: "unknown",
  legendOptions: {
    customValues: [100, 200, 300, 10000]
  }
});

This property allows you to define how to render values in a layer. It is composed of an array of objects (called "visual variables"), each of which contains the type of drawing property, the axis the variable is applied to, and additional properties for the variable. Variables (or data values) may be visualized in one of four ways: color, size, opacity, and rotation. The following bullet points outline how each visual variable may be defined:

(Added at v3.13) Sample: Color example:

"visualVariables": [
  {
    "type": "colorInfo",
    "field": "M086_07",
    "normalizationField": "AREA",
    "stops": [
       {
         "value": 0,
         "color": new Color([255,255,255]),
         "label": "< 30.900"
       },
      {
         "value": 100,
         "color": new Color([127,127,0]),
         "label": "37.415"
      }
    ]
 }]


Size example:

"visualVariables": [
  {
    "type": "sizeInfo",
    "field": "pop2000",
    "minDataValue": 493782,
    "maxDataValue": 33871648,
    "valueUnit": "unknown",

    "minSize": {
      "type": "sizeInfo",
      "expression": "view.scale",
      "stops": [
        { "value": 1128, "size": 16 },
        { "value": 288895, "size": 16 },
        { "value": 73957191, "size": 9 },
        { "value": 591657528, "size": 2 }
       ]
      },

     "maxSize": {
     "type": "sizeInfo",
     "expression": "view.scale",
     "stops": [
       { "value": 1128, "size": 80 },
       { "value": 288895, "size": 80 },
       { "value": 73957191, "size": 50 },
       { "value": 591657528, "size": 25 }
      ]
  }
  }]


Opacity example:

{
  "type": "opacityInfo",
  "field": "PCP",
  "stops": [{
    "value": 0,
    "opacity": 100
  }, {
    "value": 10,
    "opacity": 0
  }]
}


Rotation example:

{
  "type": "rotationInfo",
  "field": "Rotate",
  "rotationType": "arithmetic"
}

Method Details

Gets the color for the Graphic. (Added at v3.8)

Returns the opacity value for the specified graphic. This is calculated using the

opacityInfo

definition.

(Added at v3.11) Parameters: <Graphic> graphic Required Returns the opacity value appropriate for the given graphic. This value is calculated based on the opacityInfo definition. <Object> options Optional This optional parameter supports opacityInfo. If none is provided, the Renderer.opacityInfo will be used.

Returns the angle of rotation (in degrees) for the graphic calculated using rotationInfo. (Added at v3.7)

Return the symbol size (in pixels) for the graphic, calculated using sizeInfo. (Added at v3.7)

Parameters: <Graphic> graphic Required The graphic for which you want to calculate the symbol size. <Object> options Optional This optional parameter supports sizeInfo. If none is provided, the Renderer.sizeInfo will be used.

Gets the symbol for the Graphic.

Parameters: <Graphic> graphic Required Graphic to symbolize. Used when creating a custom renderer.

Returns the visual variable of the specified type. (Added at v3.13)

Parameters: <String> type Required The type of visual variable desired. Supported Values: colorInfo (does not apply to VectorFieldRenderer) | sizeInfo | opacityInfo Sample:
var colorVisVar = renderer.getVisualVariablesForType('colorInfo');
Deprecated. As of v3.13 use setVisualVariables() instead.

Sets opacity info for the renderer as defined by the info parameter.

The info parameter is an object with the same properties as opacityInfo.

(Added at v3.11)

Parameters: <Object> info Required The info parameter is an object with the same properties as opacityInfo. Sample:
renderer.setOpacityInfo({
      field:"fieldname",
      minDataValue:  0,
      maxDataValue:  100,
      // stops: [
      //   { value: 10, opacity: 0   }, 
      //   { value: 39, opacity: 0.5 },  
      //   { value: 68, opacity: 1   }   
      // ]
         
      // OR, you can specify alphaValues using:
      opacityValues:   [ 0, 1 ]
 });
Deprecated. As of v3.13 use setVisualVariables() instead.

Modifies rotation info for the renderer. The info argument has the same properties as rotationInfo. (Added at v3.7)

Sample:

renderer.setRotationInfo({
   field: "WIND_DIRECT"
});

Deprecated. As of v3.13 use setVisualVariables() instead.

Set size info of the renderer to modify the symbol size based on data value. The info object has the same properties as sizeInfo.

NOTE:

(Added at v3.7)

Parameters: <Object> info Required An object with the same properties as sizeInfo. Sample:

renderer.setSizeInfo({
  field:"WIND_SPEED",
  minSize:3,
  maxSize:20,
  minDataValue:5,
  maxDataValue:50
 });

layer.setRenderer(renderer);
Sample:
//This specific example uses sizeInfo.
  renderer.setVisualVariables([{
    type: "sizeInfo",
    field: "TOTPOP_CY",
    minSize: 5,
    maxSize: 50,
    minDataValue: 50,
    maxDataValue: 1000
  }]);

Converts object to its ArcGIS Server JSON representation. (Added at v2.1)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4