hi Im trying to adjust the example ShowVertex feature action to suite my porposes by adding another feature action to the demo widget and send the name and ID of a feature to the widget.
I have , heres my feature action code
define([
'dojo/_base/declare',
'jimu/BaseFeatureAction',
'jimu/WidgetManager'],
function(declare, BaseFeatureAction, WidgetManager){
var clazz = declare(BaseFeatureAction, {
iconFormat: 'png',
isFeatureSupported: function(featureSet){
return featureSet.features.length > 0 && featureSet.features[0].geometry.type !== 'point';
},
onExecute: function(featureSet){
WidgetManager.getInstance().triggerWidgetOpen(this.widgetId)
.then(function(myWidget) {
var id
var name
featureSet.features.forEach(function(f){
id = f.id
name = f.name
});
myWidget.AddtoSelected(name,id);