Y
Y
yazux2019-10-01 10:58:14
JavaScript
yazux, 2019-10-01 10:58:14

How to display GeoObject of LineString type on Yandex map using Clusterer?

Good afternoon! There was a problem with displaying data on the Yandex map.
The task in general is this: to display sections of roads on the map and color them in a certain color.
There are more than 10,000 of these sites, each with 10,000 to 100,000 coordinates.
Road sections were originally drawn by creating a GeoObject of type LineString and adding it to the map using map.geoObjects.add(). With a small number of sites and coordinates, it works fine, with a large number it already starts to lag.
After reading the documentation, I saw that Clusterer can not display data that is not visible in the user's viewport, which will reduce the load. I tried to do this and got the error "Cannot read property '0' of undefined at Object._getPosition"
Here is an example where this error also occurs:https://jsfiddle.net/0qoLg5xu/
However, if you add a GeoObject with the Point type first, then it is displayed, but the LineString added along with the Point is not displayed on the map, but there is no error either. Also an example of how the map works: https://jsfiddle.net/oynxzgb7/14/
I read topics with this error, I did not find any solutions to the problem. The coordinates, as seen in the examples, are in the required format.
Please tell me what I'm doing wrong and how to make the card work through Clusterer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-10-01
@grinat

Because the lines don't cluster. In general, for the first time I see such a task, although in GIS for a long time, because such things are always drawn on tiles, either with an additional layer of tiles, or on the main one. Yes, and Yandex maps are shit, they will never take out so many points in the form of points, this is only through supercluster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question