as it should draw a map from this data?
Solved! Go to Solution.
Fabien,
I would add a UniqueValueRenderer. I have updated the previous sample to use a UniqueValueRenderer.
http://gis.yakimawa.gov/demo/optimo.html
Regards,
Tom
read this json file and loop through the features.
var saved = dojo.fromJson(data
for each feature create a graphic
var graphic = new esri.Graphic(saved);
final push this graphic on a Graphic Layer.
GRAPHICLAYER.add(graphic);
Hi I did so but I still can show the way
http://optimocamino.cloudingsoft.net/tasks/responses/routes.html
I could indicate please I'm wrong?
Fabien,
Looking at your JSON data, I am not seeing anything resembling geometry. I see statistics for each vehicle like travel times and distances, but not a polyline geometry that would show the route taken. Without this geometry, you can't draw anything to the map. It doesn't look like the JSAPI has a Vehicle Routing Problem module. You must be doing these on the server. Be sure to include the geometry on your output to be able to draw it from your results.
Regards,
Tom
Please see the example mentioned above
http://optimocamino.cloudingsoft.net/tasks/responses/routes.html
Fabien,
I modified your script to read the results and plot the route lines. You were on the right track. The results returned paths instead of a complete polyline that could be plotted. I created a polyline from each path. You can look at the results here:
http://gis.yakimawa.gov/demo/optimo.html
Regards,
Tom
Hello
in the example it indicates that they are 3 vehicles, as could distinguish colors such routes and put a marker at each stop?
on the other hand I have the "output order" http://optimocamino.cloudingsoft.net/tasks/responses/output_orders.js
what use me this information?
thank you very much!
Fabien,
I would add a UniqueValueRenderer. I have updated the previous sample to use a UniqueValueRenderer.
http://gis.yakimawa.gov/demo/optimo.html
Regards,
Tom
Hello Tom
on the other hand I have the "output order" http://optimocamino.cloudingsoft.net/tasks/responses/output_orders.js
I understand that here indicates the order of the stops corresponding to each route / vehicle, but do not tell me the coordinates.
as you could add this information to map?
thank you very much!
Fabien,
Without the coordinates for each stop, they cannot be placed on the map. I do see that the output orders have distances traveled and you could possibly split the polylines at each of those distances to approximate the stop location.
Regards,
Tom