简体   繁体   中英

Esri Javascript API Lines and Arrows as directions

I am new to esri javacript api and and I have published a service that has right arrow lines and I am wondering how to get the arrows, which show the direction of the line?

For instance, I publish my service to ArcGIS server, which has lines and right arrows. If I publish the map(using web content) to ArcGIS online, it pulls in the feature and shows the arrows but when using the javascript api

var line = new FeatureLayer(" http://www.somewhereovertherainbow.com/arcgis/rest/services/Open/lines/MapServer/3 ");

I can get the lines but the arrows are not with it. How do I get the arrows too? How do I create directional arrow line symbols?

Ok, there are a few way one can go about doing this. First, a person can extend the LineSymbol class, which is a lot of work and I decided not to go down this path. The other way is to just publish a map with the lines and arrows and then get the map with:

ArcGISDynamicMapServiceLayer()

After retrieving the map with ArcGISDynamicMapServiceLayer() you will have all the graphics as the map does in AcrMap. Now if you want to apply events on the different lines, just get the lines again with LayerFeature() and set the segments' opacity to 0 and make sure that the LayerFeature() is on top of the ArcGISDynamicMapServiceLayer().

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM