AnsweredAssumed Answered

MapView.add_layer function options

Question asked by simo on May 28, 2018
Latest reply on May 29, 2018 by simo

add_layer(item, options=None)

Adds the specified layer or item to the map widget.

 

ArgumentDescription
itemRequired object. You can specify Item objects, Layer objects such as FeatureLayer, ImageryLayer, MapImageLayer etc., FeatureSet and FeatureCollection objects.
optionsOptional dict. Specify visualization options such as renderer info, opacity, definition expressions. See example below

 

 

It sounds great I can set the renderer on the fly for the layer that is going to be displayed in the map widget. but I wasted hours trying with no success. it always display the default renderer or the renderer defined in ArcGIS Online(if it's a existing layer).

 

There is no consistent document for the accepting options. ALL you I can do was GUESSING... and there were no examples in place although it says "See example below"

 

There are some examples for the smart mapping 

Smart Mapping | ArcGIS for Developers 

But it only mentions some renderer such as "ClassedColorRenderer", "ClassedSizeRenderer" and "HeatmapRenderer", these are useless to me, I need unique symbols for each feature , which should be the very basic renderer, but I sadly can't figure it out. 

 

Where is the full list of the accepting smart mapping renderers and document for other options for this function?

 

I've tried to piece together information using the following help document, but just not enough...

Renderer objects—Common Data Types | ArcGIS for Developers 

esri/renderers/smartMapping | API Reference | ArcGIS API for JavaScript 3.24 

Generate Renderer (Feature Service)—ArcGIS REST API: Services Directory | ArcGIS for Developers 

 

It's hard to believe such a important document is not available (or not very visible to users), given visualizing data is absolutely an essential part of the whole analysis.

 

Another thing annoys me in the  Smart Mapping | ArcGIS for Developers :

 

To learn more about this exciting capability visit the help page and this blog article. Here is a detailed help on various ways you can symbolize your data.

 

All these 3 links lead the developers to ArcGIS Online document, how can that help a developer using python?? I start wondering whether or not these links are put there by the AI algorithm which I will forgive totally because they can not understand complicated context yet.

 

Back to the topic, Where is the document? if no such document , can ESRI please make some document? by the way, in the document, if mentioning some thing like "see example below" or "see Feature Input in documentation" (in create_buffer function description) , please do remember to put some example or document there.

 

Thanks

Outcomes