3

I have downloaded the zip file for the Basic Map Viewer (https://github.com/Esri/Viewer) in ArcGIS and am trying to configure the layers to have popups. I've reviewed some of the code behind other applications and have copied the code but have replaced the URLs with my rest services and inserted my fields as well. However, when I launch the application, the popup remains blank. It's showing up, but the data from our server isn't loading in the popup.

This is what I have for the code for one layer:

{
              "url": "http://giswebvm1:81/arcgis/rest/services/INTER_DP/ev_health/MapServer/0",
              "visibility": false,
              "title": "Food Establishments",
              "popupInfo": {
                  "title": "{Name}",
                  "fieldInfos": [
                  {
                      "fieldname": "Est_No",
                      "label": "Establishment Number",
                      "tooltip": "",
                      "visible": true,
                      "stringFieldOption": "textbox"
                  },
                  {
                      "fieldname": "Name",
                      "label": "Establishment Name",
                      "tooltip": "",
                      "visible": true,
                      "stringFieldOption": "textbox"
                  },
                  ],
                  "description": null,
                  "showAttachments": true,
                  "mediaInfos": []
              }
            },

Does anyone know why the popup isn't loading?

It looks like this

Here is the layer service

  • Would you be able to edit your question to make clear whether you are this is the Basic Map Viewer that you are using? It seems to have been renamed to Classic Viewer. – PolyGeo Feb 3 '15 at 21:18
  • Do those fields definitely exist on the layer? When you head to giswebvm1:81/arcgis/rest/services/INTER_DP/ev_health/MapServer/… do you see Est_No and Name listed in the Fields section? – Stephen Lead Feb 3 '15 at 22:44
  • Yes. I made sure and I even tried it with a few different fields that are included in the layer. – Alyssa Feb 4 '15 at 14:25
1

"fieldname" is case sensitive. Correct key name is "fieldName". (uppercase N)

See this example for fieldInfos.

http://www.arcgis.com/sharing/content/items/db7b51510a84452ea2113eceb9a1bfd0/data?f=pjson

  • I deleted the stringFieldOption and the popup has not changed. I made sure that all of the names that are in "fieldname" are exactly as I have them in our server. Would it be easier if you could see that layer information (metadata)? – Alyssa Feb 4 '15 at 14:27
  • Yes that would help – Aamir Suleman Feb 4 '15 at 15:21
  • I added it as an image. Hopefully you can see this if you zoom in. Thank you for looking into this. – Alyssa Feb 4 '15 at 15:24
  • corrected my answer. correct fieldname to fieldName – Aamir Suleman Feb 4 '15 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.