Is there a JSON expert here? please I need help !

1165
3
Jump to solution
07-03-2018 06:37 AM
IreneEgbulefu1
New Contributor III

I am trying to modify the JSon code from Esri to enable me use my offline map on my survey 123 for ArcGIS design "http://doc.arcgis.com/en/survey123/desktop/create-surveys/preparebasemaps.htm"

But I am having issues with the validation, I am just stuck on one '{'

I am not very good with JSON syntax and I need to get the syntax right for the script to work. I would appreciate if anyone can spare a few seconds to look at the script and help me find what I'm not doing right.

{
 "displayInfo": {
  "map": {
   "coordinateFormat": null,
   "defaultType": {
    "name": null
   },
   "home": {
    "latitude": 30.358219056799644,
    "longitude": -97.89650653945787,
    "zoomLevel": 11.2009
   },
   "preview": {
    "coordinateFormat": null,
    "zoomLevel": 0
   }
  },
  "style": {
   "backgroundColor": "#bfaac8",
   "backgroundImage": null,
   "inputBackgroundColor": null,
   "inputTextColor": "#000000",
   "textColor": null,
   "toolbarBackgroundColor": "#000000",
   "toolbarTextColor": "#5500ff"
  }
 },
 "imagesInfo": {
  "captureResolution": 320
 },
 "publishInfo": {
  "connectVersion": "2.8.4",
  "webFormTransform": true
 },
 "queryInfo": {
  "applySpatialFilter": true,
  "mode": "",
  "where": ""
 },
 "displayInfo": {
  "map": {
   "mapTypes": {
    "append": false,
    "includeLibrary": false,
    "mapSources": [{
     "name": "Steiener Ranch Test Map",
     "url": "http://traviscountytx.maps.arcgis.com/home/item.html?id=f4770fd5211c49719fa567aeae6f8435",
     "storeInMapLibrary": false
    }]
   }
  }
 },
 "sentInfo": {
  "enabled": true
 },
 "serviceInfo": {
  "itemId": "cd3fe79db7014e8db966833350bb21a2",
  "type": "Feature Service",
  "url": "https://services1.arcgis.com/HGcSYZ5bvjRswoCb/arcgis/rest/services/service_6ea10ff2bb15486aa6d943c2c..."
 }
}

Here is the error from JSON Validator (Screenshot)

Screenshot of Error from JSON Validator

0 Kudos
1 Solution

Accepted Solutions
SMauri
by
Occasional Contributor III

Hi Irene,

let me ask you why you don't use this method: Include your tile package in a survey—Survey123 for ArcGIS | ArcGIS .

Here 3 simple steps:

  1. load your map (Steiener Ranch Test Map) in ArcGIS Pro
  2. create Map Tile package using this tools: Create Map Tile Package—Data Management toolbox | ArcGIS Desktop 
  3. add map tile package (tpk) to the media folder in your survey's content folder before publishing

That's all...and it's more easy than editing a Json file.

Anyway...in a Json file you must have a unique "key value"...instead you have 2 "displayInfo" key in your Json

Cheers

Stefano

View solution in original post

3 Replies
SMauri
by
Occasional Contributor III

Hi Irene,

let me ask you why you don't use this method: Include your tile package in a survey—Survey123 for ArcGIS | ArcGIS .

Here 3 simple steps:

  1. load your map (Steiener Ranch Test Map) in ArcGIS Pro
  2. create Map Tile package using this tools: Create Map Tile Package—Data Management toolbox | ArcGIS Desktop 
  3. add map tile package (tpk) to the media folder in your survey's content folder before publishing

That's all...and it's more easy than editing a Json file.

Anyway...in a Json file you must have a unique "key value"...instead you have 2 "displayInfo" key in your Json

Cheers

Stefano

IreneEgbulefu1
New Contributor III

Thank you so much Stefano. Your suggestions were very correct and very helpful

0 Kudos
JamesTedrick
Esri Esteemed Contributor

As Stefano says, you have 2 'displayInfo' sections.  You should combine them together to make one section:

"displayInfo" : {

"map": {
   "coordinateFormat": null,
   "defaultType": {
    "name": null
   },
   "home": {
    "latitude": 30.358219056799644,
    "longitude": -97.89650653945787,
    "zoomLevel": 11.2009
   },
   "preview": {
    "coordinateFormat": null,
    "zoomLevel": 0
   },

"mapTypes": {
    "append": false,
    "includeLibrary": false,
    "mapSources": [{
     "name": "Steiener Ranch Test Map",
     "url": "http://traviscountytx.maps.arcgis.com/home/item.html?id=f4770fd5211c49719fa567aeae6f8435",
     "storeInMapLibrary": false
    }]
   }

}