0

Does anyone know how I would go about hiding labels in a ArcGISDynamicMapServiceLayer?

This is part of my code so far:

var routeLayer = ArcGISDynamicMapServiceLayer(...);
map.addLayer(routeLayer);
var drawingOptions = new LayerDrawingOptions();
drawingOptions.showLabels = false;
var options = [];
options[0] = drawingOptions;
routeLayer.setLayerDrawingOptions(options);

After doing this however the layer isn't shown on the map.

Do I need to set the renderer property for drawingOptions as well?

2

Ok this is how i solved it.

I added a renderer to drawingOptions

var sls = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, esri.Color([255, 255, 0]), 3);
drawingOptions.renderer = SimpleRenderer(sls);

After i did that i had to enable dynamic workspaces in the service capabilities via the server manager.

Hope this helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.