Method Overview
Name | Return Type | Summary | |
---|---|---|---|
Promise | Generates a Renderer that may be applied directly to a supported Layer. more details | more details |
Method Details
createRenderer(params){Promise}
Generates a Renderer that may be applied directly to a supported Layer. The renderer contains a single symbol with a color optimally chosen based on the indicated basemap.
In most cases you will provide a
layer
andbasemap
to generate this renderer. If working in a 3D SceneView, then theview
andsymbolType
options should be used.Parameters:params ObjectInput parameters for generating a location-based visualization. See the table below for details of each parameter.
Specification:layer FeatureLayer | SceneLayerThe layer for which the visualization is generated.
optional The named string of the Esri basemap or basemap object that will be paired with the output visualization.
Default Value: grayoptionallocationScheme PointLocationScheme | PolylineLocationScheme | PolygonLocationSchemeIn authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the
basemap
.optionalview SceneViewThe SceneView instance in which the visualization will be rendered. This parameter is required if
symbolType = "3d-volumetric"
, except for layers with amesh
geometryType.optionalsymbolType StringThe type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a
mesh
geometry type. Known values are described below.
Default Value: 2dValue Description 2d Generates a visualization using 2D symbols such as SimpleMarkerSymbol, SimpleLineSymbol, or SimpleFillSymbol. Use this option if generating a visualization for data in a MapView. 3d-flat Generates a visualization using 3D symbols with flat symbol layers such as IconSymbol3DLayer, LineSymbol3DLayer, or FillSymbol3DLayer. Use this option if generating a 2D visualization for data in a SceneView. 3d-volumetric Generates a visualization using 3D symbols with volumetric symbol layers such as ObjectSymbol3DLayer, PathSymbol3DLayer, or ExtrudeSymbol3DLayer. Use this option if generating a 3D visualization for data in a SceneView. A SceneView instance must be provided to the view
parameter if this option is used.optionalcolorMixMode StringThis option only applies to generating renderers for mesh SceneLayers. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in FillSymbol3DLayer.material for more context. See the table below for possible values.
Value Description tint Applies the symbol color
to the desaturated geometry/texture color.replace Removes the geometry/texture color and applies the symbol color
.multiply Multiplies geometry/texture color value with the symbol color
value. The result is a darker color. Multiplying with white keeps the geometry color the same.Default value: replace
Returns:Type Description Promise Resolves to an instance of RendererResult. Example:var layer = new FeatureLayer({ url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0" }); // simple visualization to indicate features with a single symbol var params = { layer: layer, basemap: map.basemap // "satellite" }; // when the promise resolves, apply the renderer to the layer locationRendererCreator.createRenderer(params) .then(function(response){ layer.renderer = response.renderer; });
Type Definitions
RendererResult
The result object of the createRenderer() method. See the table below for details of each property.
Properties:renderer SimpleRendererA simple renderer configured with a single color best suited to match the given basemap. Set this to a layer's
renderer
property to update its visualization.locationScheme PointLocationScheme | PolylineLocationScheme | PolygonLocationSchemeThe location scheme used by the renderer.
basemapId StringThe ID of the basemap used to determine the optimal fill color of the features.