Output.js

34 lines | 1.593 kB Blame History Raw Download
//  Функция выводит данные о поселении в боковую панель из JSON объекта
function PrintInfoAboutSettlement(info) {
    var header = "<h3>" + info.Name + "</h3>"
    document.getElementById('sidebar-header').innerHTML = header;
    //Name Region Type Population PopulationOfMan PopulationOfWoman Year Description
    var text = '';
    text += '<p>' + 'Тип: ' + info.Type + '</p><br/>';
    text += '<p>' + 'Время основания: ' + info.Year + '</p><br/>';
    text += '<p>' + 'Входит в состав: ' + info.Region + '</p><br/>';
    text += '<p>' + 'Количество населения: ' + info.Population + '</p>';
    text += '<p>' + 'Мужское население: ' + info.PopulationOfMan + '</p>';
    text += '<p>' + 'Женское население: ' + info.PopulationOfWoman + '</p><br/>';
    text += '<p>' + 'Описание: ' + info.Description + '</p><br/>';
    text += '<p>' + 'Ссылка: ' + '<a href="' + info.Source + '">' + '[0]' + '</a>' + '</p><br/>';
    

    document.getElementById('sidebar-text').innerHTML = text;
}

//  Функция выгружает все гео-объекты из данной коллекции на карту
function PlaceFromCollection() {
    Map.geoObjects.add(CollectionVisible);

    //var arr = [];
    //var i = 0;
    //var iterator = CollectionVisible.getIterator(),
    //    object;
    //while ((object = iterator.getNext()) != iterator.STOP_ITERATION) {
    //    arr[i] = object;
    //    i++;
    //}
    //clusterer.add(arr);
    //Map.geoObjects.add(clusterer);
}