Search code examples
geojsonopenlayers-3stride

Openlayers 3 How to render every point in a geometry at a high ( small ) resolution?


How do I force ol3 to render every single point in a geometry?

I'm having an issue with openlayers 3, where although I'm plotting a line string with 3000 points over a distance of maybe 100m, only about 1000 are rendering.

EDIT: Now - Openlayers 3 v.3.7.0

Zooming in far enough on a set of points in openlayers 3 reveals that only a few points are drawn, in a grid pattern. I would like to zoom in to see a hundred points drawn slightly offset from each other in a centimeter or millimeter scale map.

Is this possible with openlayers 3?


Solution

  • The renderer will simplify your geometries. Stride is basically if you have 2, 3 or 4 values in a coordinate, so e.g. XY, XYZ, XYZM.

    You will want to look at changing the ol.SIMPLIFY_TOLERANCE but you'll need to create a custom build and change the define as far as I can see (http://openlayers.org/en/v3.5.0/doc/tutorials/custom-builds.html).

    /**
     * @define {number} Tolerance for geometry simplification in device pixels.
     */
    ol.SIMPLIFY_TOLERANCE = 0.5;
    

    Try setting it to 0 or negative.