FeatureLayer: Invalid JSON

2627
4
Jump to solution
02-07-2017 09:35 AM
AlbertoManero
New Contributor

Hello,

I am trying to add a layer from the URL "Layer: Arbolado de riesgo (ID: 0) " to my map as a FeatureLayer, but I am getting an "Invalid JSON" error when it loads.

It is supposed to be quite easy to load it, something like this:

    FeatureLayer gdbFeatureServiceTable = new FeatureLayer(new Uri("[LayerURL]"));
    _map.OperationalLayers.Add(gdbFeatureServiceTable);

What am I doing wrong?

Reply
0 Kudos
1 Solution

Accepted Solutions
JenniferNery
Esri Regular Contributor

Hi Alberto,

How was this service created? Is this from archived history table? The reason I ask is because it's using a reserved word as its field name 'gdb_archive_oid' so we're unable to create the table. If this field were renamed to something else, it should work. 

I logged an issue on our end to check if there's something we can do about it. Any additional info you can share would help us track how we can prevent this.

Thank you.

Jennifer

View solution in original post

4 Replies
AnttiKajanus1
Regular Contributor II

Hi,

I can confirm that this wont work in Runtime for reason or another. I have passed figuring out why to my team member that hopefully have a bit more time.

You can try to set the renderer to a simple renderer and see if that makes any different.

AlbertoManero
New Contributor

Hello Antti,

I made a try setting a simple renderer, but no luck. Do you have another idea that may help?

Thanks for your help!

Reply
0 Kudos
JenniferNery
Esri Regular Contributor

Hi Alberto,

How was this service created? Is this from archived history table? The reason I ask is because it's using a reserved word as its field name 'gdb_archive_oid' so we're unable to create the table. If this field were renamed to something else, it should work. 

I logged an issue on our end to check if there's something we can do about it. Any additional info you can share would help us track how we can prevent this.

Thank you.

Jennifer

View solution in original post

AlbertoManero
New Contributor

Hello Jennifer,

You where correct, it was the versioning. We made a copy of the feature class and it worked perfectly with the copy.

Thanks for your help!

Reply
0 Kudos