Hi all,
I have points feature layer that represent road blocks. I would like to allow users to be using the direction widget to be rerouted. Is it possible?
Thanks,
Alex
Alex,
Sure, you would just have to add the features from your roadblock layer to the directions dijit using the esri private object called _barriersLayer
So it would look like:
<SPAN class="keyword token">var</SPAN> directions <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Directions</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> map<SPAN class="punctuation token">:</SPAN> map <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"dir"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> directions<SPAN class="punctuation token">.</SPAN><SPAN class="token function">startup</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> directions<SPAN class="punctuation token">.</SPAN>_barriersLayer <SPAN class="operator token">=</SPAN> yourBarriersLayer<SPAN class="punctuation token">;</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
That is for point layers there is a separate property for line and polygon barriers.
Cool, can this barrier layer be point (road blocks layer) or does it have to be a line feature.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.