Hi
Is there any possibility to use SQL Table instead of CSV to visualize points with heat map..???
Hi kawish abbas,
Yeah, I suppose you can apply the renderer to any kind of point layer.
Cheers,
Egge-Jan
I have created my own json service using express. How can i use it with arcgis api...??
I don't think so. Unless you have the ability to make a layer (of some supported type) out of that tables data. I suppose if the SQL Table is from a Geodatabase or you have a web service that allows the query of the tables data, then you could create client side graphics in a FeatureLayer from that.
I have created json service by using express.. Can i use this json service to create heat map..???
Use esriRequest to call the json service and get your data. Shown in this sample.
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=request
Then use code from this sample to create FeatureLayer from that data.
Once you have a FeatureLayer apply the HeatMap renderer to it.
Thank you Robert i will try this.
Robert..
i have called json service and got data in console. But when i use code from this sample https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=layers-feature... and try to got data with featureCollection, i received "undefined". How can i create featureCollection??
Response from JSON service
{
"data": [
{
"OBJECTID": 146,
"Splitter": "64",
"Comment": "DHA Phase05",
"Name": "Plaza POP ODB 02",
"ID": "2100604",
"Placement": "Aerial",
"POP": 21006,
"Shape": {
"srid": 32642,
"version": 1,
"points": [
{
"x": 301997.6824000003,
"y": 2746232.8489999995,
"z": null,
"m": null
}
],
"figures": [
{
"attribute": 1,
"pointOffset": 0
}
],
"shapes": [
{
"parentOffset": -1,
"figureOffset": 0,
"type": 1
}
],
"segments": []
}
}
]
}
Kawish,
Time to show your code. In the sample I provided it returns a featureCollection. In your case you have a json string that you need to parse and create Graphics for each result in your data array.
Robert
Could you please give me sample code for given json string that how to parse and create feature layer..
{
"data": [
{
"OBJECTID": 146,
"Splitter": "64",
"Comment": "DHA Phase05",
"Name": "Plaza POP ODB 02",
"ID": "2100604",
"Placement": "Aerial",
"POP": 21006,
"Shape": {
"srid": 32642,
"version": 1,
"points": [
{
"x": 301997.6824000003,
"y": 2746232.8489999995,
"z": null,
"m": null
}
],
"figures": [
{
"attribute": 1,
"pointOffset": 0
}
],
"shapes": [
{
"parentOffset": -1,
"figureOffset": 0,
"type": 1
}
],
"segments": []
}
},
{
"OBJECTID": 147,
"Splitter": "64",
"Comment": "DHA Phase06",
"Name": "Badar POP ODB Muhafiz",
"ID": "2100502",
"Placement": "Aerial",
"POP": 21005,
"Shape": {
"srid": 32642,
"version": 1,
"points": [
{
"x": 302831.8328999998,
"y": 2742953.342599999,
"z": null,
"m": null
}
],
"figures": [
{
"attribute": 1,
"pointOffset": 0
}
],
"shapes": [
{
"parentOffset": -1,
"figureOffset": 0,
"type": 1
}
],
"segments": []
}
}
]
}