簡體   English   中英

openlayers 3 IGC文本來源

[英]openlayers 3 IGC source from text

我正在使用openlayers 3,並且正在尋找一種方法來加載跟蹤數據,而不是從url,而是直接通過將文本添加到vectorsource IGC來加載。 我有坐標和時間作為數組的數據。 什么格式是正確的? 因此,對此:

var vectorSource = new ol.source.IGC({
projection: 'EPSG:3857',
urls: [
'data/igc/Clement-Latour.igc',
'data/igc/Damien-de-Baenst.igc',
'data/igc/Sylvain-Dhonneur.igc',
'data/igc/Tom-Payne.igc',
'data/igc/Ulrich-Prinz.igc'
]
});

我想使用這樣的東西(不確定格式):

var vectorSource = new ol.source.IGC({
projection: 'EPSG:3857',
text: [
array1,
array2,
array3  // or arrayall with all three arrays, or text.. What is correct?
]
});

為了獲得更多控制和靈活性,可以使用ol.source.Vectorol.format.IGC代替“方便的” ol.source.IGC 例如:

var source = new ol.source.Vector();

var format = new ol.format.IGC();
var readOptions = {featureProjection: 'EPSG:3857'};

var features = [
  format.readFeature(text1, readOptions),
  format.readFeature(text2, readOptions),
  format.readFeature(text3, readOptions)
];

source.addFeatures(features);

var layer = new ol.layer.Vector({source: source});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM