Use urls option in igc example
This commit is contained in:
@@ -2,27 +2,17 @@ goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.format.IGC');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.IGC');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var tracklogs = [
|
||||
'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 colors = {
|
||||
'Clement Latour': 'rgba(0, 0, 255, 0.7)',
|
||||
'Damien de Baesnt': 'rgba(0, 215, 255, 0.7)',
|
||||
@@ -47,7 +37,15 @@ var styleFunction = function(feature, resolution) {
|
||||
return styleArray;
|
||||
};
|
||||
|
||||
var vectorSource = new ol.source.Vector();
|
||||
var vectorSource = new ol.source.IGC({
|
||||
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 map = new ol.Map({
|
||||
layers: [
|
||||
@@ -77,18 +75,6 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
|
||||
var transform = ol.proj.getTransform('EPSG:4326', 'EPSG:3857');
|
||||
var i, ii;
|
||||
for (i = 0, ii = tracklogs.length; i < ii; ++i) {
|
||||
$.get(tracklogs[i], function(data) {
|
||||
var format = new ol.format.IGC();
|
||||
var feature = format.readFeature(data);
|
||||
feature.getGeometry().transform(transform);
|
||||
vectorSource.addFeature(feature);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var point = null;
|
||||
var line = null;
|
||||
var displaySnap = function(coordinate) {
|
||||
|
||||
Reference in New Issue
Block a user