Hi,
I'm trying to create a data expression with ArcGIS Enterprise 11.1 and multiple hosted feature layers with different geometry types (multipoint, lines, polygon)
I want to combine these features into one list and the user can click on it and the map element would zoom and pan to these features.
Sadly, the pan and zoom action does not work. I tried adding the parameter "esriGeometryAny" in line 32 as the geometry type of the combined dictionary but it returned an invalid parameter error.
Pan and zoom only work if I set the parameter as esriGeometry-Multipoint, Polyline or Polygon but it only works for the features with the same geometry as expected.
I can't find any solution in the community. Is this possible? or is returning multiple feature sets with geometry type set to point, line or polygon the workaround (I haven't tested this yet)?
var p = Portal('https:**unspecified**');
var defect_points = FeatureSetByPortalItem(
p,
'83ff17cc88c74db397701135399a3234',
1,
['defect_name','asset_category'],
true
);
var defect_lines = FeatureSetByPortalItem(
p,
'83ff17cc88c74db397701135399a3234',
2,
['defect_name','asset_category'],
true
);
var defect_polygons = FeatureSetByPortalItem(
p,
'83ff17cc88c74db397701135399a3234',
3,
['defect_name','asset_category'],
true
);
var combDict = {
fields: [
{ 'name': 'NAME', 'type': 'esriFieldTypeString' },
{ 'name': 'asset_category', 'type': 'esriFieldTypeString' },
],
geometryType: "",
features: [],
};
var index = 0;
for (var feature in defect_points) {
combDict.features[index++] = {
'attributes': {
'NAME':feature['defect_name'],
'asset_category':feature['asset_category'],
},
geometryType: "esriGeometryMultipoint",
geometry: Geometry(feature),
}
};
for (var feature in defect_lines) {
combDict.features[index++] = {
'attributes': {
'NAME':feature['defect_name'],
'asset_category':feature['asset_category'],
},
geometryType: "esriGeometryLine",
geometry: Geometry(feature),
}
};
for (var feature in defect_polygons) {
combDict.features[index++] = {
'attributes': {
'NAME':feature['defect_name'],
'asset_category':feature['asset_category'],
},
geometryType: "GeometryPolygon",
geometry: Geometry(feature),
}
};
return FeatureSet(Text(combDict))