From f712123e9313534b37a8beeaab8dc2ac9c4cb02b Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 15 Apr 2015 09:21:40 -0600 Subject: [PATCH] Remove jQuery use from IGC example --- examples/igc.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/igc.js b/examples/igc.js index 4b023bd3e1..43020959ef 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -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());