serialize wkt to json

830
1
10-22-2012 12:35 PM
KevinGooss
Occasional Contributor
I have a custom projection so i'm trying to use wkt instead of wkid.
I see in the js api docs that they provide an example template for wkt.
Problem is that when i use that format i get a json serialization error and the Post is never even handled.
I'm trying to post to a 10.1 REST api endpoint to AddFeatures.
If i drop the spatial reference i get errors from Oracle about sr issues.
So i think i need it but i'm packaging the sketched feature from the api into my own payload going to the server and i think that is where the serialization is getting disrupted.

json is picky about double and single quotes.
Anyone experience this issue and know some kind of workaround? Like maybe tacking the spat ref on just before the request is sent or something like that? Or maybe another way to create the wkt in js?

Also is it possible to create my own custom spat ref on the server so that i do have a wkid (albeit a custom one that i create)?
0 Kudos
1 Reply
JeffJacobson
Occasional Contributor III
Try pasting your JSON request into jslint.
0 Kudos