as it should draw a map from this data?
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
exactly, I have that data.
but right there I have another problem I just asked to give by termianda this question.
I would like to see him and give me your opinion: https://community.esri.com/thread/177550
Thank you.
Your original request may send the stop coordinates, but the results don't contain the stop data. The app you had posted only showed the results, not the request.
Hello Tom
when sending solve the problem, it also sends the coordinates of each stop and deposit so they should match the path.
I have been helpful!
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.
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!
Hello
in the example it indicates that they are 3 vehicles, as could distinguish colors such routes and put a marker at each stop?
what use me this information?
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:
Please see the example mentioned above
http://optimocamino.cloudingsoft.net/tasks/responses/routes.html
Hi I did so but I still can show the way
I could indicate please I'm wrong?
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.
read this json file and loop through the features.
var saved = dojo.fromJson(data); esri/geometry/jsonUtils | API Reference | ArcGIS API for JavaScript
for each feature create a graphic
var graphic = new esri.Graphic(saved);
final push this graphic on a Graphic Layer.
GRAPHICLAYER.add(graphic);
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.