Modify Identify Widget

1256
12
Jump to solution
06-11-2018 07:10 AM
HelenZhou
Occasional Contributor II

Hello Robert,

I am not sure if this is the right place to ask you questions. I would like to ask you the question directly. I really like your identify widget (Identify Widget Version 2.7 - 02/23/2018 )..I have a question in using the widget.

In the configuration, i use cyan color for polygon boundary and hollow for polygon fill. When identify a feature,  I choose all layers to be identified, I highlight the tax parcel in the identify result panel, the map is zoomed to my parcel with parcel is highlighted. Since I select identify all layers, the zoning polygon is highlighted. The highlighted zoning polygon and taxparcel polygon is mixed together, which is kind of misleading (see attached screen shot. What kind of customization can I do to highlight only the taxparcel feature when taxparcel is selected in the identify window? I would like to have "All Layers" identified. I am about the do the customization, since it is developed by you, can you give me a direction? Thanks so much.

Helen

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Helen,

   OK that makes a lot more sense. Here is the code change for that:

      showInfoWin: function (idResult) {
        array.map(this.graphicsLayer.graphics, lang.hitch(this, function(gra){
          gra.hide();
        }));
        idResult.graphic.show();
        // if (this.map.infoWindow) {
        //   idResult.graphic.setInfoTemplate(this._configurePopupTemplate(idResult));
        //   this.map.infoWindow.setFeatures([idResult.graphic]);
        //   if (this.map.infoWindow.reposition) {
        //     this.map.infoWindow.reposition();
        //   }
        //   this.map.infoWindow.show(idResult.centerpoint);
        // }
      },

View solution in original post

12 Replies
RobertScheitlin__GISP
MVP Emeritus

Helen,

   When I hover over a identify result the the infowindow appears and the polygon is highlighted where it is different from the other overlapping polygon. Do you have the widget configured to not show the info window?

0 Kudos
HelenZhou
Occasional Contributor II

Hi Robert,

Users don't want the pop up window shows up, so I comment out the following section in the widget.js file. I am checking to see if the code can be customized so that only the tax parcel feature is highlighted when the taxparcel is selected in the identified panel -no other overlapping features are highlighted. Thanks

Helen

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Helen,

  OK. That is a pretty strange request. You want Identify all put if the taxparcel layer is found then throw away all other results and just show tax parcel results?.. If that is the case then why not just select TaxParcel from the identify layers dropdown?

0 Kudos
HelenZhou
Occasional Contributor II

Sorry, Robert. I may have given you confused information. The reason we want identify all features is - our layers are added dynamically so we can't per-configure almost 100 layers. The request is when all layers are identified, identified results are loaded in the identify information panel(current design is good with us for this part). Only the feature is highlighted when that feature's identify result is selected. That is to say, when taxparcel is selected in the identified list panel, all graphices are cleared except the one for the identified taxparcel feature. Same to zoning - When zoning feature is selected in the identified result panel, only the identified zoning feature is highlighted. In that way, the overlapping feature will not give users misleading vision in the map. Do you have any direction that where i can start working on the customization?

Thanks

Helen

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Helen,

   OK that makes a lot more sense. Here is the code change for that:

      showInfoWin: function (idResult) {
        array.map(this.graphicsLayer.graphics, lang.hitch(this, function(gra){
          gra.hide();
        }));
        idResult.graphic.show();
        // if (this.map.infoWindow) {
        //   idResult.graphic.setInfoTemplate(this._configurePopupTemplate(idResult));
        //   this.map.infoWindow.setFeatures([idResult.graphic]);
        //   if (this.map.infoWindow.reposition) {
        //     this.map.infoWindow.reposition();
        //   }
        //   this.map.infoWindow.show(idResult.centerpoint);
        // }
      },
HelenZhou
Occasional Contributor II

Thanks Robert. Yes, it works!!

0 Kudos
JeremyDew
New Contributor III

Robert,

Would it possible to make this same change to your Enhanced Search widget results?

Thanks,

Jeremy

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jeremy,

  That is a pretty confusing request as the eSearch is only searching one layer and there are not multiple layers highlighted as in the Identify widgets case...

0 Kudos
JeremyDew
New Contributor III

Sorry I should have been more clear, and you're correct this is a bit different than the original request.

When multiple features are returned for the searched layer I was curious if there was a way to "highlight" only the feature that you hover over in the results pane. I am using the Popup Panel widget in my app and not the default popup, so when a user hovers over a feature in the results pane they do not know which feature on the map they are hovering over. Since they can simply click on the result and zoom into the feature this is not a major need, just curious if it might be possible. Thanks

0 Kudos