Hello Everyone,
We are writing with reference to the example of generating a client side chart for an image service as per the following sample (ImageryLayer - client side chart ).
Essentially we wold like to use this feature with an uploaded shapefile rather than a mouse event (click & drag).
We were referring to the following sample (Feature Layer from Shapefile ) where a a feature layer is created from an uploaded shapefile.
It seems the following snippet returns the feature layer and draws them on the map :
var layers = featureCollection.layers.map(function (layer) {
var graphics = layer.featureSet.features.map(function(feature){
return Graphic.fromJSON(feature);
})
sourceGraphics = sourceGraphics.concat(graphics);
var featureLayer = new FeatureLayer({
objectIdField: "FID",
source: graphics,
fields: layer.layerDefinition.fields.map(function(field) {
return Field.fromJSON(field);
})
});
return featureLayer;
// associate the feature with the popup on click to enable highlight and zoom to
});
map.addMany(layers);
Is it possible to use the layers output as outline to query the pixels and generate the fragmentation charts?
It seems that we might have to replace the followng event snippet in the createLandCoverchart() :
removeChartEvents = view.on(["drag", "click"], function (event) {
if (pixelData) {
event.stopPropagation();
getFragCoverPixelInfo(event).then(updatefragCoverChart);
}
});
and then replace the whole buffer calculation for the circle graphic:
removeChartEvents = view.on(["drag", "click"], function (event) {
if (pixelData) {
event.stopPropagation();
getFragCoverPixelInfo(event).then(updatefragCoverChart);
}
});
Please do let us know if this is possible and if there is a correct way to have this feature.
Thanks !🙂