chuaszukun

Using WCF service on esrilayerfeatures using JSON Format

Discussion created by chuaszukun on Apr 9, 2013
Latest reply on Apr 11, 2013 by chuaszukun
Hi guys, i currently working on a project on Geo-spatial heatmap and it require web services to function.I was able to generate similar JSON format require for esrilayerfeature for the heatmap to consume. But it unable to display anything. I wanted to ask is my JSON Format wrong or is there a format that is required for esri to consume the service? This is my above code of JSON format that i generate using WCF service C#.

{
"displayFieldName": "NAME",
"fieldAliases": {
    "NAME": "NAME"
},
"geometryType": "esriGeometryPoint",
"spatialReference": {
    "wkid": 3414
},
"features": [
    {
        "attributes": {
            "NAME": "xxx Clinic"
        },
        "geometry": {
            "x": 27753.7308999998,
            "y": 29379.7284999993
        }
    },
    {
        "attributes": {
            "NAME": "xxx1 Clinic"
        },
        "geometry": {
            "x": 30292.2024999997,
            "y": 33825.7929999996
        }
    },
    {
        "attributes": {
            "NAME": "xxx2 Clinic"
        },
        "geometry": {
            "x": 13907.0305000003,
            "y": 35735.6776999999
        }
    }
]
}

This is the line which i use to execute the JSON format using Wcf Service using IIS localhost.

POIFeatureLayer = new esri.layers.FeatureLayer("http://localhost/RoadWatchDummyData(Json)V7/WcfService.svc/json");

Outcomes