diff --git a/examples/kml-earthquakes.js b/examples/kml-earthquakes.js index c1bc43ce6e..826f1fb54f 100644 --- a/examples/kml-earthquakes.js +++ b/examples/kml-earthquakes.js @@ -32,7 +32,7 @@ var style = new ol.style.Style({ var vector = new ol.layer.Vector({ source: new ol.source.Vector({ - parser: new ol.parser.KML({dimension: 2}), + parser: new ol.parser.KML(), url: 'data/kml/2012_Earthquakes_Mag5.kml' }), style: style diff --git a/examples/kml-timezones.js b/examples/kml-timezones.js index b768552986..80524a9e00 100644 --- a/examples/kml-timezones.js +++ b/examples/kml-timezones.js @@ -54,7 +54,7 @@ var style = new ol.style.Style({ var vector = new ol.layer.Vector({ source: new ol.source.Vector({ - parser: new ol.parser.KML({dimension: 2}), + parser: new ol.parser.KML(), url: 'data/kml/timezones.kml' }), style: style diff --git a/examples/kml.js b/examples/kml.js index 7e0fce8da3..d99e343ecc 100644 --- a/examples/kml.js +++ b/examples/kml.js @@ -22,7 +22,7 @@ var raster = new ol.layer.Tile({ var vector = new ol.layer.Vector({ source: new ol.source.Vector({ parser: new ol.parser.KML({ - maxDepth: 1, dimension: 2, extractStyles: true, extractAttributes: true + maxDepth: 1, extractStyles: true, extractAttributes: true }), url: 'data/kml/lines.kml' }) diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 9386a27feb..332699752c 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -412,8 +412,6 @@ /** * @typedef {Object} ol.parser.KMLOptions - * @property {number|undefined} dimension Create geometries with `dimension` - * dimensions. Default is 3. * @property {boolean|undefined} extractAttributes Should we extract attributes * from the KML? Default is `true´. * @property {boolean|undefined} extractStyles Should we extract styles from the diff --git a/src/ol/parser/kmlparser.js b/src/ol/parser/kmlparser.js index 00817e985e..66e426ed0d 100644 --- a/src/ol/parser/kmlparser.js +++ b/src/ol/parser/kmlparser.js @@ -52,8 +52,6 @@ ol.parser.KML = function(opt_options) { options.extractStyles : false; this.schemaLocation = 'http://www.opengis.net/kml/2.2 ' + 'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd'; - // TODO re-evaluate once shared structures support 3D - this.dimension = goog.isDef(options.dimension) ? options.dimension : 3; this.maxDepth = goog.isDef(options.maxDepth) ? options.maxDepth : 0; this.trackAttributes = goog.isDef(options.trackAttributes) ? options.trackAttributes : null; @@ -263,8 +261,7 @@ ol.parser.KML = function(opt_options) { for (var i = 0, ii = coords.length; i < ii; i++) { var array = coords[i].replace(reg.removeSpace, '').split(','); var pair = []; - var jj = Math.min(array.length, this.dimension); - for (var j = 0; j < jj; j++) { + for (var j = 0, jj = array.length; j < jj; j++) { pair.push(parseFloat(array[j])); } coordArray.push(pair); @@ -544,7 +541,7 @@ ol.parser.KML = function(opt_options) { 'coord': function(node, container) { var str = this.getChildValue(node); var coords = str.replace(this.regExes.trimSpace, '').split(/\s+/); - for (var i = 0, ii = this.dimension; i < ii; ++i) { + for (var i = 0, ii = coords.length; i < ii; ++i) { coords[i] = parseFloat(coords[i]); } var point = {