Identify Links/Identify Widget

2193
21
Jump to solution
02-09-2016 11:10 AM
JasonStanton__GISP
Occasional Contributor

I can't figure out what I am doing wrong.  I want to include an Identify Link (WAB v1.3).  The Link Content is a field and works fine in the Flex version I am transitioning away from.  PopUp Link Type is Text and I have included a Link Alias.  When I try to perform the Identify it comes up with "No Results Found".  If i change the Link Content to a URL it works as expected.  If I delete the Identify Link it will identify features properly.

Looking at it in the Inspector/Console - this is the message, but I don't know what this is 'telling me'.  Any thoughts would be greatly appreciated!

Jason

TypeError: Cannot read property 'type' of undefined(…) "TypeError: Cannot read property 'type' of undefined

    at declare._substitute (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:1434:22)

    at null.<anonymous> (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:1088:31)

    at https://js.arcgis.com/3.15/init.js:167:296

    at Object.g.filter (https://js.arcgis.com/3.15/init.js:220:229)

    at declare.showIdentifyResults (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:923:25)

    at null.<anonymous> (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:702:16)

    at https://js.arcgis.com/3.15/init.js:167:296

    at k (https://js.arcgis.com/3.15/init.js:189:431)

    at q (https://js.arcgis.com/3.15/init.js:189:357)

    at resolve (https://js.arcgis.com/3.15/init.js:191:441)

    ----------------------------------------

    rejected at a (https://js.arcgis.com/3.15/init.js:190:337)

    at k (https://js.arcgis.com/3.15/init.js:190:89)

    at q (https://js.arcgis.com/3.15/init.js:189:357)

    at resolve (https://js.arcgis.com/3.15/init.js:191:441)

    at https://js.arcgis.com/3.15/init.js:819:56

    at k (https://js.arcgis.com/3.15/init.js:189:431)

    at q (https://js.arcgis.com/3.15/init.js:189:357)

    at resolve (https://js.arcgis.com/3.15/init.js:191:441)

    at c (https://js.arcgis.com/3.15/init.js:66:221)

    at d (https://js.arcgis.com/3.15/init.js:66:10)

    ----------------------------------------

Error

    at then.b.then (https://js.arcgis.com/3.15/init.js:192:253)

    at declare.identifyFeatures (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:698:19)

    at declare._onDrawEnd (https://mrmapper.mrpc.org/webapps/HighCrashLocations/widgets/Identify/Widget.js:544:14)

    at null.<anonymous> (https://js.arcgis.com/3.15/init.js:167:296)

    at g.(anonymous function).h [as onDrawEnd] (https://js.arcgis.com/3.15/init.js:234:134)

    at declare._onDrawEnd (https://mrmapper.mrpc.org/webapps/HighCrashLocations/jimu.js/dijit/DrawBox.js:389:12)

    at null.<anonymous> (https://js.arcgis.com/3.15/init.js:167:296)

    at null.<anonymous> (https://js.arcgis.com/3.15/init.js:1204:63)

    at g.(anonymous function).h [as onDrawEnd] (https://js.arcgis.com/3.15/init.js:234:134)

    at H._drawEnd (https://js.arcgis.com/3.15/esri/toolbars/draw.js:18:262)"

0 Kudos
1 Solution

Accepted Solutions
JasonStanton__GISP
Occasional Contributor

Robert, I wanted to let you know that I figured out what was wrong.  When I add the layer to the WebMap it NEEDED to be the specific layer URL (/0).  You had asked the question above, but didn't indicate that one way was correct or incorrect.  I played around with it and was finally able to get it working.  Thank you for all of your help as always!

View solution in original post

0 Kudos
21 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   It sounds like there is an issue handling null values in the link field. Does your data have nulls in the field you are using for the link? Do you have "Disable Lnk if null" checked?

0 Kudos
JasonStanton__GISP
Occasional Contributor

Robert,

Thank you for the suggestion.  There was one null record, but I had tried "Disable Link if null" both ways.  Oddly enough when I update that property in WAB the box is always checked, but the config file gets updated correctly.

Anyway, I populated the null record with a valid URL, but it is still not working.  Then i thought it might be that the URL was http when I force everything through https, so I made the change and it still doesn't work.

Here is a link to the public facing app if it helps.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

  Great I can do some testing on my side using your public facing app. Can you give me some guidence though? What layer, where on the map, etc. is the problem?

0 Kudos
JasonStanton__GISP
Occasional Contributor

Sorry that info probably would help.  The layer is High Crash Locations, the red cars on the map.  All of those have hyperlinks to PDFs that should work.  Thank you!

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

  OK, the issue I see right off is that you have the link set to HYPERLINK1:

"links": {
  "link": [
  {
  "alias": "Click to View Crash Cluster Map",
  "disablelinksifnull": false,
  "disableinpopup": false,
  "popuptype": "text",
  "content": "{HYPERLINK1}",
  "icon": ""
  }
  ]
  }

And your Map Service layer does not have a HYPERLINK1 field. It only has a HYPERLINK field.

Fields:

  • OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )
  • TOWNS ( type: esriFieldTypeString , alias: COMMUNITY , length: 75 )
  • Locations ( type: esriFieldTypeString , alias: Locations , length: 180 )
  • HSIP_ID ( type: esriFieldTypeString , alias: HSIP ID , length: 16 )
  • GROUPCODE ( type: esriFieldTypeString , alias: GROUP CODE , length: 50 )
  • CRASHCOUNT ( type: esriFieldTypeInteger , alias: CRASH COUNT )
  • NUM_FATAL ( type: esriFieldTypeInteger , alias: FATAL CRASHES )
  • NUM_INJURY ( type: esriFieldTypeInteger , alias: INJURY CRASHES )
  • NUM_NONINJ ( type: esriFieldTypeInteger , alias: NON-INJURY CRASHES )
  • EPDO ( type: esriFieldTypeInteger , alias: EPDO POINTS )
  • HYPERLINK ( type: esriFieldTypeString , alias: HYPERLINK1 , length: 200 )
  • Shape ( type: esriFieldTypeGeometry , alias: Shape )
  • HYPERLINK2 ( type: esriFieldTypeString , alias: HYPERLINK2 , length: 150 )
  • LINK_ICON ( type: esriFieldTypeString , alias: LINK_ICON , length: 100 )
  • HYPERLINK1_ALT ( type: esriFieldTypeString , alias: HYPERLINK1_ALT , length: 250 )
0 Kudos
JasonStanton__GISP
Occasional Contributor

The alias for hyperlink is hyperlink1, so when i add it in WAB that is what it comes up as.  Would yopu recommend not using aliases for hyperlink fields?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   Ignore the last reply. I have to many widgets out there and am getting the inner working of them confused. The Identify widget is suppose to use the alias field name in the link... I'll keep looking.

Another question the webMap that this WAB app uses did you add the High Crash Locations using the whole https://mrmapper.mrpc.org/arcgis6443/rest/services/HighCrashLocations/MapServer

or the specific layer url

https://mrmapper.mrpc.org/arcgis6443/rest/services/HighCrashLocations/MapServer/0

This make a difference in my code as to which code path I need to check.

0 Kudos
JasonStanton__GISP
Occasional Contributor
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   A WebMap is an object on AGOL/Portal that points to specific map services to form a map. When using AGOL/Portal to make a WebMap you add layers to the AGOL Map Viewer you can add layers as ArcGISDynamicMapService layers by specifying the map service url without the specific sub layer or you can add the mapservice layer as a FeatureLayer by specifying the url with the sublayer id. This is the question I had above do you know which url you used to add the layer. Unfortunately not being part of your org I can not just go look at the WebMap myself by the webmaps item id "d6155611f82445a29e7c689bec976a67" Like I could if it was my org.

0 Kudos