Select to view content in your preferred language

Polyline feature layer from JSON

2752
2
04-17-2013 12:23 PM
AndrzejMilosz
Deactivated User
In my application I want to create a polyline feature layer from this JSON file: http://ibikekrakow.com/wp-content/themes/bike/js/green.js Is this file good for this?
I found an example how to create a feature layer from points: http://gis.stackexchange.com/questions/8896/feature-layer-with-ondemand-mode/8912#8912
What is different in creating a polyline layer?
0 Kudos
2 Replies
derekswingley1
Deactivated User
You can do the same thing with lines, just need to tweak the JSON you pass to the feature layer constructor.

Since your source file is GeoJson, you need to convert to the esri json format as well. I used this:  https://github.com/Esri/geojson-utils

Here's a working example:  http://jsfiddle.net/ZdLF7/

Note that I included the GeoJson converter JS directly from github. If you use that code to convert your GeoJson you should download and host that .js file yourself.
0 Kudos
AndrzejMilosz
Deactivated User
That works, thank you!
Is there a possibility to save this feature layer (created from JSON) in ArcGIS geodatabase?
0 Kudos