Leaflet Labels from DynamicMapLayer

6812
6
Jump to solution
01-20-2016 10:18 AM
Labels (1)
BillChappell
Occasional Contributor II

I have an County ArcServer REST mapservice,  and I want to label the polygons.

 

Esri shows an nice example for a feature service but no examples for a dynamic Service.

 

Anyone know of an example?

0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Frequent Contributor

the easiest thing to do would be to either turn on labels for the layer in the existing service or publish another service with labels.

View solution in original post

0 Kudos
6 Replies
JohnGravois
Frequent Contributor

the easiest thing to do would be to either turn on labels for the layer in the existing service or publish another service with labels.

0 Kudos
BillChappell
Occasional Contributor II

Sometimes the simplest answer is the best, I'm not sure why I was trying to do this the hard way.

0 Kudos
PatrickMcKinney1
Occasional Contributor III

Bill,

We've dealt with this issue a few different ways. I'll list them to give you an idea of what you could do.

  1. Publish a map service with labels turned on
  2. Publish a service with the features and a separate service for just the labels
    1. If you want the layer to be transparent but not the labels
    2. You want the layer to be a feature service due to better drawing
BillChappell
Occasional Contributor II

I like your answer, I've played with leaflet enough that I just now handle a dynamic service as a feature service to enable the better drawing, using color symbology, popups, and dynamic legends. Also putting the labels in a separate service allows you to put them in a layer switcher and the user can turn the layer on/off himself.

0 Kudos
PatrickMcKinney1
Occasional Contributor III

Bill, how have you created dynamic legends from feature services? I saw something on GitHub, but couldn't figure it out.

0 Kudos
BillChappell
Occasional Contributor II

Send me an e-mail, I’ll send some commented code …

BTW, I like Carlisle, my parents were there when I went to Ship.

Bill Chappell

ITS Group - GIS Developer

800 North Pearl Street- Room 222

Menards, NY 12204

518-408-0185

William.Chappell@Its.ny.gov<mailto:William.Chappell@Its.ny.gov>

0 Kudos