popup donot appear sometime

627
6
05-21-2020 02:44 AM
rsharma
Occasional Contributor III

HI

I have been working with 2 sketchviewmodels, my marker plced on markersketchviewmodel, do not show markers popup when polygon below them are in editable mode. However some nearby markers that come under that markersketchviewmodel polygon also not show popup when zoom out.


        // This function is called when a user clicks on the view.
        function setUpGraphicClickHandler() {
          view.on("click", function(event) {
            view.hitTest(event).then(function(response) {
              var results = response.results;
              console.log(results);
            if(results.length === 0){
              sketchViewModel.complete();
               markersketchViewModel.complete();
            }
              // Check if the new development graphic and temp graphics with attribute named newDevelopment was clicked and pass
              // the graphic to sketchViewModel.update() with reshape tool.
              results.forEach(function(result) {
                //console.log(result);
                if (
                  result.graphic.layer === sketchViewModel.layer &&
                  result.graphic.attributes &&
                  result.graphic.attributes.newDevelopment
                ) {
                  sketchViewModel.update([result.graphic], { tool: "reshape" });
                } else if(
                  result.graphic.layer === markersketchViewModel.layer &&
                  result.graphic.attributes &&
                  result.graphic.attributes.newDevelopment){
                 markersketchViewModel.update([result.graphic], { tool: "reshape" });
                }
                else if(sketchViewModel.state !== 'active'){
                  sketchViewModel.cancel();
                  if( result.graphic.attributes &&
                  result.graphic.attributes.newDevelopment){
                  view.popup.open({features: [result.graphic], location: result.graphic.geometry});
              }
                }  else if(markersketchViewModel.state!== 'active'){
                   markersketchViewModel.cancel();
                   if( result.graphic.attributes &&
                  result.graphic.attributes.newDevelopment){
                  view.popup.open({features: [result.graphic], location: result.graphic.geometry});
              }
                }
              });
            });
          });
        }//End setUpGraphicClickHandler

0 Kudos
6 Replies
rsharma
Occasional Contributor III

Please refer above image , once yellow polygon of markersketchview model become editable when i first time click oin it to show popup, after that this step marker do not show popup, until i click outside to make it uneditable

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

That is by design and I am not aware of a way to change that.

0 Kudos
rsharma
Occasional Contributor III

Sir

Can't i change anything in this code, so that it works for editable mode also.

else if(markersketchViewModel.state!== 'active'){
                   markersketchViewModel.cancel();
                   if( result.graphic.attributes &&
                  result.graphic.attributes.newDevelopment){
                  view.popup.open({features: [result.graphic], location: result.graphic.geometry});
              }
                }

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Not that I am aware of. The issue is that when the polygon is editing the point will not receive the click event.

So view.popup.open({features: [result.graphic], location: result.graphic.geometry}); the result.graphic is the polygon and not the point.

rsharma
Occasional Contributor III

Sir,

I think this truely annoys a user, if they have to see the popup and as i am using the edtiable polygons, this will not make my application smooth.

ESRI should proviode a way to deal with it.

Actrually it not even receive a click event on it.

same case arise when i try to place markers on editable polygons, sometimes it works good, but sometimes i not even able to place a marker on my editable polygon, this is because that place is not even clickable and not receive anything in console at the time of placing it the below function


        function setUpGraphicClickHandler() {
          view.on("click", function(event) {
            view.hitTest(event).then(function(response) {
              var results = response.results;
              console.log(results);
            if(results.length === 0){
              sketchViewModel.complete();
               markersketchViewModel.complete();
            }

this console donopt work when i place markers on editable polygon sometimes, but sometimes, it works fine

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

If contact your local esri support office and see if they will open a support case for you on this.