sdf.spatial.to_feature_collection(..., drawing_info=)

326
1
Jump to solution
04-12-2020 09:39 AM
artzaifman
New Contributor III

Using latest arcgis python libs and jupyter etc...

Has anyone successfully called GIS().map().add_layer(feature class object) when the feature class object creation specified a drawing_info=?

Everything succeeds until the map is rendered and then the following error is triggererd: TypeError: undefined is not an object (evaluating 'x.drawingInfo.renderer.type')

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
artzaifman
New Contributor III

The "solution" (in my case) is:

   temp = fc_m.properties["layerDefinition"]["drawingInfo"]
   fc_m.properties["layerDefinition"]["drawingInfo"] = {"renderer": ""}
   fc_m.properties["layerDefinition"]["drawingInfo"]["renderer"] = temp

where "fc_m" is

   fc_m = sdf_m.spatial.to_feature_collection(name="foobar")

This appears to be a BUG since "drawing_info=" option to "to_feature_collection()" does NOT create the "renderer" tag but ONLY "drawingInfo"

View solution in original post

0 Kudos
1 Reply
artzaifman
New Contributor III

The "solution" (in my case) is:

   temp = fc_m.properties["layerDefinition"]["drawingInfo"]
   fc_m.properties["layerDefinition"]["drawingInfo"] = {"renderer": ""}
   fc_m.properties["layerDefinition"]["drawingInfo"]["renderer"] = temp

where "fc_m" is

   fc_m = sdf_m.spatial.to_feature_collection(name="foobar")

This appears to be a BUG since "drawing_info=" option to "to_feature_collection()" does NOT create the "renderer" tag but ONLY "drawingInfo"

0 Kudos