I have been building a map interface that loads road networks from ArcGIS Server. One of the requirements is to display current road works.
We have an existing application that records locations and extent of road works. This road works app uses Geoserver as the layer repository.
dojo.js:249 [esri.widgets.FeatureViewModel] error loading template SyntaxError: Unexpected number in JSON at position 1
at JSON.parse (<anonymous>)
at b (dojo.js:258)
at Object.<anonymous> (dojo.js:263)
at String.replace (<anonymous>)
at Object.replace (dojo.js:44)
at Object.substitute (dojo.js:263)
at Object.c._compileText (FeatureViewModel.js:12)
at Object.c._compileContent (FeatureViewModel.js:8)
I finally tracked it down to a style element within the html of the popup created in Geoserver. This was defined in the content.ftl of the layer as follows:
background-color: rgba(178, 125, 32, 1);
Changing the style to this:
Resolves the issue.
Tracing through the code dojo is attempting to parse the value rgba(178, 125, 32, 1); as JSON. A regular expression within the code was stripping the rgba text and parentheses leaving 178 as the first key/value pair which is subsequently rejected as invalid.
This brings me to the reason for posting this. I spent several days trying to find information about this problem with no success. so hopefully it might be usefull for someone else trying to add non ArcGIS WMS layers.