Identify Widget Version 2.21 - 11/16/2021

252566
524
02-23-2015 05:20 PM
Labels (1)

Identify Widget Version 2.21 - 11/16/2021

Live Preview Site

Web AppBuilder for ArcGIS | Help - Identify Widget

 

List of the latest enhancements and changes:

  1. Added 10 max rows max display to widgets dropdowns.
  2. Fixed a mixed protocol issue in code

Previous enhancements and changes:

  Check the "Older enhancements or changes.txt" in the download for a complete list.

 

Older Versions

Last 2.4 version

Last 2.5 version

Last 2.7 version 

Last 2.8 version 

Last 2.9 version 

Last 2.10 version

Last 2.11 version

Last 2.12 version

Last 2.13 version

Last 2.14 version

Last 2.15 version

Last 2.17 version

 

ATTENTION:

  1. If you are hosting this widget on a https server, then make sure you change all your excludelayer urls to https. Failure to do so will result in widget failure.

 

Features:

  • Specify which layers are to be identified
  • Format the fields for identify layers
  • Configure links and link icon
  • Close result popups after a number of seconds of losing focus
  • Choose which layer to identify in the widget UI using drop down list
  • Specify layers to be excluded from identify operation
  • Choose to only identify configured layers
  • Replace null values with empty strings
  • Configure default symbology for identify results
  • Specify Visible, Top, or All layers to be identified.
  • Option to Keep Identify Active
  • All Identify geometry types are configurable
  • Option to use map time
Labels (1)
Attachments
Comments

What sort of problem would cause "No Results Found" for a layer when the identify widget is used and a feature is clicked on? For some reason, layers I add now won't identify, but layers I have in a previous version of my app work. 

Nick,

   Have you configured the identify widget for that layer?

Yes, through the WAB interface. Even no configuration (all fields) doesn't seem to show up anything. The REST URL is valid and looking at the json, I can't detect a difference between a working layer and a nonworking layer there. Is it possible something in Portal is causing this issue?

Nick,

   Can you start a new thread (so that you can attach your config for the identify widget) and I can have a look.

Just a suggestion for the widget future release, I was wondering if there was a way to identify just a group of services, for instance in the drop down you could have them grouped into categories.

Leo,

   There would be quite a bit of development work in that. I will consider it.

Fair enough, thanks for your efforts Robert.

Does this work well with the newly released 2.2 version? It seems to be working for me except it is returning all fields, not just the fields I added when configuring. Also, the Identify Links configuration does not seem to be working either, none of the links are showing up.

Thanks for any updates you may provide!

Patrick,

  Did you upgrade an app to 2.2 or create a new one?

I created a brand new app.

Sent from my iPhone

Patrick,

Make sure the main config.json where the "Identify Widget" parameters are is pointing to the appropriate location of the config_identify.json?

Baba

Patrick,

   Strange I am not seeing that at all on my end.

Thanks Robert, I was able to figure it out. I did not have the ‘Only These’ checkbox checked. Once I checked that checkbox, my custom settings were enabled.

Thanks for the assistance, and for this great widget!!

Hi there, I would like to ask, if is possible to use this widget for tiled map services (cached). If not, is there any alternative widget? Thanks guys. #tiled services#identify pop up#cached service#map cache#javascript widget*

Thomas,

   Yes, you can. As long as the map service supports identify you are good to go:

Supported Operations:   Export Map   Identify   Find

Hi Robert,

I'm using ID widget 2.1 in a WAB Dev 2.2 app with LocalLayer widget.  I noticed that if a sublayer in a dynamic map layer has a scale visibility range set in the mxd prior to publishing, the ID widget will show results for that sublayer even when the sublayer isn't displayed due to current viewing scale (when that sublayer is grayed out in the LayerList).  Do you also see this behavior?  If so, perhaps there is a ID widget config (or even in LocalLayer widget config) setting I am missing that would change the behavior?  Currently the ID widget is configured to show results for visible layers.

Interestingly, the issue only occurs when I am zoomed in beyond the maximum visible scale for the sublayer.  If I am zoomed out beyond the minimum visible scale for the sublayer, no ID widget results are shown (this is good).

This behavior is not present in Flex using your ID widget for Flex, which only displays ID results for visible layers that are "on" (not grayed out) in Layer List. 

The issue also occurs with a locally-hosted WAB Dev 2.2 app which calls an AGOL Web Map (LocalLayer widget not used, but ID widget is). 

I have an active, public app that you can use to see this behavior if you want.

Cheers,

Barnaby

P.S.: I'm running Server 10.5, if it matters...

Barnaby,

   I will have to look into it.

Hey Robert, hope things are well.  Thanks for your hard work on this great widget.  I wanted to let you know of a bug I've run into; When the widget is configured to Identify a layer within a MapService whose Unique subLayer IDs don't correspond with their position within the Layer List, problems appear to arise.  For example, if I had a MapService with a collection of sublayers like the following:

Layers:

  • SubLayer0 (4)
  • SubLayer1 (1)
  • SubLayer2 (2)

Unfortunately, I don't have a public service you can test to prove this on your end; You'd need to fiddle with an existing service to ensure that those Unique Layer Ids are preserved when the layers get reordered within the MXD.  I've tracked the bug to the removeGroupLayers section of Widget.js, though the problem is likely stemming from some deeper interactions.  I find that if I change the function as follows, which will return all Sublayers within the service that aren't grouplayers, some code further down the line seems to result in the correct operation of the widget, but there's probably a 'better' fix you could apply in a future release of the widget.

removeGroupLayers: function(subLayers, layer) {
   var newSubLayers = [];
   //for (var i = 0; i < subLayers.length; i++) {
   for (var j = 0; j < layer.layerInfos.length; j++){
      //if (layer.layerInfos.id == subLayers && layer.layerInfos.subLayerIds === null){
      if (layer.layerInfos.subLayerIds === null){
         //newSubLayers.push(subLayers);
         newSubLayers.push(layer.layerInfos.id)
      }
   }
   //}
   return newSubLayers;
},

As you can see, the original code assumes that the position of the element within the subLayers array will be the same as the ID value for that layer, which will not be the case in a service with non-sequential IDs.  Hopefully this is enough info to go on; Let me know if there's any additional information you need!

Adam,

  Nice catch. I have never had a map service with it's sublayer ids out of wack like that so it has never been an issue. But it seems like I remember someone having this issue with their map service before. I think the location and the changes you made are fine so if I can get Barnaby Rockwell‌ to test and it works then I will add this change to the next release.

I entered Adam's new code into the widget.js of a deployed app, and the ID results show entries for every sublayer of a huge MapService, even if those sublayers are not visible (not clicked ON in Layer List: visibility settings set in mxd prior to publishing). Results are also shown for every sublayer (visible or not) in every service (layer) which is turned on in the app, not just the huge MapService. 

So it appears that the new code creates serious problems for me. In another geographic area, the ID widget hangs when I click on the map.  Not good. 

My huge MapService (100s of sublayers), is one of many layers in the Layer List, so I think that the MapService unique subLayer IDs don't correspond with their position within the Layer List, if I am understanding what Adam is referring to.

Edit:  note that I did not edit the app or change the ID widget config, I just added the new code to the ID widget.js.

I believe I had this issue, when turning on the group layer and not the sublayer, the widget wouldn't work correctly.

This looks like a really great widget, however, I have one question.  Will this work on secured services?  I have a secured service but I put the info in the URL and it can't find it, when I use a non secure one it works.  I didn't see anything about secure services in the documentation and was wondering if maybe there was a workaround for using them.

Jeff,

  Yes secure layers work just fine with the Identify widget. If you are already logged in as a user that has access to that layer then you can add the layer to the widgets settings UI and identify the layer just fine. When using the app and the user is not logged in then the identity manager will challenge the user for credentials. 

Barnaby,

   I am working on the 2.3 release and would like to look into your issue can you PM me the url and basic instructions to replicate the issue?

Hi Robert,

PM sent.

Cheers,

Barnaby

Barnaby,

  Try this updated function in the widget.js:

      createIdentifyParams: function (layers, geom) {
        var identifyParamsList = [];
        array.forEach(layers, lang.hitch(this, function (layer) {
          var identifyParams = new IdentifyParameters();
          identifyParams.width = this.map.width;
          identifyParams.height = this.map.height;
          identifyParams.geometry = geom;
          identifyParams.tolerance = this.identifytolerance;
          identifyParams.mapExtent = this.map.extent;
          identifyParams.returnGeometry = this.returngeometryforzoom;
          if (this.usemaptime && this.map.timeExtent !== null){
            identifyParams.timeExtent = new TimeExtent(this.map.timeExtent.endTime, this.map.timeExtent.endTime);
          }
          if(this.identifylayeroption === 'visible'){
            identifyParams.layerOption = 'all';
          }else{
            identifyParams.layerOption = this.identifylayeroption;
          }

//RJS 10/7/16 - Use the WAB layerInfo vlass to see if the layer/sublayer is visible and visible at the maps scale
//              Old way just used the map services default layer visibility
          // var visLayers = layer.visibleLayers;
          // if (visLayers && visLayers !== -1) {
          //   var subLayers = visLayers;
          //   if(subLayers.indexOf(-1) !== -1){
          //     subLayers.splice(subLayers.indexOf(-1), 1);
          //   }
          //   identifyParams.layerIds = this.removeGroupLayers(subLayers, layer);
          // } else {
          //   identifyParams.layerIds = [];
          // }

          var vsl = [];
          var layerInfosObject = LayerInfos.getInstanceSync();
          var li = layerInfosObject.getLayerInfoById(layer.id);

          array.map(li.newSubLayers, function(lyr, indx){
            if(Boolean(li.subLayerVisible[indx])){
              if(lyr.isInScale()){
                vsl.push(indx);
              }
            }
          });
          identifyParams.layerIds = vsl;
//End of change
          identifyParamsList.push(identifyParams);
        }));
        return identifyParamsList;
      },

Robert, with that code, I get no ID results at all for any layer.  Widget just hangs and chugs.....  But I did not edit app or update ID widget config, just added the code to the widget.js.

Barnaby,

Sounds like you might have introduced a syntax error. What does your browsers web console say?

widget [widgets/Query/Widget] created.  WidgetManager.js:112:21
ReferenceError: LayerInfos is not defined[Learn More]  Widget.js:767:15
    .createIdentifyParams/< http://myserver/usminmaplocal2.3test/widgets/Identify/Widget.js:767:15
    .cache["dojo/_base/lang"]/</e.hitch/< http://js.arcgis.com/3.19/init.js:63:207
    .cache["dojo/_base/array"]/</e.forEach http://js.arcgis.com/3.19/init.js:70:383
    .createIdentifyParams http://myserver/usminmaplocal2.3test/widgets/Identify/Widget.js:736:9
    .identifyFeatures http://myserver/usminmaplocal2.3test/widgets/Identify/Widget.js:683:22
    ._onDrawEnd http://myserver/usminmaplocal2.3test/widgets/Identify/Widget.js:547:9
    .cache["dojo/_base/lang"]/</e.hitch/< http://js.arcgis.com/3.19/init.js:63:207
    k/</c http://js.arcgis.com/3.19/init.js:119:70
    ._onDrawEnd http://myserver/usminmaplocal2.3test/jimu.js/dijit/DrawBox.js:483:7
    .cache["dojo/_base/lang"]/</e.hitch/< http://js.arcgis.com/3.19/init.js:63:207
    .cache["esri/Evented"]/</r<._onArr2Obj/< http://js.arcgis.com/3.19/init.js:646:175
    k/</c http://js.arcgis.com/3.19/init.js:119:70
    h<._drawEnd http://js.arcgis.com/3.19/esri/toolbars/draw.js:18:257
    h<._onClickHandler http://js.arcgis.com/3.19/esri/toolbars/draw.js:31:324
    .cache["dojo/_base/lang"]/</e.hitch/< http://js.arcgis.com/3.19/init.js:63:207
    k/</c http://js.arcgis.com/3.19/init.js:119:70
    .cache["esri/MouseEvents"]/</r<._fire http://js.arcgis.com/3.19/init.js:1276:13
    .cache["esri/MouseEvents"]/</r<._fireClickEvent http://js.arcgis.com/3.19/init.js:1282:130
    .cache["dojo/_base/lang"]/</e.hitch/<

I'll check the syntax again now.

Edit:  no obvious syntax errors introduced...

Barnaby,

  Ahh. My mistake you need to add the new require:

....
        'jimu/WidgetManager',
        'jimu/PanelManager',
        'jimu/LayerInfos/LayerInfos',
        'dijit/form/Select'],
  function (declare, _WidgetsInTemplateMixin, BaseWidget, TabContainer, List, IdentifyTask, IdentifyParameters,
    IdentifyResult, Message, Query, QueryTask, CodedValueDomain, Domain, GraphicsLayer, FeatureLayer, FeatureType, Field,
    RangeDomain, GeometryService, esriConfig, Graphic, graphicsUtils, Point, SimpleMarkerSymbol,
    PictureMarkerSymbol, Polyline, SimpleLineSymbol, Color, Polygon, Multipoint, Extent, Geometry, SimpleFillSymbol,
    SimpleRenderer, Draw, PopupTemplate, esriRequest, TimeExtent, Deferred, ProgressBar, lang, on, aspect, html, array,
    all, date, locale, DrawBox, utils, LoadingShelter, ioquery, SpatialReference, ProjectParameters, webMercatorUtils,
    WidgetManager, PanelManager, LayerInfos) {

It seems now that ID widget results are being reported for every sublayer in ESRI 2016 Geographic Data even if they are not turned on in Layer List -  some are on but overlying group layer is turned off so they are not displayed in app. 

Results are also being reported for layers in other services (layers) that are turned off in the app.

But, I think that the visible scale issue has been resolved.  ID results are not shown for "out-of-scale" layers.  More testing needed, though, as so many results are returned given the above issue that it is hard to tell clearly if the scale issue has been fixed or not.

A clarification of the above:

Results are being reported for sublayers that are turned off in the app when the overlying base layer (service) is turned on.  If a base layer (service) is turned on, ID widget results are being reported for all underlying sublayers, even if those sublayers are turned off.

Added note: I have only tested new ID widget code in an app that uses LocalLayer widget.

Hi Robert,

Using new test code, I'm also finding a situation where the ID widget is not reporting results for sublayers which are in-scale and visible in the app.  ID widget will not show results for the four visible sub-layers highlighted in the image below.  Keep in mind that I did not modify the existing ID widget config.

Robert,

How did you make it so that the Point tool is active even after the results load and is available for more identify operations? The default Query tool behavior is that once a feature is selected with one of the draw tools and results appear, you have to go back and re-select the draw tool.

Thanks for any help!

Roy,

  In my widget I tell the DrawBox to not deactivate after drawing:

For the Query widget you would have to modify the 

SpatialFilterByDrawing.js

by adding this line after the darwBox is constucted.

this.drawBox.deactivateAfterDrawing = false;

Hello Robert Scheitlin, GISP‌, I've just discovered that when I mark fields in the "Popup Only" inside the endot identify layer - window options, the fields I choose are the one that does NOT show up in the results when using the widget... Is that the right behaviour? isn't it supposed to be the other way around?

I hope I was clear enough in my explanation.. here's a screenshot of what I mean.. notice the blue circle in the right where I chose 1 field and the blue circle in the left which shows that in the results popup, my selected field is hidden.. I thought that the title "popup only" in the "include fields" section should indicate those fields are the only one to show up..

Thanks,

Shay.

Shay,

   What is meant by "Popup Only" is the map Popup not the Widget results tab. So when you check popup only it will remove the field from the widget results tab and only show that field in the maps popup when the map popup is shown.

Thanks that makes sense now. Isn't there an option to filter out some fields from the results and popup windows?

Regards,

Shay,

Shay,

  If you want to not use an attribute in both then you just don't add the field to the fields collection. There is not an option to have a field in the results list of the widget but not the popup (if that is what you are asking for).

Ok got it. Thanks again.

Shay.

Thanks Robert!

Hello Robert,

This widget looks great, but I am having a few issues.  Can I add layers from another map service than what I am using in the map?  I am trying to do that but I only get results from layers that are in the map.  If I choose a layer from the drop down list, I get no results, I have to choose "all layers" then I get results but they are only layers that are on the map and not the ones I added (kind of like how the id popup works that comes standard with the web apps).  This even happens if I put in a layer from the same map service that I am using for the map, for instance I added an ID layer called "Gilbert Hydrants" with specific fields to return, when I ID the map (with the dropdown set to all layers) I get results from the hydrant data but the name is "Water Hydrants", which is what it is called in the map service that the map uses, so I can tell it's not returning results from the layer I configured, but from the map itself.

I appreciate your creating these widgets for our use, and for any help you could provide.

Thank you,

Jeff

Jeff,

   So are you saying that you are adding layers at runtime?

No not adding them at runtime, just setting up the app like in the instructions, adding services and layers. I am adding some of the layers from a different service that the one that the map is using, however, I have also tested with the same service that the map is using. I even tried adding the layers to the config.json file instead of through the interface. It looks like the widget only will identify what the normal popup tool that is standard with webappbuilder will do, it doesn’t recognize the layers that I put in.

Jeff,

  OK, so if you are adding layers to the Identify Widget using the settings UI those layer need to be added to the webmap also. The identify task identifys layer that exist in the map not like the querytask that will work regardless of the layer is part of the map or not.

Robert,

Thank you so much for the help, I did get it to work on a test map I put together. I will check out the querytask also, between the two I might be able to get done what I have to do…

Thanks again Robert,

Jeff

Hi Robert,

Thanks for this nice widget. While I was trying this on a raster layer, it is only returning a single point feature irrespective of number of overlapping pixels. I think it is probably the centroid? Anyway to easily have the results show all the overlapping raster pixel values?

Thanks! 

Ravi,

   Are the overlapping pixels in different raster layers and are they all visible?

Hi Robert,

I am dealing with a single raster layer (visible) with different pixel values along the line/polygon I draw. The widget is currently getting the pixel value intersecting the line's/polygon's centroid. I am trying to fetch all the pixel values along that drawn feature. 

Thanks! 

Ravi,

   Hmm. that seems like it is not supported by the IdentifyTask then.

Version history
Last update:
‎11-16-2021 06:51 AM
Updated by: