Select to view content in your preferred language

Unique value renderer with field based rotation of points

799
4
04-29-2013 05:58 AM
AdrianMarsden
Honored Contributor
Hi
I've been asked to produce a feature layer that has details of staff, their locations and direction of travel.

I am provided with a SQL table that contains the name, XY and Rotation Angle.  Which by default I add as an event theme in ArcMap and publish as a service.  I can see three ways of doing what is wanted.

  1. Handle all this in ArcMap and publish the service.  the problem is that when new users are added I need to add them to the class definitions.

  2. Use esri.renderer.UniqueValueRenderer to set the render at runtime, but I can't see a way to include the record specific rotation, but it will allow me to change the render based on all users found in the layer (a simple group by somewhere should do this)

  3. Don't add the feature layer to the map, bu loop through it where field value equals selected name, add a new graphic with rotation pulled from the record attribute.

As I see it all these have flaws, but I'm no expert.  So advice more than welcome.

Cheers

ACM
0 Kudos
4 Replies
SteveCole
Honored Contributor
How about using a classBreaksRenderer based on the rotation angle? Assign an arrow symbol based on that value. Assuming that north is zero,you would have something like:

renderer.addBreak({
  minValue: 0,
  maxValue: 15,
  symbol: symbol,
  label: "North"
});
renderer.addBreak({
  minValue: 16,
  maxValue: 65,
  symbol: symbol,
  label: "Northeast"
});
renderer.addBreak({
  minValue: 66,
  maxValue: 115,
  symbol: symbol,
  label: "East"
});
renderer.addBreak({
  minValue: 116,
  maxValue: 155,
  symbol: symbol,
  label: "Southeast"
});


You get the idea...

Steve
0 Kudos
AdrianMarsden
Honored Contributor
Yes - I can see that may help.  However I still have the problem of separating the users as well as the direction, So Fred North East should be blue and Joe North East should be red, but both the same shape.

I can see your solution working on part of the project, where a manager selects a particular user to spy on , sorry track, where the only markers displayed are that user.

So maybe, two render functions.  One for an overview where the manager can see all the users.  The the other when a specific user is selected, where direction of travel is indicated.

I'll run that one past the chap who is pulling this together tomorrow

Cheers

ACM
0 Kudos
SteveCole
Honored Contributor
Depending on how many people (or divisions, etc), perhaps you can create a featureLayer for each person/grouping using a definition query on your table in the service. That way, you still use the basic classBreaksRenderer but just change the symbol used for each layer (red arrow set, green, blue, yellow, etc).
0 Kudos
AdrianMarsden
Honored Contributor
True, but that hits the problem I mentioned before, in that if new users are added I have to tweak the service, in which case I can get ArcMap to do the rotation.

Cheers

ACM
0 Kudos