Remove jQuery use from IGC example
This commit is contained in:
@@ -51,9 +51,18 @@ var igcUrls = [
|
||||
'data/igc/Ulrich-Prinz.igc'
|
||||
];
|
||||
|
||||
function get(url, callback) {
|
||||
var client = new XMLHttpRequest();
|
||||
client.open('GET', url);
|
||||
client.onload = function() {
|
||||
callback(client.responseText);
|
||||
};
|
||||
client.send();
|
||||
}
|
||||
|
||||
var igcFormat = new ol.format.IGC();
|
||||
for (var i = 0; i < igcUrls.length; ++i) {
|
||||
$.ajax(igcUrls[i]).then(function(data) {
|
||||
get(igcUrls[i], function(data) {
|
||||
var features = igcFormat.readFeatures(data,
|
||||
{featureProjection: 'EPSG:3857'});
|
||||
vectorSource.addFeatures(features);
|
||||
@@ -184,8 +193,8 @@ var featureOverlay = new ol.FeatureOverlay({
|
||||
})
|
||||
});
|
||||
|
||||
$('#time').on('input', function(event) {
|
||||
var value = parseInt($(this).val(), 10) / 100;
|
||||
document.getElementById('time').addEventListener('input', function() {
|
||||
var value = parseInt(this.value, 10) / 100;
|
||||
var m = time.start + (time.duration * value);
|
||||
vectorSource.forEachFeature(function(feature) {
|
||||
var geometry = /** @type {ol.geom.LineString} */ (feature.getGeometry());
|
||||
|
||||
Reference in New Issue
Block a user