Giter Club home page Giter Club logo

directionallinesymbol's Introduction

DirectionalLineSymbol

ArcGIS javascript custom Line Symbol.

DirectionalLineSymbol inherits from SimpleLineSymbol. It displays directional symbols on the line that indicate the direction of the line. I needed some arrow symobls on my lines (in a feature or graphics layer) to indicate direction but I just wanted to be able to do it in one place.

Features

  • Adds directional graphics to the map along a SimpleLineSymbol starting from start of the line to the end.
  • Can be used for Polyline line symbols or as the outline of a Polygon SimpleFillSymbol.
  • A few pre-configured symbols to use, or pass in a custom path 'd' attribute string to display any symbol you want.
  • Set the amount of pixels in between each direction symbol to space them appropriately depending on the data.
  • Just for fun animate the direction symbols appearing along the line.
  • All logic contained in the DirectionalLineSymbol class, no need to create seperate renderers or add attributes to graphics (or use text symbols).

Note

Normallly symbol classes are really just used to define how a graphic will appear, but to actually draw the directional symbols along the line DirectionalLineSymbol breaks that paradigm. I wanted something super simple to call from anywhere - ie: without having to create a symbol class and a renderer and possibly other stuff, so just wanted to do -

var s = new DirectionalLineSymbol(options);

...and all sorted. But to do that had to add graphic specific functions and event handlers for graphics layers and the map (only once though) within DirectionalLineSymobl. So I can understand why this isn't in the actual api, but wanted a solution anyway.

Code is commented and the options explained in the constructor. How to use is in index.html which is the same as this example page: http://directionallinesymbol.azurewebsites.net/

Add to, edit or find bugs, thanks!

directionallinesymbol's People

Contributors

nickcam avatar kgonzago avatar

Watchers

James Cloos avatar Kenny Nys avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.