Hussain Moiz Hussain Moiz - 6 months ago 24
AngularJS Question

Show pin on the map after clicking the custom button on the pop-up

I am using ArcGIS JS API 4.0 with angular. On the pop-up, I have added the custom button More details, On the click of that button i want to show the pin on the map. I dont find much online examples to achieve this, can anybody help?

Answer

You can respond to the trigger-action on the popup and then use the view.popup.location as already mentioned

view.popup.on("trigger-action", function(evt){
  if(evt.action.id === "more-details"){
    // add graphic at view.popup.location
  }
});