2

I have a GraphicsLayer on ArcGIS js map with many lines of varying lengths (1 to 200m). However, in smaller zoom levels the short lines disappear. For example, in the images below the red lines are visible in the larger zoom level and then they are no longer visible when zoomed out:

ArcGIS zoomed in

ArcGIS zoomed in

ArcsGIS zoomed out

ArcGIS zoomed out

Having the same layer on Leaflet does not have this effect and the short lines appear like points:

Leaflet zoomed out

Leaflet zoomed out

Here is the code:

    this.simpleLineSymbolLeft = new SimpleLineSymbol({
        type: "simple-line",
        color: [247, 45, 45],
        width: 5,
        style: "solid"
    });

let graphic = new Graphic({
            geometry: polyline,
            symbol: this.simpleLineSymbolLeft,
            attributes: properties
        })

I assume this is a simplification effect, based on which very short line, instead of being collapsed into points, they are turned off. Is there a way to tweak this so that the short lines will not disappear?

2
  • It would be nice to see the code relative to the styling of the features in question. Commented Feb 12, 2020 at 19:48
  • I updated the question with some code.
    – GStav
    Commented Feb 12, 2020 at 20:05

1 Answer 1

0

I assume this is a simplification effect, based on which very short line, instead of being collapsed into points, they are turned off.

Correct, the ArcGIS API for JavaScript does not draw lines when they are shorter than a pixel. That's why they "disappear" as you zoom out.

Is there a way to tweak this so that the short lines will not disappear?

I don't think there's a way to automatically make them not disappear. What you could do as a workaround is adding all the nodes as points, since the points wouldn't disappear when zooming out.

1
  • I was afraid there was no automatic solution - I will try out your workaround!
    – GStav
    Commented Feb 27, 2020 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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