A
A
Alexey Kondakov2018-05-14 15:05:25
OpenLayers
Alexey Kondakov, 2018-05-14 15:05:25

Why is the layer of type MultiLineString not fully displayed?

When the component is loaded, I run the function:

async mountPanoramasTiles() {
    await this.fetchPanoramTracks();
    this.drawRoadsLayer(this.panoramasTracksLayer);
  }

In the road drawing function, I have the following written:
drawRoadsLayer(geoJSON) {
    const { map, point } = this.props;

    const geoVector = new ol.source.Vector({
      features: new ol.format.GeoJSON().readFeatures(geoJSON)
    });

    const tilesStyle = new ol.style.Style({
      stroke: new ol.style.Stroke({
        color: "blue",
        width: 1
      })
    });

    this.panoramasTracksLayer = new ol.layer.Vector({
      source: geoVector,
      style: tilesStyle
    });
    map.addLayer(this.panoramasTracksLayer);
  }

From the back, I receive a response in geoJSON format, and each of the geojson fields looks similar
{"type":"Feature","id":"default_pano_shape.1","geometry":{"type":"MultiLineString","coordinates":[]},"geometry_name":"geom","properties":{"objectid":1,"id":0,"shape_leng":127.622459436989288}

In fact, all these features are long lines, but short segments are drawn on my map.
The format of coordinates on the map and the format of incoming data are the same (EPSG:3857).
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question