N
N
nastya_zholudeva2017-10-16 13:16:43
JavaScript
nastya_zholudeva, 2017-10-16 13:16:43

Adding objects to the map that fall into the scope (add data array)?

I need to load those objects that are included in the scope. I found an example in the documentation https://tech.yandex.ru/maps/jsbox/2.1/show_visible... One moment is not clear. I have an array of data like

[[55.765326, 37.627735],[55.637366, 37.719745], ...]
. It is not clear how to apply it to this part of the code
// Create objects based on the JSON description of the geometries.
var objects = ymaps.geoQuery([{
            type: 'Point',
            coordinates: [55.73, 37.75]
        }, {
            type: 'Point',
            coordinates: [55.10, 37.45]
        }, {
            type: 'Point',
            coordinates: [55.25, 37.35]
        }, {
            type: 'Point',
            coordinates: [55.25, 67.35]
        }]);

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexander Taratin, 2017-10-16
@nastya_zholudeva

https://developer.mozilla.org/en/docs/Web/JavaScript...

ymaps.geoQuery([[55.765326, 37.627735],[55.637366, 37.719745]].map(function(p){return {coordinates:p, type: 'Point'}}))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question