diff --git a/examples/box-selection.js b/examples/box-selection.js
index 80140cc52a..958c565db2 100644
--- a/examples/box-selection.js
+++ b/examples/box-selection.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_events_condition_ from '../src/ol/events/condition.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import DragBox from '../src/ol/interaction/DragBox.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -12,7 +12,7 @@ import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
});
diff --git a/examples/canvas-gradient-pattern.js b/examples/canvas-gradient-pattern.js
index 4cdfec729f..76f22d58a7 100644
--- a/examples/canvas-gradient-pattern.js
+++ b/examples/canvas-gradient-pattern.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import * as _ol_extent_ from '../src/ol/extent.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_has_ from '../src/ol/has.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import {fromLonLat} from '../src/ol/proj.js';
@@ -84,7 +84,7 @@ var getStackedStyle = function(feature, resolution) {
var vectorLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: getStackedStyle
});
diff --git a/examples/center.js b/examples/center.js
index 36a5b1c3df..7c1c32d509 100644
--- a/examples/center.js
+++ b/examples/center.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -13,7 +13,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
var source = new _ol_source_Vector_({
url: 'data/geojson/switzerland.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
});
var style = new _ol_style_Style_({
fill: new _ol_style_Fill_({
diff --git a/examples/drag-and-drop-image-vector.js b/examples/drag-and-drop-image-vector.js
index 44fdd05d59..683bfa987b 100644
--- a/examples/drag-and-drop-image-vector.js
+++ b/examples/drag-and-drop-image-vector.js
@@ -1,10 +1,10 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GPX_ from '../src/ol/format/GPX.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
-import _ol_format_IGC_ from '../src/ol/format/IGC.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
-import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
+import GPX from '../src/ol/format/GPX.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
+import IGC from '../src/ol/format/IGC.js';
+import KML from '../src/ol/format/KML.js';
+import TopoJSON from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -85,11 +85,11 @@ var styleFunction = function(feature, resolution) {
var dragAndDropInteraction = new DragAndDrop({
formatConstructors: [
- _ol_format_GPX_,
- _ol_format_GeoJSON_,
- _ol_format_IGC_,
- _ol_format_KML_,
- _ol_format_TopoJSON_
+ GPX,
+ GeoJSON,
+ IGC,
+ KML,
+ TopoJSON
]
});
diff --git a/examples/drag-and-drop.js b/examples/drag-and-drop.js
index 222efea03b..7b92870ef4 100644
--- a/examples/drag-and-drop.js
+++ b/examples/drag-and-drop.js
@@ -1,10 +1,10 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GPX_ from '../src/ol/format/GPX.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
-import _ol_format_IGC_ from '../src/ol/format/IGC.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
-import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
+import GPX from '../src/ol/format/GPX.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
+import IGC from '../src/ol/format/IGC.js';
+import KML from '../src/ol/format/KML.js';
+import TopoJSON from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -85,11 +85,11 @@ var styleFunction = function(feature, resolution) {
var dragAndDropInteraction = new DragAndDrop({
formatConstructors: [
- _ol_format_GPX_,
- _ol_format_GeoJSON_,
- _ol_format_IGC_,
- _ol_format_KML_,
- _ol_format_TopoJSON_
+ GPX,
+ GeoJSON,
+ IGC,
+ KML,
+ TopoJSON
]
});
diff --git a/examples/earthquake-clusters.js b/examples/earthquake-clusters.js
index 1940636b56..7296bbfe62 100644
--- a/examples/earthquake-clusters.js
+++ b/examples/earthquake-clusters.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import * as _ol_extent_ from '../src/ol/extent.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -126,7 +126,7 @@ vector = new _ol_layer_Vector_({
distance: 40,
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
- format: new _ol_format_KML_({
+ format: new KML({
extractStyles: false
})
})
diff --git a/examples/earthquake-custom-symbol.js b/examples/earthquake-custom-symbol.js
index 64491102e1..c989bb341f 100644
--- a/examples/earthquake-custom-symbol.js
+++ b/examples/earthquake-custom-symbol.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import Polygon from '../src/ol/geom/Polygon.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -55,7 +55,7 @@ var styleFunction = function(feature) {
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
- format: new _ol_format_KML_({
+ format: new KML({
extractStyles: false
})
}),
diff --git a/examples/export-map.js b/examples/export-map.js
index d0d9323f1e..df03f94c81 100644
--- a/examples/export-map.js
+++ b/examples/export-map.js
@@ -3,7 +3,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -17,7 +17,7 @@ var map = new _ol_Map_({
new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
})
})
],
diff --git a/examples/export-pdf.js b/examples/export-pdf.js
index 18397ef3c8..e12cf7a5ea 100644
--- a/examples/export-pdf.js
+++ b/examples/export-pdf.js
@@ -2,7 +2,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_WKT_ from '../src/ol/format/WKT.js';
+import WKT from '../src/ol/format/WKT.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -12,7 +12,7 @@ var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
-var format = new _ol_format_WKT_();
+var format = new WKT();
var feature = format.readFeature(
'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' +
'-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' +
diff --git a/examples/extent-interaction.js b/examples/extent-interaction.js
index b2bb3f2457..655bb9e138 100644
--- a/examples/extent-interaction.js
+++ b/examples/extent-interaction.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_events_condition_ from '../src/ol/events/condition.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -10,7 +10,7 @@ import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
});
var map = new _ol_Map_({
diff --git a/examples/feature-move-animation.js b/examples/feature-move-animation.js
index 875d30323c..644b9425e5 100644
--- a/examples/feature-move-animation.js
+++ b/examples/feature-move-animation.js
@@ -1,7 +1,7 @@
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_Polyline_ from '../src/ol/format/Polyline.js';
+import Polyline from '../src/ol/format/Polyline.js';
import Point from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -57,7 +57,7 @@ var polyline = [
'~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL'
].join('');
-var route = /** @type {ol.geom.LineString} */ (new _ol_format_Polyline_({
+var route = /** @type {ol.geom.LineString} */ (new Polyline({
factor: 1e6
}).readGeometry(polyline, {
dataProjection: 'EPSG:4326',
diff --git a/examples/geojson-vt.js b/examples/geojson-vt.js
index 57a5f7d959..fad9a58d3c 100644
--- a/examples/geojson-vt.js
+++ b/examples/geojson-vt.js
@@ -1,7 +1,7 @@
// NOCOMPILE
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -75,7 +75,7 @@ fetch(url).then(function(response) {
debug: 1
});
var vectorSource = new _ol_source_VectorTile_({
- format: new _ol_format_GeoJSON_(),
+ format: new GeoJSON(),
tileLoadFunction: function(tile) {
var format = tile.getFormat();
var tileCoord = tile.getTileCoord();
diff --git a/examples/geojson.js b/examples/geojson.js
index e8c9db2d8f..a3d548526a 100644
--- a/examples/geojson.js
+++ b/examples/geojson.js
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import Circle from '../src/ol/geom/Circle.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -161,7 +161,7 @@ var geojsonObject = {
};
var vectorSource = new _ol_source_Vector_({
- features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
+ features: (new GeoJSON()).readFeatures(geojsonObject)
});
vectorSource.addFeature(new _ol_Feature_(new Circle([5e6, 7e6], 1e6)));
diff --git a/examples/getfeatureinfo-layers.js b/examples/getfeatureinfo-layers.js
index 67458d5c72..c93c6103a3 100644
--- a/examples/getfeatureinfo-layers.js
+++ b/examples/getfeatureinfo-layers.js
@@ -1,21 +1,21 @@
-import _ol_format_WMSGetFeatureInfo_ from '../src/ol/format/WMSGetFeatureInfo.js';
+import WMSGetFeatureInfo from '../src/ol/format/WMSGetFeatureInfo.js';
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
return response.text();
}).then(function(response) {
// this is the standard way to read the features
- var allFeatures = new _ol_format_WMSGetFeatureInfo_().readFeatures(response);
+ var allFeatures = new WMSGetFeatureInfo().readFeatures(response);
document.getElementById('all').innerText = allFeatures.length.toString();
// when specifying the 'layers' options, only the features of those
// layers are returned by the format
- var hotelFeatures = new _ol_format_WMSGetFeatureInfo_({
+ var hotelFeatures = new WMSGetFeatureInfo({
layers: ['hotel']
}).readFeatures(response);
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
- var restaurantFeatures = new _ol_format_WMSGetFeatureInfo_({
+ var restaurantFeatures = new WMSGetFeatureInfo({
layers: ['restaurant']
}).readFeatures(response);
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
diff --git a/examples/gpx.js b/examples/gpx.js
index 3d263bfd1a..c0def97c58 100644
--- a/examples/gpx.js
+++ b/examples/gpx.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GPX_ from '../src/ol/format/GPX.js';
+import GPX from '../src/ol/format/GPX.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
@@ -47,7 +47,7 @@ var style = {
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/gpx/fells_loop.gpx',
- format: new _ol_format_GPX_()
+ format: new GPX()
}),
style: function(feature) {
return style[feature.getGeometry().getType()];
diff --git a/examples/heatmap-earthquakes.js b/examples/heatmap-earthquakes.js
index 09ccb7cc90..8439a59ae7 100644
--- a/examples/heatmap-earthquakes.js
+++ b/examples/heatmap-earthquakes.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import _ol_layer_Heatmap_ from '../src/ol/layer/Heatmap.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
@@ -12,7 +12,7 @@ var radius = document.getElementById('radius');
var vector = new _ol_layer_Heatmap_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
- format: new _ol_format_KML_({
+ format: new KML({
extractStyles: false
})
}),
diff --git a/examples/igc.js b/examples/igc.js
index 5ccba4d407..4b8c617f72 100644
--- a/examples/igc.js
+++ b/examples/igc.js
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_IGC_ from '../src/ol/format/IGC.js';
+import IGC from '../src/ol/format/IGC.js';
import LineString from '../src/ol/geom/LineString.js';
import Point from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -58,7 +58,7 @@ function get(url, callback) {
client.send();
}
-var igcFormat = new _ol_format_IGC_();
+var igcFormat = new IGC();
for (var i = 0; i < igcUrls.length; ++i) {
get(igcUrls[i], function(data) {
var features = igcFormat.readFeatures(data,
diff --git a/examples/image-vector-layer.js b/examples/image-vector-layer.js
index 199c0fe46d..5af586662b 100644
--- a/examples/image-vector-layer.js
+++ b/examples/image-vector-layer.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
@@ -26,7 +26,7 @@ var map = new _ol_Map_({
renderMode: 'image',
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: function(feature) {
style.getText().setText(feature.get('name'));
diff --git a/examples/jsts.js b/examples/jsts.js
index 99a430373b..038f2e6294 100644
--- a/examples/jsts.js
+++ b/examples/jsts.js
@@ -2,7 +2,7 @@
// this example uses JSTS for which we don't have an externs file.
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import {fromLonLat} from '../src/ol/proj.js';
@@ -14,7 +14,7 @@ var source = new _ol_source_Vector_();
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json();
}).then(function(json) {
- var format = new _ol_format_GeoJSON_();
+ var format = new GeoJSON();
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.OL3Parser();
diff --git a/examples/kml-earthquakes.js b/examples/kml-earthquakes.js
index 5aefdb7491..a526641253 100644
--- a/examples/kml-earthquakes.js
+++ b/examples/kml-earthquakes.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
@@ -41,7 +41,7 @@ var styleFunction = function(feature) {
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
- format: new _ol_format_KML_({
+ format: new KML({
extractStyles: false
})
}),
diff --git a/examples/kml-timezones.js b/examples/kml-timezones.js
index 355076b149..0439f5e329 100644
--- a/examples/kml-timezones.js
+++ b/examples/kml-timezones.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
@@ -48,7 +48,7 @@ var styleFunction = function(feature) {
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/timezones.kml',
- format: new _ol_format_KML_({
+ format: new KML({
extractStyles: false
})
}),
diff --git a/examples/kml.js b/examples/kml.js
index bc2da7bfa9..e8225d29c1 100644
--- a/examples/kml.js
+++ b/examples/kml.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_KML_ from '../src/ol/format/KML.js';
+import KML from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
@@ -16,7 +16,7 @@ var raster = new _ol_layer_Tile_({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012-02-10.kml',
- format: new _ol_format_KML_()
+ format: new KML()
})
});
diff --git a/examples/mapbox-vector-tiles-advanced.js b/examples/mapbox-vector-tiles-advanced.js
index 03db877aaf..32eeb82390 100644
--- a/examples/mapbox-vector-tiles-advanced.js
+++ b/examples/mapbox-vector-tiles-advanced.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_MVT_ from '../src/ol/format/MVT.js';
+import MVT from '../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import {get as getProjection} from '../src/ol/proj.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
@@ -37,7 +37,7 @@ var map = new _ol_Map_({
attributions: '© Mapbox ' +
'© ' +
'OpenStreetMap contributors',
- format: new _ol_format_MVT_(),
+ format: new MVT(),
tileGrid: new _ol_tilegrid_TileGrid_({
extent: getProjection('EPSG:3857').getExtent(),
resolutions: resolutions,
diff --git a/examples/mapbox-vector-tiles.js b/examples/mapbox-vector-tiles.js
index 8b2e67ae64..4ce08ba421 100644
--- a/examples/mapbox-vector-tiles.js
+++ b/examples/mapbox-vector-tiles.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_MVT_ from '../src/ol/format/MVT.js';
+import MVT from '../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
@@ -20,7 +20,7 @@ var map = new _ol_Map_({
attributions: '© Mapbox ' +
'© ' +
'OpenStreetMap contributors',
- format: new _ol_format_MVT_(),
+ format: new MVT(),
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key
}),
diff --git a/examples/modify-features.js b/examples/modify-features.js
index e8db4f57cd..d03a795b1d 100644
--- a/examples/modify-features.js
+++ b/examples/modify-features.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
@@ -17,7 +17,7 @@ var raster = new _ol_layer_Tile_({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_(),
+ format: new GeoJSON(),
wrapX: false
})
});
diff --git a/examples/modify-test.js b/examples/modify-test.js
index 8553ac8fa9..a9002fa77b 100644
--- a/examples/modify-test.js
+++ b/examples/modify-test.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
@@ -145,7 +145,7 @@ var geojsonObject = {
};
var source = new _ol_source_Vector_({
- features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
+ features: (new GeoJSON()).readFeatures(geojsonObject)
});
var layer = new _ol_layer_Vector_({
diff --git a/examples/osm-vector-tiles.js b/examples/osm-vector-tiles.js
index 2d879efcef..78eec202b8 100644
--- a/examples/osm-vector-tiles.js
+++ b/examples/osm-vector-tiles.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
+import TopoJSON from '../src/ol/format/TopoJSON.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import {fromLonLat} from '../src/ol/proj.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
@@ -64,7 +64,7 @@ var map = new _ol_Map_({
source: new _ol_source_VectorTile_({
attributions: '© OpenStreetMap contributors, Who’s On First, ' +
'Natural Earth, and openstreetmapdata.com',
- format: new _ol_format_TopoJSON_({
+ format: new TopoJSON({
layerName: 'layer',
layers: ['water', 'roads', 'buildings']
}),
diff --git a/examples/polygon-styles.js b/examples/polygon-styles.js
index 80629d2423..32c1b0442f 100644
--- a/examples/polygon-styles.js
+++ b/examples/polygon-styles.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import MultiPoint from '../src/ol/geom/MultiPoint.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
@@ -81,7 +81,7 @@ var geojsonObject = {
};
var source = new _ol_source_Vector_({
- features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
+ features: (new GeoJSON()).readFeatures(geojsonObject)
});
var layer = new _ol_layer_Vector_({
diff --git a/examples/select-features.js b/examples/select-features.js
index c2a8a4a934..6d1a0d8039 100644
--- a/examples/select-features.js
+++ b/examples/select-features.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_events_condition_ from '../src/ol/events/condition.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
@@ -15,7 +15,7 @@ var raster = new _ol_layer_Tile_({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
})
});
diff --git a/examples/sphere-mollweide.js b/examples/sphere-mollweide.js
index 13cb008b6c..c317e1f479 100644
--- a/examples/sphere-mollweide.js
+++ b/examples/sphere-mollweide.js
@@ -1,7 +1,7 @@
import Graticule from '../src/ol/Graticule.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
@@ -28,7 +28,7 @@ var map = new _ol_Map_({
new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries-110m.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
})
})
],
diff --git a/examples/street-labels.js b/examples/street-labels.js
index aee202b175..acc7330bbf 100644
--- a/examples/street-labels.js
+++ b/examples/street-labels.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import * as _ol_extent_ from '../src/ol/extent.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
@@ -30,7 +30,7 @@ var map = new _ol_Map_({
}), new _ol_layer_Vector_({
declutter: true,
source: new _ol_source_Vector_({
- format: new _ol_format_GeoJSON_(),
+ format: new GeoJSON(),
url: 'data/geojson/vienna-streets.geojson'
}),
style: function(feature) {
diff --git a/examples/topojson.js b/examples/topojson.js
index 2d302eaa4c..e38db9bbbd 100644
--- a/examples/topojson.js
+++ b/examples/topojson.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
+import TopoJSON from '../src/ol/format/TopoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
@@ -29,7 +29,7 @@ var style = new _ol_style_Style_({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/topojson/world-110m.json',
- format: new _ol_format_TopoJSON_({
+ format: new TopoJSON({
// don't want to render the full world polygon (stored as 'land' layer),
// which repeats all countries
layers: ['countries']
diff --git a/examples/translate-features.js b/examples/translate-features.js
index 54cecc4e4c..23d8d50ec9 100644
--- a/examples/translate-features.js
+++ b/examples/translate-features.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js';
@@ -17,7 +17,7 @@ var raster = new _ol_layer_Tile_({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
})
});
diff --git a/examples/turf.js b/examples/turf.js
index a4a8f59c7d..d53aa6a293 100644
--- a/examples/turf.js
+++ b/examples/turf.js
@@ -2,7 +2,7 @@
// this example uses turf.js for which we don't have an externs file.
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import {fromLonLat} from '../src/ol/proj.js';
@@ -14,7 +14,7 @@ var source = new _ol_source_Vector_();
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json();
}).then(function(json) {
- var format = new _ol_format_GeoJSON_();
+ var format = new GeoJSON();
var features = format.readFeatures(json);
var street = features[0];
diff --git a/examples/vector-esri-edit.js b/examples/vector-esri-edit.js
index 67efdf147e..8525e7272f 100644
--- a/examples/vector-esri-edit.js
+++ b/examples/vector-esri-edit.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_EsriJSON_ from '../src/ol/format/EsriJSON.js';
+import EsriJSON from '../src/ol/format/EsriJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import Draw from '../src/ol/interaction/Draw.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
@@ -18,7 +18,7 @@ var serviceUrl = 'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/' +
'services/PDX_Pedestrian_Districts/FeatureServer/';
var layer = '0';
-var esrijsonFormat = new _ol_format_EsriJSON_();
+var esrijsonFormat = new EsriJSON();
var vectorSource = new _ol_source_Vector_({
loader: function(extent, resolution, projection) {
diff --git a/examples/vector-esri.js b/examples/vector-esri.js
index 6f92b77c10..830455b844 100644
--- a/examples/vector-esri.js
+++ b/examples/vector-esri.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_EsriJSON_ from '../src/ol/format/EsriJSON.js';
+import EsriJSON from '../src/ol/format/EsriJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
@@ -17,7 +17,7 @@ var serviceUrl = 'https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/'
'Petroleum/KSFields/FeatureServer/';
var layer = '0';
-var esrijsonFormat = new _ol_format_EsriJSON_();
+var esrijsonFormat = new EsriJSON();
var styleCache = {
'ABANDONED': new _ol_style_Style_({
diff --git a/examples/vector-label-decluttering.js b/examples/vector-label-decluttering.js
index d7b95b515f..dc1a1c92ca 100644
--- a/examples/vector-label-decluttering.js
+++ b/examples/vector-label-decluttering.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import * as _ol_extent_ from '../src/ol/extent.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
@@ -61,7 +61,7 @@ var style = [countryStyle, labelStyle];
var vectorLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: function(feature) {
labelStyle.getText().setText(feature.get('name'));
diff --git a/examples/vector-labels.js b/examples/vector-labels.js
index e39e1d8630..ffe12c6d68 100644
--- a/examples/vector-labels.js
+++ b/examples/vector-labels.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -143,7 +143,7 @@ function polygonStyleFunction(feature, resolution) {
var vectorPolygons = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/polygon-samples.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: polygonStyleFunction
});
@@ -163,7 +163,7 @@ function lineStyleFunction(feature, resolution) {
var vectorLines = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/line-samples.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: lineStyleFunction
});
@@ -184,7 +184,7 @@ function pointStyleFunction(feature, resolution) {
var vectorPoints = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/point-samples.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: pointStyleFunction
});
diff --git a/examples/vector-layer.js b/examples/vector-layer.js
index 14d340e96a..53b340a584 100644
--- a/examples/vector-layer.js
+++ b/examples/vector-layer.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
@@ -32,7 +32,7 @@ var style = new _ol_style_Style_({
var vectorLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
- format: new _ol_format_GeoJSON_()
+ format: new GeoJSON()
}),
style: function(feature) {
style.getText().setText(feature.get('name'));
diff --git a/examples/vector-osm.js b/examples/vector-osm.js
index 394ef3e564..3b0c2de29e 100644
--- a/examples/vector-osm.js
+++ b/examples/vector-osm.js
@@ -1,7 +1,7 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
-import _ol_format_OSMXML_ from '../src/ol/format/OSMXML.js';
+import OSMXML from '../src/ol/format/OSMXML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
@@ -78,13 +78,13 @@ var styles = {
};
var vectorSource = new _ol_source_Vector_({
- format: new _ol_format_OSMXML_(),
+ format: new OSMXML(),
loader: function(extent, resolution, projection) {
var epsg4326Extent = transformExtent(extent, projection, 'EPSG:4326');
var client = new XMLHttpRequest();
client.open('POST', 'https://overpass-api.de/api/interpreter');
client.addEventListener('load', function() {
- var features = new _ol_format_OSMXML_().readFeatures(client.responseText, {
+ var features = new OSMXML().readFeatures(client.responseText, {
featureProjection: map.getView().getProjection()
});
vectorSource.addFeatures(features);
diff --git a/examples/vector-tile-info.js b/examples/vector-tile-info.js
index b43407df8f..c1dcaee573 100644
--- a/examples/vector-tile-info.js
+++ b/examples/vector-tile-info.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_MVT_ from '../src/ol/format/MVT.js';
+import MVT from '../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
@@ -12,7 +12,7 @@ var map = new _ol_Map_({
}),
layers: [new _ol_layer_VectorTile_({
source: new _ol_source_VectorTile_({
- format: new _ol_format_MVT_(),
+ format: new MVT(),
url: 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf'
})
})]
diff --git a/examples/vector-wfs-getfeature.js b/examples/vector-wfs-getfeature.js
index 3473a2fb08..88ed061556 100644
--- a/examples/vector-wfs-getfeature.js
+++ b/examples/vector-wfs-getfeature.js
@@ -1,8 +1,8 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_filter_ from '../src/ol/format/filter.js';
-import _ol_format_WFS_ from '../src/ol/format/WFS.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import WFS from '../src/ol/format/WFS.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
@@ -40,7 +40,7 @@ var map = new _ol_Map_({
});
// generate a GetFeature request
-var featureRequest = new _ol_format_WFS_().writeGetFeature({
+var featureRequest = new WFS().writeGetFeature({
srsName: 'EPSG:3857',
featureNS: 'http://openstreemap.org',
featurePrefix: 'osm',
@@ -59,7 +59,7 @@ fetch('https://ahocevar.com/geoserver/wfs', {
}).then(function(response) {
return response.json();
}).then(function(json) {
- var features = new _ol_format_GeoJSON_().readFeatures(json);
+ var features = new GeoJSON().readFeatures(json);
vectorSource.addFeatures(features);
map.getView().fit(vectorSource.getExtent());
});
diff --git a/examples/vector-wfs.js b/examples/vector-wfs.js
index 64114664b8..8e242b28f9 100644
--- a/examples/vector-wfs.js
+++ b/examples/vector-wfs.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
+import GeoJSON from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
@@ -11,7 +11,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
var vectorSource = new _ol_source_Vector_({
- format: new _ol_format_GeoJSON_(),
+ format: new GeoJSON(),
url: function(extent) {
return 'https://ahocevar.com/geoserver/wfs?service=WFS&' +
'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +
diff --git a/examples/wkt.js b/examples/wkt.js
index 428460b16a..d53364658d 100644
--- a/examples/wkt.js
+++ b/examples/wkt.js
@@ -1,6 +1,6 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
-import _ol_format_WKT_ from '../src/ol/format/WKT.js';
+import WKT from '../src/ol/format/WKT.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
@@ -14,7 +14,7 @@ var wkt = 'POLYGON((10.689 -25.092, 34.595 ' +
'-20.170, 38.814 -35.639, 13.502 ' +
'-39.155, 10.689 -25.092))';
-var format = new _ol_format_WKT_();
+var format = new WKT();
var feature = format.readFeature(wkt, {
dataProjection: 'EPSG:4326',
diff --git a/examples/wms-capabilities.js b/examples/wms-capabilities.js
index 5b673fe42e..53ab1cafc8 100644
--- a/examples/wms-capabilities.js
+++ b/examples/wms-capabilities.js
@@ -1,6 +1,6 @@
-import _ol_format_WMSCapabilities_ from '../src/ol/format/WMSCapabilities.js';
+import WMSCapabilities from '../src/ol/format/WMSCapabilities.js';
-var parser = new _ol_format_WMSCapabilities_();
+var parser = new WMSCapabilities();
fetch('data/ogcsample.xml').then(function(response) {
return response.text();
diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js
index 2c2ae83e76..f91049d7fb 100644
--- a/src/ol/format/EsriJSON.js
+++ b/src/ol/format/EsriJSON.js
@@ -5,8 +5,8 @@ import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_asserts_ from '../asserts.js';
import {containsExtent} from '../extent.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
+import FeatureFormat from '../format/Feature.js';
+import JSONFeature from '../format/JSONFeature.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
import LineString from '../geom/LineString.js';
@@ -30,11 +30,11 @@ import {get as getProjection} from '../proj.js';
* @param {olx.format.EsriJSONOptions=} opt_options Options.
* @api
*/
-var _ol_format_EsriJSON_ = function(opt_options) {
+var EsriJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
- _ol_format_JSONFeature_.call(this);
+ JSONFeature.call(this);
/**
* Name of the geometry attribute for features.
@@ -45,7 +45,7 @@ var _ol_format_EsriJSON_ = function(opt_options) {
};
-inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_);
+inherits(EsriJSON, JSONFeature);
/**
@@ -54,7 +54,7 @@ inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_);
* @private
* @return {ol.geom.Geometry} Geometry.
*/
-_ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
+EsriJSON.readGeometry_ = function(object, opt_options) {
if (!object) {
return null;
}
@@ -71,8 +71,8 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
type = GeometryType.MULTI_LINE_STRING;
}
} else if (object.rings) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
- var rings = _ol_format_EsriJSON_.convertRings_(object.rings, layout);
+ var layout = EsriJSON.getGeometryLayout_(object);
+ var rings = EsriJSON.convertRings_(object.rings, layout);
object = /** @type {EsriJSONGeometry} */(_ol_obj_.assign({}, object));
if (rings.length === 1) {
type = GeometryType.POLYGON;
@@ -82,9 +82,9 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
object.rings = rings;
}
}
- var geometryReader = _ol_format_EsriJSON_.GEOMETRY_READERS_[type];
+ var geometryReader = EsriJSON.GEOMETRY_READERS_[type];
return (
- /** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
+ /** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
geometryReader(object), false, opt_options)
);
};
@@ -100,7 +100,7 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
* @private
* @return {Array.>>} Transformed rings.
*/
-_ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
+EsriJSON.convertRings_ = function(rings, layout) {
var flatRing = [];
var outerRings = [];
var holes = [];
@@ -149,7 +149,7 @@ _ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
* @private
* @return {ol.geom.Geometry} Point.
*/
-_ol_format_EsriJSON_.readPointGeometry_ = function(object) {
+EsriJSON.readPointGeometry_ = function(object) {
var point;
if (object.m !== undefined && object.z !== undefined) {
point = new Point([object.x, object.y, object.z, object.m],
@@ -172,8 +172,8 @@ _ol_format_EsriJSON_.readPointGeometry_ = function(object) {
* @private
* @return {ol.geom.Geometry} LineString.
*/
-_ol_format_EsriJSON_.readLineStringGeometry_ = function(object) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
+EsriJSON.readLineStringGeometry_ = function(object) {
+ var layout = EsriJSON.getGeometryLayout_(object);
return new LineString(object.paths[0], layout);
};
@@ -183,8 +183,8 @@ _ol_format_EsriJSON_.readLineStringGeometry_ = function(object) {
* @private
* @return {ol.geom.Geometry} MultiLineString.
*/
-_ol_format_EsriJSON_.readMultiLineStringGeometry_ = function(object) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
+EsriJSON.readMultiLineStringGeometry_ = function(object) {
+ var layout = EsriJSON.getGeometryLayout_(object);
return new MultiLineString(object.paths, layout);
};
@@ -194,7 +194,7 @@ _ol_format_EsriJSON_.readMultiLineStringGeometry_ = function(object) {
* @private
* @return {ol.geom.GeometryLayout} The geometry layout to use.
*/
-_ol_format_EsriJSON_.getGeometryLayout_ = function(object) {
+EsriJSON.getGeometryLayout_ = function(object) {
var layout = GeometryLayout.XY;
if (object.hasZ === true && object.hasM === true) {
layout = GeometryLayout.XYZM;
@@ -212,8 +212,8 @@ _ol_format_EsriJSON_.getGeometryLayout_ = function(object) {
* @private
* @return {ol.geom.Geometry} MultiPoint.
*/
-_ol_format_EsriJSON_.readMultiPointGeometry_ = function(object) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
+EsriJSON.readMultiPointGeometry_ = function(object) {
+ var layout = EsriJSON.getGeometryLayout_(object);
return new MultiPoint(object.points, layout);
};
@@ -223,8 +223,8 @@ _ol_format_EsriJSON_.readMultiPointGeometry_ = function(object) {
* @private
* @return {ol.geom.Geometry} MultiPolygon.
*/
-_ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
+EsriJSON.readMultiPolygonGeometry_ = function(object) {
+ var layout = EsriJSON.getGeometryLayout_(object);
return new MultiPolygon(
/** @type {Array.>>>} */(object.rings),
layout);
@@ -236,8 +236,8 @@ _ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
* @private
* @return {ol.geom.Geometry} Polygon.
*/
-_ol_format_EsriJSON_.readPolygonGeometry_ = function(object) {
- var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
+EsriJSON.readPolygonGeometry_ = function(object) {
+ var layout = EsriJSON.getGeometryLayout_(object);
return new Polygon(object.rings, layout);
};
@@ -248,7 +248,7 @@ _ol_format_EsriJSON_.readPolygonGeometry_ = function(object) {
* @private
* @return {EsriJSONGeometry} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
+EsriJSON.writePointGeometry_ = function(geometry, opt_options) {
var coordinates = /** @type {ol.geom.Point} */ (geometry).getCoordinates();
var esriJSON;
var layout = /** @type {ol.geom.Point} */ (geometry).getLayout();
@@ -288,7 +288,7 @@ _ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
* @private
* @return {Object} Object with boolean hasZ and hasM keys.
*/
-_ol_format_EsriJSON_.getHasZM_ = function(geometry) {
+EsriJSON.getHasZM_ = function(geometry) {
var layout = geometry.getLayout();
return {
hasZ: (layout === GeometryLayout.XYZ ||
@@ -305,8 +305,8 @@ _ol_format_EsriJSON_.getHasZM_ = function(geometry) {
* @private
* @return {EsriJSONPolyline} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
- var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.LineString} */(geometry));
+EsriJSON.writeLineStringGeometry_ = function(geometry, opt_options) {
+ var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.LineString} */(geometry));
return /** @type {EsriJSONPolyline} */ ({
hasZ: hasZM.hasZ,
hasM: hasZM.hasM,
@@ -323,9 +323,9 @@ _ol_format_EsriJSON_.writeLineStringGeometry_ = function(geometry, opt_options)
* @private
* @return {EsriJSONPolygon} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
+EsriJSON.writePolygonGeometry_ = function(geometry, opt_options) {
// Esri geometries use the left-hand rule
- var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.Polygon} */(geometry));
+ var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.Polygon} */(geometry));
return /** @type {EsriJSONPolygon} */ ({
hasZ: hasZM.hasZ,
hasM: hasZM.hasM,
@@ -340,8 +340,8 @@ _ol_format_EsriJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
* @private
* @return {EsriJSONPolyline} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
- var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiLineString} */(geometry));
+EsriJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
+ var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiLineString} */(geometry));
return /** @type {EsriJSONPolyline} */ ({
hasZ: hasZM.hasZ,
hasM: hasZM.hasM,
@@ -356,8 +356,8 @@ _ol_format_EsriJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_opti
* @private
* @return {EsriJSONMultipoint} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
- var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiPoint} */(geometry));
+EsriJSON.writeMultiPointGeometry_ = function(geometry, opt_options) {
+ var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiPoint} */(geometry));
return /** @type {EsriJSONMultipoint} */ ({
hasZ: hasZM.hasZ,
hasM: hasZM.hasM,
@@ -372,9 +372,9 @@ _ol_format_EsriJSON_.writeMultiPointGeometry_ = function(geometry, opt_options)
* @private
* @return {EsriJSONPolygon} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writeMultiPolygonGeometry_ = function(geometry,
+EsriJSON.writeMultiPolygonGeometry_ = function(geometry,
opt_options) {
- var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiPolygon} */(geometry));
+ var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiPolygon} */(geometry));
var coordinates = /** @type {ol.geom.MultiPolygon} */ (geometry).getCoordinates(false);
var output = [];
for (var i = 0; i < coordinates.length; i++) {
@@ -395,19 +395,19 @@ _ol_format_EsriJSON_.writeMultiPolygonGeometry_ = function(geometry,
* @private
* @type {Object.}
*/
-_ol_format_EsriJSON_.GEOMETRY_READERS_ = {};
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.POINT] =
- _ol_format_EsriJSON_.readPointGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.LINE_STRING] =
- _ol_format_EsriJSON_.readLineStringGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.POLYGON] =
- _ol_format_EsriJSON_.readPolygonGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POINT] =
- _ol_format_EsriJSON_.readMultiPointGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_LINE_STRING] =
- _ol_format_EsriJSON_.readMultiLineStringGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
- _ol_format_EsriJSON_.readMultiPolygonGeometry_;
+EsriJSON.GEOMETRY_READERS_ = {};
+EsriJSON.GEOMETRY_READERS_[GeometryType.POINT] =
+ EsriJSON.readPointGeometry_;
+EsriJSON.GEOMETRY_READERS_[GeometryType.LINE_STRING] =
+ EsriJSON.readLineStringGeometry_;
+EsriJSON.GEOMETRY_READERS_[GeometryType.POLYGON] =
+ EsriJSON.readPolygonGeometry_;
+EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_POINT] =
+ EsriJSON.readMultiPointGeometry_;
+EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_LINE_STRING] =
+ EsriJSON.readMultiLineStringGeometry_;
+EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
+ EsriJSON.readMultiPolygonGeometry_;
/**
@@ -415,19 +415,19 @@ _ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
* @private
* @type {Object.}
*/
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_ = {};
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.POINT] =
- _ol_format_EsriJSON_.writePointGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.LINE_STRING] =
- _ol_format_EsriJSON_.writeLineStringGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.POLYGON] =
- _ol_format_EsriJSON_.writePolygonGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POINT] =
- _ol_format_EsriJSON_.writeMultiPointGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_LINE_STRING] =
- _ol_format_EsriJSON_.writeMultiLineStringGeometry_;
-_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
- _ol_format_EsriJSON_.writeMultiPolygonGeometry_;
+EsriJSON.GEOMETRY_WRITERS_ = {};
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.POINT] =
+ EsriJSON.writePointGeometry_;
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.LINE_STRING] =
+ EsriJSON.writeLineStringGeometry_;
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.POLYGON] =
+ EsriJSON.writePolygonGeometry_;
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_POINT] =
+ EsriJSON.writeMultiPointGeometry_;
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_LINE_STRING] =
+ EsriJSON.writeMultiLineStringGeometry_;
+EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
+ EsriJSON.writeMultiPolygonGeometry_;
/**
@@ -440,7 +440,7 @@ _ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
* @return {ol.Feature} Feature.
* @api
*/
-_ol_format_EsriJSON_.prototype.readFeature;
+EsriJSON.prototype.readFeature;
/**
@@ -453,16 +453,16 @@ _ol_format_EsriJSON_.prototype.readFeature;
* @return {Array.} Features.
* @api
*/
-_ol_format_EsriJSON_.prototype.readFeatures;
+EsriJSON.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_EsriJSON_.prototype.readFeatureFromObject = function(
+EsriJSON.prototype.readFeatureFromObject = function(
object, opt_options) {
var esriJSONFeature = /** @type {EsriJSONFeature} */ (object);
- var geometry = _ol_format_EsriJSON_.readGeometry_(esriJSONFeature.geometry,
+ var geometry = EsriJSON.readGeometry_(esriJSONFeature.geometry,
opt_options);
var feature = new _ol_Feature_();
if (this.geometryName_) {
@@ -484,7 +484,7 @@ _ol_format_EsriJSON_.prototype.readFeatureFromObject = function(
/**
* @inheritDoc
*/
-_ol_format_EsriJSON_.prototype.readFeaturesFromObject = function(
+EsriJSON.prototype.readFeaturesFromObject = function(
object, opt_options) {
var esriJSONObject = /** @type {EsriJSONObject} */ (object);
var options = opt_options ? opt_options : {};
@@ -516,15 +516,15 @@ _ol_format_EsriJSON_.prototype.readFeaturesFromObject = function(
* @return {ol.geom.Geometry} Geometry.
* @api
*/
-_ol_format_EsriJSON_.prototype.readGeometry;
+EsriJSON.prototype.readGeometry;
/**
* @inheritDoc
*/
-_ol_format_EsriJSON_.prototype.readGeometryFromObject = function(
+EsriJSON.prototype.readGeometryFromObject = function(
object, opt_options) {
- return _ol_format_EsriJSON_.readGeometry_(
+ return EsriJSON.readGeometry_(
/** @type {EsriJSONGeometry} */(object), opt_options);
};
@@ -537,13 +537,13 @@ _ol_format_EsriJSON_.prototype.readGeometryFromObject = function(
* @return {ol.proj.Projection} Projection.
* @api
*/
-_ol_format_EsriJSON_.prototype.readProjection;
+EsriJSON.prototype.readProjection;
/**
* @inheritDoc
*/
-_ol_format_EsriJSON_.prototype.readProjectionFromObject = function(object) {
+EsriJSON.prototype.readProjectionFromObject = function(object) {
var esriJSONObject = /** @type {EsriJSONObject} */ (object);
if (esriJSONObject.spatialReference && esriJSONObject.spatialReference.wkid) {
var crs = esriJSONObject.spatialReference.wkid;
@@ -560,10 +560,10 @@ _ol_format_EsriJSON_.prototype.readProjectionFromObject = function(object) {
* @private
* @return {EsriJSONGeometry} EsriJSON geometry.
*/
-_ol_format_EsriJSON_.writeGeometry_ = function(geometry, opt_options) {
- var geometryWriter = _ol_format_EsriJSON_.GEOMETRY_WRITERS_[geometry.getType()];
+EsriJSON.writeGeometry_ = function(geometry, opt_options) {
+ var geometryWriter = EsriJSON.GEOMETRY_WRITERS_[geometry.getType()];
return geometryWriter(/** @type {ol.geom.Geometry} */(
- _ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
+ FeatureFormat.transformWithOptions(geometry, true, opt_options)),
opt_options);
};
@@ -577,7 +577,7 @@ _ol_format_EsriJSON_.writeGeometry_ = function(geometry, opt_options) {
* @return {string} EsriJSON.
* @api
*/
-_ol_format_EsriJSON_.prototype.writeGeometry;
+EsriJSON.prototype.writeGeometry;
/**
@@ -589,9 +589,9 @@ _ol_format_EsriJSON_.prototype.writeGeometry;
* @override
* @api
*/
-_ol_format_EsriJSON_.prototype.writeGeometryObject = function(geometry,
+EsriJSON.prototype.writeGeometryObject = function(geometry,
opt_options) {
- return _ol_format_EsriJSON_.writeGeometry_(geometry,
+ return EsriJSON.writeGeometry_(geometry,
this.adaptOptions(opt_options));
};
@@ -605,7 +605,7 @@ _ol_format_EsriJSON_.prototype.writeGeometryObject = function(geometry,
* @return {string} EsriJSON.
* @api
*/
-_ol_format_EsriJSON_.prototype.writeFeature;
+EsriJSON.prototype.writeFeature;
/**
@@ -617,14 +617,14 @@ _ol_format_EsriJSON_.prototype.writeFeature;
* @override
* @api
*/
-_ol_format_EsriJSON_.prototype.writeFeatureObject = function(
+EsriJSON.prototype.writeFeatureObject = function(
feature, opt_options) {
opt_options = this.adaptOptions(opt_options);
var object = {};
var geometry = feature.getGeometry();
if (geometry) {
object['geometry'] =
- _ol_format_EsriJSON_.writeGeometry_(geometry, opt_options);
+ EsriJSON.writeGeometry_(geometry, opt_options);
if (opt_options && opt_options.featureProjection) {
object['geometry']['spatialReference'] = /** @type {EsriJSONCRS} */({
wkid: getProjection(opt_options.featureProjection).getCode().split(':').pop()
@@ -651,7 +651,7 @@ _ol_format_EsriJSON_.prototype.writeFeatureObject = function(
* @return {string} EsriJSON.
* @api
*/
-_ol_format_EsriJSON_.prototype.writeFeatures;
+EsriJSON.prototype.writeFeatures;
/**
@@ -663,7 +663,7 @@ _ol_format_EsriJSON_.prototype.writeFeatures;
* @override
* @api
*/
-_ol_format_EsriJSON_.prototype.writeFeaturesObject = function(features, opt_options) {
+EsriJSON.prototype.writeFeaturesObject = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
var objects = [];
var i, ii;
@@ -674,4 +674,4 @@ _ol_format_EsriJSON_.prototype.writeFeaturesObject = function(features, opt_opti
'features': objects
});
};
-export default _ol_format_EsriJSON_;
+export default EsriJSON;
diff --git a/src/ol/format/Feature.js b/src/ol/format/Feature.js
index baaf9a1f3b..8bdd170b00 100644
--- a/src/ol/format/Feature.js
+++ b/src/ol/format/Feature.js
@@ -18,7 +18,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
* @abstract
* @api
*/
-var _ol_format_Feature_ = function() {
+var FeatureFormat = function() {
/**
* @protected
@@ -42,7 +42,7 @@ var _ol_format_Feature_ = function() {
* @return {olx.format.ReadOptions|undefined} Options.
* @protected
*/
-_ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
+FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
var options;
if (opt_options) {
options = {
@@ -64,7 +64,7 @@ _ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
* Updated options.
*/
-_ol_format_Feature_.prototype.adaptOptions = function(options) {
+FeatureFormat.prototype.adaptOptions = function(options) {
return _ol_obj_.assign({
dataProjection: this.defaultDataProjection,
featureProjection: this.defaultFeatureProjection
@@ -76,7 +76,7 @@ _ol_format_Feature_.prototype.adaptOptions = function(options) {
* Get the extent from the source of the last {@link readFeatures} call.
* @return {ol.Extent} Tile extent.
*/
-_ol_format_Feature_.prototype.getLastExtent = function() {
+FeatureFormat.prototype.getLastExtent = function() {
return null;
};
@@ -85,7 +85,7 @@ _ol_format_Feature_.prototype.getLastExtent = function() {
* @abstract
* @return {ol.format.FormatType} Format.
*/
-_ol_format_Feature_.prototype.getType = function() {};
+FeatureFormat.prototype.getType = function() {};
/**
@@ -96,7 +96,7 @@ _ol_format_Feature_.prototype.getType = function() {};
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
*/
-_ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
+FeatureFormat.prototype.readFeature = function(source, opt_options) {};
/**
@@ -107,7 +107,7 @@ _ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.} Features.
*/
-_ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
+FeatureFormat.prototype.readFeatures = function(source, opt_options) {};
/**
@@ -118,7 +118,7 @@ _ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.geom.Geometry} Geometry.
*/
-_ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
+FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
/**
@@ -128,7 +128,7 @@ _ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
*/
-_ol_format_Feature_.prototype.readProjection = function(source) {};
+FeatureFormat.prototype.readProjection = function(source) {};
/**
@@ -139,7 +139,7 @@ _ol_format_Feature_.prototype.readProjection = function(source) {};
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
-_ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
+FeatureFormat.prototype.writeFeature = function(feature, opt_options) {};
/**
@@ -150,7 +150,7 @@ _ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
-_ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {};
+FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
/**
@@ -161,7 +161,7 @@ _ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {}
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
-_ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {};
+FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
/**
@@ -172,7 +172,7 @@ _ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {}
* @return {ol.geom.Geometry|ol.Extent} Transformed geometry.
* @protected
*/
-_ol_format_Feature_.transformWithOptions = function(
+FeatureFormat.transformWithOptions = function(
geometry, write, opt_options) {
var featureProjection = opt_options ?
getProjection(opt_options.featureProjection) : null;
@@ -219,4 +219,4 @@ _ol_format_Feature_.transformWithOptions = function(
}
return transformed;
};
-export default _ol_format_Feature_;
+export default FeatureFormat;
diff --git a/src/ol/format/GML.js b/src/ol/format/GML.js
index edcf6ce97b..740506185c 100644
--- a/src/ol/format/GML.js
+++ b/src/ol/format/GML.js
@@ -1,7 +1,7 @@
/**
* @module ol/format/GML
*/
-import _ol_format_GML3_ from '../format/GML3.js';
+import GML3 from '../format/GML3.js';
/**
* @classdesc
@@ -15,7 +15,7 @@ import _ol_format_GML3_ from '../format/GML3.js';
* @extends {ol.format.GMLBase}
* @api
*/
-var _ol_format_GML_ = _ol_format_GML3_;
+var _ol_format_GML_ = GML3;
/**
diff --git a/src/ol/format/GML2.js b/src/ol/format/GML2.js
index 4d1d7a9aaf..701b460c40 100644
--- a/src/ol/format/GML2.js
+++ b/src/ol/format/GML2.js
@@ -3,9 +3,9 @@
*/
import {inherits} from '../index.js';
import {createOrUpdate} from '../extent.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_GMLBase_ from '../format/GMLBase.js';
-import _ol_format_XSD_ from '../format/XSD.js';
+import FeatureFormat from '../format/Feature.js';
+import GMLBase from '../format/GMLBase.js';
+import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js';
import _ol_obj_ from '../obj.js';
import {get as getProjection, transformExtent} from '../proj.js';
@@ -21,25 +21,25 @@ import _ol_xml_ from '../xml.js';
* @extends {ol.format.GMLBase}
* @api
*/
-var _ol_format_GML2_ = function(opt_options) {
+var GML2 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
- _ol_format_GMLBase_.call(this, options);
+ GMLBase.call(this, options);
- this.FEATURE_COLLECTION_PARSERS[_ol_format_GMLBase_.GMLNS][
+ this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS][
'featureMember'] =
- _ol_xml_.makeArrayPusher(_ol_format_GMLBase_.prototype.readFeaturesInternal);
+ _ol_xml_.makeArrayPusher(GMLBase.prototype.readFeaturesInternal);
/**
* @inheritDoc
*/
this.schemaLocation = options.schemaLocation ?
- options.schemaLocation : _ol_format_GML2_.schemaLocation_;
+ options.schemaLocation : GML2.schemaLocation_;
};
-inherits(_ol_format_GML2_, _ol_format_GMLBase_);
+inherits(GML2, GMLBase);
/**
@@ -47,7 +47,7 @@ inherits(_ol_format_GML2_, _ol_format_GMLBase_);
* @type {string}
* @private
*/
-_ol_format_GML2_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
+GML2.schemaLocation_ = GMLBase.GMLNS +
' http://schemas.opengis.net/gml/2.1.2/feature.xsd';
@@ -57,7 +57,7 @@ _ol_format_GML2_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
* @private
* @return {Array.|undefined} Flat coordinates.
*/
-_ol_format_GML2_.prototype.readFlatCoordinates_ = function(node, objectStack) {
+GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
var s = _ol_xml_.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
var containerSrs = context['srsName'];
@@ -92,7 +92,7 @@ _ol_format_GML2_.prototype.readFlatCoordinates_ = function(node, objectStack) {
* @private
* @return {ol.Extent|undefined} Envelope.
*/
-_ol_format_GML2_.prototype.readBox_ = function(node, objectStack) {
+GML2.prototype.readBox_ = function(node, objectStack) {
/** @type {Array.} */
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
this.BOX_PARSERS_, node, objectStack, this);
@@ -107,7 +107,7 @@ _ol_format_GML2_.prototype.readBox_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML2_.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
+GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
@@ -124,7 +124,7 @@ _ol_format_GML2_.prototype.innerBoundaryIsParser_ = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML2_.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
+GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
@@ -141,10 +141,10 @@ _ol_format_GML2_.prototype.outerBoundaryIsParser_ = function(node, objectStack)
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
+GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
'http://www.opengis.net/gml': {
'coordinates': _ol_xml_.makeReplacer(
- _ol_format_GML2_.prototype.readFlatCoordinates_)
+ GML2.prototype.readFlatCoordinates_)
}
};
@@ -154,10 +154,10 @@ _ol_format_GML2_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
+GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'innerBoundaryIs': _ol_format_GML2_.prototype.innerBoundaryIsParser_,
- 'outerBoundaryIs': _ol_format_GML2_.prototype.outerBoundaryIsParser_
+ 'innerBoundaryIs': GML2.prototype.innerBoundaryIsParser_,
+ 'outerBoundaryIs': GML2.prototype.outerBoundaryIsParser_
}
};
@@ -167,10 +167,10 @@ _ol_format_GML2_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.prototype.BOX_PARSERS_ = {
+GML2.prototype.BOX_PARSERS_ = {
'http://www.opengis.net/gml': {
'coordinates': _ol_xml_.makeArrayPusher(
- _ol_format_GML2_.prototype.readFlatCoordinates_)
+ GML2.prototype.readFlatCoordinates_)
}
};
@@ -180,21 +180,21 @@ _ol_format_GML2_.prototype.BOX_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.prototype.GEOMETRY_PARSERS_ = {
+GML2.prototype.GEOMETRY_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'Point': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPoint),
+ 'Point': _ol_xml_.makeReplacer(GMLBase.prototype.readPoint),
'MultiPoint': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiPoint),
+ GMLBase.prototype.readMultiPoint),
'LineString': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readLineString),
+ GMLBase.prototype.readLineString),
'MultiLineString': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiLineString),
+ GMLBase.prototype.readMultiLineString),
'LinearRing': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readLinearRing),
- 'Polygon': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPolygon),
+ GMLBase.prototype.readLinearRing),
+ 'Polygon': _ol_xml_.makeReplacer(GMLBase.prototype.readPolygon),
'MultiPolygon': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiPolygon),
- 'Box': _ol_xml_.makeReplacer(_ol_format_GML2_.prototype.readBox_)
+ GMLBase.prototype.readMultiPolygon),
+ 'Box': _ol_xml_.makeReplacer(GML2.prototype.readBox_)
}
};
@@ -207,7 +207,7 @@ _ol_format_GML2_.prototype.GEOMETRY_PARSERS_ = {
* @return {Node|undefined} Node.
* @private
*/
-_ol_format_GML2_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML2.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var context = objectStack[objectStack.length - 1];
var multiSurface = context['multiSurface'];
var surface = context['surface'];
@@ -235,7 +235,7 @@ _ol_format_GML2_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
* @param {ol.Feature} feature Feature.
* @param {Array.<*>} objectStack Node stack.
*/
-_ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectStack) {
+GML2.prototype.writeFeatureElement = function(node, feature, objectStack) {
var fid = feature.getId();
if (fid) {
node.setAttribute('fid', fid);
@@ -262,7 +262,7 @@ _ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectS
} else {
if (!(key in context.serializers[featureNS])) {
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeStringTextNode);
+ XSD.writeStringTextNode);
}
}
}
@@ -282,7 +282,7 @@ _ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectS
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
* @param {Array.<*>} objectStack Node stack.
*/
-_ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objectStack) {
+GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
var context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
var item = _ol_obj_.assign({}, context);
item.node = node;
@@ -296,10 +296,10 @@ _ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objec
}
} else {
value =
- _ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
+ FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
}
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
- (item), _ol_format_GML2_.GEOMETRY_SERIALIZERS_,
+ (item), GML2.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
};
@@ -311,7 +311,7 @@ _ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objec
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
+GML2.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (node.nodeName !== 'LineStringSegment' && srsName) {
@@ -336,7 +336,7 @@ _ol_format_GML2_.prototype.writeCurveOrLineString_ = function(node, geometry, ob
* @returns {Node} coordinates node.
* @private
*/
-_ol_format_GML2_.prototype.createCoordinatesNode_ = function(namespaceURI) {
+GML2.prototype.createCoordinatesNode_ = function(namespaceURI) {
var coordinates = _ol_xml_.createElementNS(namespaceURI, 'coordinates');
coordinates.setAttribute('decimal', '.');
coordinates.setAttribute('cs', ',');
@@ -352,7 +352,7 @@ _ol_format_GML2_.prototype.createCoordinatesNode_ = function(namespaceURI) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack) {
+GML2.prototype.writeCoordinates_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -365,7 +365,7 @@ _ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack
point = points[i];
parts[i] = this.getCoords_(point, srsName, hasZ);
}
- _ol_format_XSD_.writeStringTextNode(node, parts.join(' '));
+ XSD.writeStringTextNode(node, parts.join(' '));
};
@@ -375,7 +375,7 @@ _ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeCurveSegments_ = function(node, line, objectStack) {
+GML2.prototype.writeCurveSegments_ = function(node, line, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI,
'LineStringSegment');
node.appendChild(child);
@@ -389,7 +389,7 @@ _ol_format_GML2_.prototype.writeCurveSegments_ = function(node, line, objectStac
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
+GML2.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -400,7 +400,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
var rings = geometry.getLinearRings();
_ol_xml_.pushSerializeAndPop(
{node: node, hasZ: hasZ, srsName: srsName},
- _ol_format_GML2_.RING_SERIALIZERS_,
+ GML2.RING_SERIALIZERS_,
this.RING_NODE_FACTORY_,
rings, objectStack, undefined, this);
} else if (node.nodeName === 'Surface') {
@@ -419,7 +419,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
* @return {Node} Node.
* @private
*/
-_ol_format_GML2_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML2.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var context = objectStack[objectStack.length - 1];
var parentNode = context.node;
var exteriorWritten = context['exteriorWritten'];
@@ -437,7 +437,7 @@ _ol_format_GML2_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
+GML2.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI, 'PolygonPatch');
node.appendChild(child);
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
@@ -450,7 +450,7 @@ _ol_format_GML2_.prototype.writeSurfacePatches_ = function(node, polygon, object
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeRing_ = function(node, ring, objectStack) {
+GML2.prototype.writeRing_ = function(node, ring, objectStack) {
var linearRing = _ol_xml_.createElementNS(node.namespaceURI, 'LinearRing');
node.appendChild(linearRing);
this.writeLinearRing_(linearRing, ring, objectStack);
@@ -464,7 +464,7 @@ _ol_format_GML2_.prototype.writeRing_ = function(node, ring, objectStack) {
* @return {string} The coords string.
* @private
*/
-_ol_format_GML2_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
+GML2.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
var axisOrientation = 'enu';
if (opt_srsName) {
axisOrientation = getProjection(opt_srsName).getAxisOrientation();
@@ -488,7 +488,7 @@ _ol_format_GML2_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
+GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -498,7 +498,7 @@ _ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
}
var lines = geometry.getLineStrings();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, curve: curve},
- _ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
+ GML2.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines,
objectStack, undefined, this);
};
@@ -510,7 +510,7 @@ _ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
+GML2.prototype.writePoint_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -521,7 +521,7 @@ _ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
node.appendChild(coordinates);
var point = geometry.getCoordinates();
var coord = this.getCoords_(point, srsName, hasZ);
- _ol_format_XSD_.writeStringTextNode(coordinates, coord);
+ XSD.writeStringTextNode(coordinates, coord);
};
@@ -531,7 +531,7 @@ _ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
+GML2.prototype.writeMultiPoint_ = function(node, geometry,
objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
@@ -541,7 +541,7 @@ _ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
}
var points = geometry.getPoints();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName},
- _ol_format_GML2_.POINTMEMBER_SERIALIZERS_,
+ GML2.POINTMEMBER_SERIALIZERS_,
_ol_xml_.makeSimpleNodeFactory('pointMember'), points,
objectStack, undefined, this);
};
@@ -553,7 +553,7 @@ _ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writePointMember_ = function(node, point, objectStack) {
+GML2.prototype.writePointMember_ = function(node, point, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI, 'Point');
node.appendChild(child);
this.writePoint_(child, point, objectStack);
@@ -566,7 +566,7 @@ _ol_format_GML2_.prototype.writePointMember_ = function(node, point, objectStack
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
+GML2.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
if (child) {
node.appendChild(child);
@@ -581,7 +581,7 @@ _ol_format_GML2_.prototype.writeLineStringOrCurveMember_ = function(node, line,
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
+GML2.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -599,7 +599,7 @@ _ol_format_GML2_.prototype.writeLinearRing_ = function(node, geometry, objectSta
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
+GML2.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -609,7 +609,7 @@ _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
}
var polygons = geometry.getPolygons();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, surface: surface},
- _ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
+ GML2.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons,
objectStack, undefined, this);
};
@@ -621,7 +621,7 @@ _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
+GML2.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
var child = this.GEOMETRY_NODE_FACTORY_(
polygon, objectStack);
if (child) {
@@ -637,7 +637,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
+GML2.prototype.writeEnvelope = function(node, extent, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -646,7 +646,7 @@ _ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
var keys = ['lowerCorner', 'upperCorner'];
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
- ({node: node}), _ol_format_GML2_.ENVELOPE_SERIALIZERS_,
+ ({node: node}), GML2.ENVELOPE_SERIALIZERS_,
_ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
values,
objectStack, keys, this);
@@ -658,31 +658,31 @@ _ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.GEOMETRY_SERIALIZERS_ = {
+GML2.GEOMETRY_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'Curve': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeCurveOrLineString_),
+ GML2.prototype.writeCurveOrLineString_),
'MultiCurve': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeMultiCurveOrLineString_),
- 'Point': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writePoint_),
+ GML2.prototype.writeMultiCurveOrLineString_),
+ 'Point': _ol_xml_.makeChildAppender(GML2.prototype.writePoint_),
'MultiPoint': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeMultiPoint_),
+ GML2.prototype.writeMultiPoint_),
'LineString': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeCurveOrLineString_),
+ GML2.prototype.writeCurveOrLineString_),
'MultiLineString': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeMultiCurveOrLineString_),
+ GML2.prototype.writeMultiCurveOrLineString_),
'LinearRing': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeLinearRing_),
+ GML2.prototype.writeLinearRing_),
'Polygon': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeSurfaceOrPolygon_),
+ GML2.prototype.writeSurfaceOrPolygon_),
'MultiPolygon': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_),
+ GML2.prototype.writeMultiSurfaceOrPolygon_),
'Surface': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeSurfaceOrPolygon_),
+ GML2.prototype.writeSurfaceOrPolygon_),
'MultiSurface': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_),
+ GML2.prototype.writeMultiSurfaceOrPolygon_),
'Envelope': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeEnvelope)
+ GML2.prototype.writeEnvelope)
}
};
@@ -691,10 +691,10 @@ _ol_format_GML2_.GEOMETRY_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.RING_SERIALIZERS_ = {
+GML2.RING_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
- 'outerBoundaryIs': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writeRing_),
- 'innerBoundaryIs': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writeRing_)
+ 'outerBoundaryIs': _ol_xml_.makeChildAppender(GML2.prototype.writeRing_),
+ 'innerBoundaryIs': _ol_xml_.makeChildAppender(GML2.prototype.writeRing_)
}
};
@@ -703,10 +703,10 @@ _ol_format_GML2_.RING_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.POINTMEMBER_SERIALIZERS_ = {
+GML2.POINTMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'pointMember': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writePointMember_)
+ GML2.prototype.writePointMember_)
}
};
@@ -715,12 +715,12 @@ _ol_format_GML2_.POINTMEMBER_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
+GML2.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'lineStringMember': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeLineStringOrCurveMember_),
+ GML2.prototype.writeLineStringOrCurveMember_),
'curveMember': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeLineStringOrCurveMember_)
+ GML2.prototype.writeLineStringOrCurveMember_)
}
};
@@ -733,10 +733,10 @@ _ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
* @return {Node|undefined} Node.
* @private
*/
-_ol_format_GML2_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML2.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
return _ol_xml_.createElementNS('http://www.opengis.net/gml',
- _ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
+ GML2.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
};
/**
@@ -744,7 +744,7 @@ _ol_format_GML2_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value,
* @type {Object.}
* @private
*/
-_ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
+GML2.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
'MultiLineString': 'lineStringMember',
'MultiCurve': 'curveMember',
'MultiPolygon': 'polygonMember',
@@ -757,12 +757,12 @@ _ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
+GML2.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'surfaceMember': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_),
+ GML2.prototype.writeSurfaceOrPolygonMember_),
'polygonMember': _ol_xml_.makeChildAppender(
- _ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_)
+ GML2.prototype.writeSurfaceOrPolygonMember_)
}
};
@@ -771,10 +771,10 @@ _ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML2_.ENVELOPE_SERIALIZERS_ = {
+GML2.ENVELOPE_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
- 'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
+ 'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
}
};
-export default _ol_format_GML2_;
+export default GML2;
diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js
index d5329f9ad1..2d56b1c552 100644
--- a/src/ol/format/GML3.js
+++ b/src/ol/format/GML3.js
@@ -4,9 +4,9 @@
import {inherits} from '../index.js';
import _ol_array_ from '../array.js';
import {createOrUpdate} from '../extent.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_GMLBase_ from '../format/GMLBase.js';
-import _ol_format_XSD_ from '../format/XSD.js';
+import FeatureFormat from '../format/Feature.js';
+import GMLBase from '../format/GMLBase.js';
+import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js';
@@ -29,11 +29,11 @@ import _ol_xml_ from '../xml.js';
* @extends {ol.format.GMLBase}
* @api
*/
-var _ol_format_GML3_ = function(opt_options) {
+var GML3 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
- _ol_format_GMLBase_.call(this, options);
+ GMLBase.call(this, options);
/**
* @private
@@ -65,7 +65,7 @@ var _ol_format_GML3_ = function(opt_options) {
* @inheritDoc
*/
this.schemaLocation = options.schemaLocation ?
- options.schemaLocation : _ol_format_GML3_.schemaLocation_;
+ options.schemaLocation : GML3.schemaLocation_;
/**
* @private
@@ -76,7 +76,7 @@ var _ol_format_GML3_ = function(opt_options) {
};
-inherits(_ol_format_GML3_, _ol_format_GMLBase_);
+inherits(GML3, GMLBase);
/**
@@ -84,7 +84,7 @@ inherits(_ol_format_GML3_, _ol_format_GMLBase_);
* @type {string}
* @private
*/
-_ol_format_GML3_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
+GML3.schemaLocation_ = GMLBase.GMLNS +
' http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' +
'1.0.0/gmlsf.xsd';
@@ -95,7 +95,7 @@ _ol_format_GML3_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
* @private
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
-_ol_format_GML3_.prototype.readMultiCurve_ = function(node, objectStack) {
+GML3.prototype.readMultiCurve_ = function(node, objectStack) {
/** @type {Array.} */
var lineStrings = _ol_xml_.pushParseAndPop([],
this.MULTICURVE_PARSERS_, node, objectStack, this);
@@ -115,7 +115,7 @@ _ol_format_GML3_.prototype.readMultiCurve_ = function(node, objectStack) {
* @private
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
-_ol_format_GML3_.prototype.readMultiSurface_ = function(node, objectStack) {
+GML3.prototype.readMultiSurface_ = function(node, objectStack) {
/** @type {Array.} */
var polygons = _ol_xml_.pushParseAndPop([],
this.MULTISURFACE_PARSERS_, node, objectStack, this);
@@ -134,7 +134,7 @@ _ol_format_GML3_.prototype.readMultiSurface_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML3_.prototype.curveMemberParser_ = function(node, objectStack) {
+GML3.prototype.curveMemberParser_ = function(node, objectStack) {
_ol_xml_.parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
};
@@ -144,7 +144,7 @@ _ol_format_GML3_.prototype.curveMemberParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML3_.prototype.surfaceMemberParser_ = function(node, objectStack) {
+GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
_ol_xml_.parseNode(this.SURFACEMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -156,7 +156,7 @@ _ol_format_GML3_.prototype.surfaceMemberParser_ = function(node, objectStack) {
* @private
* @return {Array.<(Array.)>|undefined} flat coordinates.
*/
-_ol_format_GML3_.prototype.readPatch_ = function(node, objectStack) {
+GML3.prototype.readPatch_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop([null],
this.PATCHES_PARSERS_, node, objectStack, this);
};
@@ -168,7 +168,7 @@ _ol_format_GML3_.prototype.readPatch_ = function(node, objectStack) {
* @private
* @return {Array.|undefined} flat coordinates.
*/
-_ol_format_GML3_.prototype.readSegment_ = function(node, objectStack) {
+GML3.prototype.readSegment_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop([null],
this.SEGMENTS_PARSERS_, node, objectStack, this);
};
@@ -180,7 +180,7 @@ _ol_format_GML3_.prototype.readSegment_ = function(node, objectStack) {
* @private
* @return {Array.<(Array.)>|undefined} flat coordinates.
*/
-_ol_format_GML3_.prototype.readPolygonPatch_ = function(node, objectStack) {
+GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop([null],
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
};
@@ -192,7 +192,7 @@ _ol_format_GML3_.prototype.readPolygonPatch_ = function(node, objectStack) {
* @private
* @return {Array.|undefined} flat coordinates.
*/
-_ol_format_GML3_.prototype.readLineStringSegment_ = function(node, objectStack) {
+GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop([null],
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
node, objectStack, this);
@@ -204,7 +204,7 @@ _ol_format_GML3_.prototype.readLineStringSegment_ = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML3_.prototype.interiorParser_ = function(node, objectStack) {
+GML3.prototype.interiorParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
@@ -221,7 +221,7 @@ _ol_format_GML3_.prototype.interiorParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GML3_.prototype.exteriorParser_ = function(node, objectStack) {
+GML3.prototype.exteriorParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
@@ -239,7 +239,7 @@ _ol_format_GML3_.prototype.exteriorParser_ = function(node, objectStack) {
* @private
* @return {ol.geom.Polygon|undefined} Polygon.
*/
-_ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) {
+GML3.prototype.readSurface_ = function(node, objectStack) {
/** @type {Array.>} */
var flatLinearRings = _ol_xml_.pushParseAndPop([null],
this.SURFACE_PARSERS_, node, objectStack, this);
@@ -267,7 +267,7 @@ _ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) {
* @private
* @return {ol.geom.LineString|undefined} LineString.
*/
-_ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
+GML3.prototype.readCurve_ = function(node, objectStack) {
/** @type {Array.} */
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
this.CURVE_PARSERS_, node, objectStack, this);
@@ -287,7 +287,7 @@ _ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
* @private
* @return {ol.Extent|undefined} Envelope.
*/
-_ol_format_GML3_.prototype.readEnvelope_ = function(node, objectStack) {
+GML3.prototype.readEnvelope_ = function(node, objectStack) {
/** @type {Array.} */
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
this.ENVELOPE_PARSERS_, node, objectStack, this);
@@ -303,7 +303,7 @@ _ol_format_GML3_.prototype.readEnvelope_ = function(node, objectStack) {
* @private
* @return {Array.|undefined} Flat coordinates.
*/
-_ol_format_GML3_.prototype.readFlatPos_ = function(node, objectStack) {
+GML3.prototype.readFlatPos_ = function(node, objectStack) {
var s = _ol_xml_.getAllTextContent(node, false);
var re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
/** @type {Array.} */
@@ -349,7 +349,7 @@ _ol_format_GML3_.prototype.readFlatPos_ = function(node, objectStack) {
* @private
* @return {Array.|undefined} Flat coordinates.
*/
-_ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
+GML3.prototype.readFlatPosList_ = function(node, objectStack) {
var s = _ol_xml_.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = objectStack[0];
var containerSrs = context['srsName'];
@@ -363,16 +363,16 @@ _ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
// The "dimension" attribute is from the GML 3.0.1 spec.
var dim = 2;
if (node.getAttribute('srsDimension')) {
- dim = _ol_format_XSD_.readNonNegativeIntegerString(
+ dim = XSD.readNonNegativeIntegerString(
node.getAttribute('srsDimension'));
} else if (node.getAttribute('dimension')) {
- dim = _ol_format_XSD_.readNonNegativeIntegerString(
+ dim = XSD.readNonNegativeIntegerString(
node.getAttribute('dimension'));
} else if (node.parentNode.getAttribute('srsDimension')) {
- dim = _ol_format_XSD_.readNonNegativeIntegerString(
+ dim = XSD.readNonNegativeIntegerString(
node.parentNode.getAttribute('srsDimension'));
} else if (contextDimension) {
- dim = _ol_format_XSD_.readNonNegativeIntegerString(contextDimension);
+ dim = XSD.readNonNegativeIntegerString(contextDimension);
}
var x, y, z;
var flatCoordinates = [];
@@ -395,10 +395,10 @@ _ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
+GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'pos': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readFlatPos_),
- 'posList': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readFlatPosList_)
+ 'pos': _ol_xml_.makeReplacer(GML3.prototype.readFlatPos_),
+ 'posList': _ol_xml_.makeReplacer(GML3.prototype.readFlatPosList_)
}
};
@@ -408,10 +408,10 @@ _ol_format_GML3_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
+GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'interior': _ol_format_GML3_.prototype.interiorParser_,
- 'exterior': _ol_format_GML3_.prototype.exteriorParser_
+ 'interior': GML3.prototype.interiorParser_,
+ 'exterior': GML3.prototype.exteriorParser_
}
};
@@ -421,27 +421,27 @@ _ol_format_GML3_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.GEOMETRY_PARSERS_ = {
+GML3.prototype.GEOMETRY_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'Point': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPoint),
+ 'Point': _ol_xml_.makeReplacer(GMLBase.prototype.readPoint),
'MultiPoint': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiPoint),
+ GMLBase.prototype.readMultiPoint),
'LineString': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readLineString),
+ GMLBase.prototype.readLineString),
'MultiLineString': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiLineString),
+ GMLBase.prototype.readMultiLineString),
'LinearRing': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readLinearRing),
- 'Polygon': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPolygon),
+ GMLBase.prototype.readLinearRing),
+ 'Polygon': _ol_xml_.makeReplacer(GMLBase.prototype.readPolygon),
'MultiPolygon': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readMultiPolygon),
- 'Surface': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readSurface_),
+ GMLBase.prototype.readMultiPolygon),
+ 'Surface': _ol_xml_.makeReplacer(GML3.prototype.readSurface_),
'MultiSurface': _ol_xml_.makeReplacer(
- _ol_format_GML3_.prototype.readMultiSurface_),
- 'Curve': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readCurve_),
+ GML3.prototype.readMultiSurface_),
+ 'Curve': _ol_xml_.makeReplacer(GML3.prototype.readCurve_),
'MultiCurve': _ol_xml_.makeReplacer(
- _ol_format_GML3_.prototype.readMultiCurve_),
- 'Envelope': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readEnvelope_)
+ GML3.prototype.readMultiCurve_),
+ 'Envelope': _ol_xml_.makeReplacer(GML3.prototype.readEnvelope_)
}
};
@@ -451,12 +451,12 @@ _ol_format_GML3_.prototype.GEOMETRY_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.MULTICURVE_PARSERS_ = {
+GML3.prototype.MULTICURVE_PARSERS_ = {
'http://www.opengis.net/gml': {
'curveMember': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.curveMemberParser_),
+ GML3.prototype.curveMemberParser_),
'curveMembers': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.curveMemberParser_)
+ GML3.prototype.curveMemberParser_)
}
};
@@ -466,12 +466,12 @@ _ol_format_GML3_.prototype.MULTICURVE_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.MULTISURFACE_PARSERS_ = {
+GML3.prototype.MULTISURFACE_PARSERS_ = {
'http://www.opengis.net/gml': {
'surfaceMember': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.surfaceMemberParser_),
+ GML3.prototype.surfaceMemberParser_),
'surfaceMembers': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.surfaceMemberParser_)
+ GML3.prototype.surfaceMemberParser_)
}
};
@@ -481,11 +481,11 @@ _ol_format_GML3_.prototype.MULTISURFACE_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.CURVEMEMBER_PARSERS_ = {
+GML3.prototype.CURVEMEMBER_PARSERS_ = {
'http://www.opengis.net/gml': {
'LineString': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.readLineString),
- 'Curve': _ol_xml_.makeArrayPusher(_ol_format_GML3_.prototype.readCurve_)
+ GMLBase.prototype.readLineString),
+ 'Curve': _ol_xml_.makeArrayPusher(GML3.prototype.readCurve_)
}
};
@@ -495,10 +495,10 @@ _ol_format_GML3_.prototype.CURVEMEMBER_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.SURFACEMEMBER_PARSERS_ = {
+GML3.prototype.SURFACEMEMBER_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'Polygon': _ol_xml_.makeArrayPusher(_ol_format_GMLBase_.prototype.readPolygon),
- 'Surface': _ol_xml_.makeArrayPusher(_ol_format_GML3_.prototype.readSurface_)
+ 'Polygon': _ol_xml_.makeArrayPusher(GMLBase.prototype.readPolygon),
+ 'Surface': _ol_xml_.makeArrayPusher(GML3.prototype.readSurface_)
}
};
@@ -508,9 +508,9 @@ _ol_format_GML3_.prototype.SURFACEMEMBER_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.SURFACE_PARSERS_ = {
+GML3.prototype.SURFACE_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'patches': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readPatch_)
+ 'patches': _ol_xml_.makeReplacer(GML3.prototype.readPatch_)
}
};
@@ -520,9 +520,9 @@ _ol_format_GML3_.prototype.SURFACE_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.CURVE_PARSERS_ = {
+GML3.prototype.CURVE_PARSERS_ = {
'http://www.opengis.net/gml': {
- 'segments': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readSegment_)
+ 'segments': _ol_xml_.makeReplacer(GML3.prototype.readSegment_)
}
};
@@ -532,12 +532,12 @@ _ol_format_GML3_.prototype.CURVE_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.ENVELOPE_PARSERS_ = {
+GML3.prototype.ENVELOPE_PARSERS_ = {
'http://www.opengis.net/gml': {
'lowerCorner': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.readFlatPosList_),
+ GML3.prototype.readFlatPosList_),
'upperCorner': _ol_xml_.makeArrayPusher(
- _ol_format_GML3_.prototype.readFlatPosList_)
+ GML3.prototype.readFlatPosList_)
}
};
@@ -547,10 +547,10 @@ _ol_format_GML3_.prototype.ENVELOPE_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.PATCHES_PARSERS_ = {
+GML3.prototype.PATCHES_PARSERS_ = {
'http://www.opengis.net/gml': {
'PolygonPatch': _ol_xml_.makeReplacer(
- _ol_format_GML3_.prototype.readPolygonPatch_)
+ GML3.prototype.readPolygonPatch_)
}
};
@@ -560,10 +560,10 @@ _ol_format_GML3_.prototype.PATCHES_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.prototype.SEGMENTS_PARSERS_ = {
+GML3.prototype.SEGMENTS_PARSERS_ = {
'http://www.opengis.net/gml': {
'LineStringSegment': _ol_xml_.makeReplacer(
- _ol_format_GML3_.prototype.readLineStringSegment_)
+ GML3.prototype.readLineStringSegment_)
}
};
@@ -574,7 +574,7 @@ _ol_format_GML3_.prototype.SEGMENTS_PARSERS_ = {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
+GML3.prototype.writePos_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsDimension = hasZ ? 3 : 2;
@@ -597,7 +597,7 @@ _ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
var z = point[2] || 0;
coords += ' ' + z;
}
- _ol_format_XSD_.writeStringTextNode(node, coords);
+ XSD.writeStringTextNode(node, coords);
};
@@ -608,7 +608,7 @@ _ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
* @return {string} The coords string.
* @private
*/
-_ol_format_GML3_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
+GML3.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
var axisOrientation = 'enu';
if (opt_srsName) {
axisOrientation = getProjection(opt_srsName).getAxisOrientation();
@@ -632,7 +632,7 @@ _ol_format_GML3_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
+GML3.prototype.writePosList_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsDimension = hasZ ? 3 : 2;
@@ -647,7 +647,7 @@ _ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
point = points[i];
parts[i] = this.getCoords_(point, srsName, hasZ);
}
- _ol_format_XSD_.writeStringTextNode(node, parts.join(' '));
+ XSD.writeStringTextNode(node, parts.join(' '));
};
@@ -657,7 +657,7 @@ _ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writePoint_ = function(node, geometry, objectStack) {
+GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -673,10 +673,10 @@ _ol_format_GML3_.prototype.writePoint_ = function(node, geometry, objectStack) {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.ENVELOPE_SERIALIZERS_ = {
+GML3.ENVELOPE_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
- 'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
+ 'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
}
};
@@ -686,7 +686,7 @@ _ol_format_GML3_.ENVELOPE_SERIALIZERS_ = {
* @param {ol.Extent} extent Extent.
* @param {Array.<*>} objectStack Node stack.
*/
-_ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
+GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -695,7 +695,7 @@ _ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
var keys = ['lowerCorner', 'upperCorner'];
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
- ({node: node}), _ol_format_GML3_.ENVELOPE_SERIALIZERS_,
+ ({node: node}), GML3.ENVELOPE_SERIALIZERS_,
_ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
values,
objectStack, keys, this);
@@ -708,7 +708,7 @@ _ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
+GML3.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -727,7 +727,7 @@ _ol_format_GML3_.prototype.writeLinearRing_ = function(node, geometry, objectSta
* @return {Node} Node.
* @private
*/
-_ol_format_GML3_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML3.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var context = objectStack[objectStack.length - 1];
var parentNode = context.node;
var exteriorWritten = context['exteriorWritten'];
@@ -745,7 +745,7 @@ _ol_format_GML3_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
+GML3.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -756,7 +756,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
var rings = geometry.getLinearRings();
_ol_xml_.pushSerializeAndPop(
{node: node, hasZ: hasZ, srsName: srsName},
- _ol_format_GML3_.RING_SERIALIZERS_,
+ GML3.RING_SERIALIZERS_,
this.RING_NODE_FACTORY_,
rings, objectStack, undefined, this);
} else if (node.nodeName === 'Surface') {
@@ -774,7 +774,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
+GML3.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (node.nodeName !== 'LineStringSegment' && srsName) {
@@ -800,7 +800,7 @@ _ol_format_GML3_.prototype.writeCurveOrLineString_ = function(node, geometry, ob
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
+GML3.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -810,7 +810,7 @@ _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
}
var polygons = geometry.getPolygons();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, surface: surface},
- _ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
+ GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons,
objectStack, undefined, this);
};
@@ -822,7 +822,7 @@ _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
+GML3.prototype.writeMultiPoint_ = function(node, geometry,
objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
@@ -832,7 +832,7 @@ _ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
}
var points = geometry.getPoints();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName},
- _ol_format_GML3_.POINTMEMBER_SERIALIZERS_,
+ GML3.POINTMEMBER_SERIALIZERS_,
_ol_xml_.makeSimpleNodeFactory('pointMember'), points,
objectStack, undefined, this);
};
@@ -844,7 +844,7 @@ _ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
+GML3.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var hasZ = context['hasZ'];
var srsName = context['srsName'];
@@ -854,7 +854,7 @@ _ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
}
var lines = geometry.getLineStrings();
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, curve: curve},
- _ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
+ GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines,
objectStack, undefined, this);
};
@@ -866,7 +866,7 @@ _ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeRing_ = function(node, ring, objectStack) {
+GML3.prototype.writeRing_ = function(node, ring, objectStack) {
var linearRing = _ol_xml_.createElementNS(node.namespaceURI, 'LinearRing');
node.appendChild(linearRing);
this.writeLinearRing_(linearRing, ring, objectStack);
@@ -879,7 +879,7 @@ _ol_format_GML3_.prototype.writeRing_ = function(node, ring, objectStack) {
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
+GML3.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
var child = this.GEOMETRY_NODE_FACTORY_(
polygon, objectStack);
if (child) {
@@ -895,7 +895,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writePointMember_ = function(node, point, objectStack) {
+GML3.prototype.writePointMember_ = function(node, point, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI, 'Point');
node.appendChild(child);
this.writePoint_(child, point, objectStack);
@@ -908,7 +908,7 @@ _ol_format_GML3_.prototype.writePointMember_ = function(node, point, objectStack
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
+GML3.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
if (child) {
node.appendChild(child);
@@ -923,7 +923,7 @@ _ol_format_GML3_.prototype.writeLineStringOrCurveMember_ = function(node, line,
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
+GML3.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI, 'PolygonPatch');
node.appendChild(child);
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
@@ -936,7 +936,7 @@ _ol_format_GML3_.prototype.writeSurfacePatches_ = function(node, polygon, object
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeCurveSegments_ = function(node, line, objectStack) {
+GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) {
var child = _ol_xml_.createElementNS(node.namespaceURI,
'LineStringSegment');
node.appendChild(child);
@@ -949,7 +949,7 @@ _ol_format_GML3_.prototype.writeCurveSegments_ = function(node, line, objectStac
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
* @param {Array.<*>} objectStack Node stack.
*/
-_ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objectStack) {
+GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
var context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
var item = _ol_obj_.assign({}, context);
item.node = node;
@@ -963,10 +963,10 @@ _ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objec
}
} else {
value =
- _ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
+ FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
}
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
- (item), _ol_format_GML3_.GEOMETRY_SERIALIZERS_,
+ (item), GML3.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
};
@@ -977,7 +977,7 @@ _ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objec
* @param {ol.Feature} feature Feature.
* @param {Array.<*>} objectStack Node stack.
*/
-_ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectStack) {
+GML3.prototype.writeFeatureElement = function(node, feature, objectStack) {
var fid = feature.getId();
if (fid) {
node.setAttribute('fid', fid);
@@ -1004,7 +1004,7 @@ _ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectS
} else {
if (!(key in context.serializers[featureNS])) {
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeStringTextNode);
+ XSD.writeStringTextNode);
}
}
}
@@ -1025,7 +1025,7 @@ _ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectS
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GML3_.prototype.writeFeatureMembers_ = function(node, features, objectStack) {
+GML3.prototype.writeFeatureMembers_ = function(node, features, objectStack) {
var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var featureType = context['featureType'];
var featureNS = context['featureNS'];
@@ -1047,12 +1047,12 @@ _ol_format_GML3_.prototype.writeFeatureMembers_ = function(node, features, objec
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
+GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'surfaceMember': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_),
+ GML3.prototype.writeSurfaceOrPolygonMember_),
'polygonMember': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_)
+ GML3.prototype.writeSurfaceOrPolygonMember_)
}
};
@@ -1061,10 +1061,10 @@ _ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.POINTMEMBER_SERIALIZERS_ = {
+GML3.POINTMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'pointMember': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writePointMember_)
+ GML3.prototype.writePointMember_)
}
};
@@ -1073,12 +1073,12 @@ _ol_format_GML3_.POINTMEMBER_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
+GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'lineStringMember': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeLineStringOrCurveMember_),
+ GML3.prototype.writeLineStringOrCurveMember_),
'curveMember': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeLineStringOrCurveMember_)
+ GML3.prototype.writeLineStringOrCurveMember_)
}
};
@@ -1087,10 +1087,10 @@ _ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.RING_SERIALIZERS_ = {
+GML3.RING_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
- 'exterior': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writeRing_),
- 'interior': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writeRing_)
+ 'exterior': _ol_xml_.makeChildAppender(GML3.prototype.writeRing_),
+ 'interior': _ol_xml_.makeChildAppender(GML3.prototype.writeRing_)
}
};
@@ -1099,31 +1099,31 @@ _ol_format_GML3_.RING_SERIALIZERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GML3_.GEOMETRY_SERIALIZERS_ = {
+GML3.GEOMETRY_SERIALIZERS_ = {
'http://www.opengis.net/gml': {
'Curve': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeCurveOrLineString_),
+ GML3.prototype.writeCurveOrLineString_),
'MultiCurve': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeMultiCurveOrLineString_),
- 'Point': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writePoint_),
+ GML3.prototype.writeMultiCurveOrLineString_),
+ 'Point': _ol_xml_.makeChildAppender(GML3.prototype.writePoint_),
'MultiPoint': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeMultiPoint_),
+ GML3.prototype.writeMultiPoint_),
'LineString': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeCurveOrLineString_),
+ GML3.prototype.writeCurveOrLineString_),
'MultiLineString': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeMultiCurveOrLineString_),
+ GML3.prototype.writeMultiCurveOrLineString_),
'LinearRing': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeLinearRing_),
+ GML3.prototype.writeLinearRing_),
'Polygon': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeSurfaceOrPolygon_),
+ GML3.prototype.writeSurfaceOrPolygon_),
'MultiPolygon': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_),
+ GML3.prototype.writeMultiSurfaceOrPolygon_),
'Surface': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeSurfaceOrPolygon_),
+ GML3.prototype.writeSurfaceOrPolygon_),
'MultiSurface': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_),
+ GML3.prototype.writeMultiSurfaceOrPolygon_),
'Envelope': _ol_xml_.makeChildAppender(
- _ol_format_GML3_.prototype.writeEnvelope)
+ GML3.prototype.writeEnvelope)
}
};
@@ -1133,7 +1133,7 @@ _ol_format_GML3_.GEOMETRY_SERIALIZERS_ = {
* @type {Object.}
* @private
*/
-_ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
+GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
'MultiLineString': 'lineStringMember',
'MultiCurve': 'curveMember',
'MultiPolygon': 'polygonMember',
@@ -1149,10 +1149,10 @@ _ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
* @return {Node|undefined} Node.
* @private
*/
-_ol_format_GML3_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
return _ol_xml_.createElementNS('http://www.opengis.net/gml',
- _ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
+ GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
};
@@ -1164,7 +1164,7 @@ _ol_format_GML3_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value,
* @return {Node|undefined} Node.
* @private
*/
-_ol_format_GML3_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var context = objectStack[objectStack.length - 1];
var multiSurface = context['multiSurface'];
var surface = context['surface'];
@@ -1199,7 +1199,7 @@ _ol_format_GML3_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
* @override
* @api
*/
-_ol_format_GML3_.prototype.writeGeometryNode = function(geometry, opt_options) {
+GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
opt_options = this.adaptOptions(opt_options);
var geom = _ol_xml_.createElementNS('http://www.opengis.net/gml', 'geom');
var context = {node: geom, hasZ: this.hasZ, srsName: this.srsName,
@@ -1222,7 +1222,7 @@ _ol_format_GML3_.prototype.writeGeometryNode = function(geometry, opt_options) {
* @return {string} Result.
* @api
*/
-_ol_format_GML3_.prototype.writeFeatures;
+GML3.prototype.writeFeatures;
/**
@@ -1234,7 +1234,7 @@ _ol_format_GML3_.prototype.writeFeatures;
* @override
* @api
*/
-_ol_format_GML3_.prototype.writeFeaturesNode = function(features, opt_options) {
+GML3.prototype.writeFeaturesNode = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
var node = _ol_xml_.createElementNS('http://www.opengis.net/gml',
'featureMembers');
@@ -1256,4 +1256,4 @@ _ol_format_GML3_.prototype.writeFeaturesNode = function(features, opt_options) {
this.writeFeatureMembers_(node, features, [context]);
return node;
};
-export default _ol_format_GML3_;
+export default GML3;
diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js
index e54cb88a86..8afecd8f19 100644
--- a/src/ol/format/GMLBase.js
+++ b/src/ol/format/GMLBase.js
@@ -7,8 +7,8 @@
import {inherits} from '../index.js';
import _ol_array_ from '../array.js';
import _ol_Feature_ from '../Feature.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
+import FeatureFormat from '../format/Feature.js';
+import XMLFeature from '../format/XMLFeature.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js';
import LinearRing from '../geom/LinearRing.js';
@@ -36,7 +36,7 @@ import _ol_xml_ from '../xml.js';
* Optional configuration object.
* @extends {ol.format.XMLFeature}
*/
-var _ol_format_GMLBase_ = function(opt_options) {
+var GMLBase = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
@@ -68,24 +68,24 @@ var _ol_format_GMLBase_ = function(opt_options) {
* @type {Object.>}
*/
this.FEATURE_COLLECTION_PARSERS = {};
- this.FEATURE_COLLECTION_PARSERS[_ol_format_GMLBase_.GMLNS] = {
+ this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS] = {
'featureMember': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readFeaturesInternal),
+ GMLBase.prototype.readFeaturesInternal),
'featureMembers': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readFeaturesInternal)
+ GMLBase.prototype.readFeaturesInternal)
};
- _ol_format_XMLFeature_.call(this);
+ XMLFeature.call(this);
};
-inherits(_ol_format_GMLBase_, _ol_format_XMLFeature_);
+inherits(GMLBase, XMLFeature);
/**
* @const
* @type {string}
*/
-_ol_format_GMLBase_.GMLNS = 'http://www.opengis.net/gml';
+GMLBase.GMLNS = 'http://www.opengis.net/gml';
/**
@@ -100,7 +100,7 @@ _ol_format_GMLBase_.GMLNS = 'http://www.opengis.net/gml';
* @type {RegExp}
* @private
*/
-_ol_format_GMLBase_.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
+GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
/**
@@ -108,7 +108,7 @@ _ol_format_GMLBase_.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
* @param {Array.<*>} objectStack Object stack.
* @return {Array. | undefined} Features.
*/
-_ol_format_GMLBase_.prototype.readFeaturesInternal = function(node, objectStack) {
+GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
var localName = node.localName;
var features = null;
if (localName == 'FeatureCollection') {
@@ -196,7 +196,7 @@ _ol_format_GMLBase_.prototype.readFeaturesInternal = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.Geometry|undefined} Geometry.
*/
-_ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack) {
+GMLBase.prototype.readGeometryElement = function(node, objectStack) {
var context = /** @type {Object} */ (objectStack[0]);
context['srsName'] = node.firstElementChild.getAttribute('srsName');
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
@@ -205,7 +205,7 @@ _ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack)
this.GEOMETRY_PARSERS_, node, objectStack, this);
if (geometry) {
return (
- /** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(geometry, false, context)
+ /** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(geometry, false, context)
);
} else {
return undefined;
@@ -218,10 +218,10 @@ _ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @return {ol.Feature} Feature.
*/
-_ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
+GMLBase.prototype.readFeatureElement = function(node, objectStack) {
var n;
var fid = node.getAttribute('fid') ||
- _ol_xml_.getAttributeNS(node, _ol_format_GMLBase_.GMLNS, 'id');
+ _ol_xml_.getAttributeNS(node, GMLBase.GMLNS, 'id');
var values = {}, geometryName;
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
var localName = n.localName;
@@ -232,7 +232,7 @@ _ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
(n.childNodes.length === 1 &&
(n.firstChild.nodeType === 3 || n.firstChild.nodeType === 4))) {
var value = _ol_xml_.getAllTextContent(n, false);
- if (_ol_format_GMLBase_.ONLY_WHITESPACE_RE_.test(value)) {
+ if (GMLBase.ONLY_WHITESPACE_RE_.test(value)) {
value = undefined;
}
values[localName] = value;
@@ -260,7 +260,7 @@ _ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.Point|undefined} Point.
*/
-_ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
+GMLBase.prototype.readPoint = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
@@ -276,7 +276,7 @@ _ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
*/
-_ol_format_GMLBase_.prototype.readMultiPoint = function(node, objectStack) {
+GMLBase.prototype.readMultiPoint = function(node, objectStack) {
/** @type {Array.>} */
var coordinates = _ol_xml_.pushParseAndPop([],
this.MULTIPOINT_PARSERS_, node, objectStack, this);
@@ -293,7 +293,7 @@ _ol_format_GMLBase_.prototype.readMultiPoint = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
-_ol_format_GMLBase_.prototype.readMultiLineString = function(node, objectStack) {
+GMLBase.prototype.readMultiLineString = function(node, objectStack) {
/** @type {Array.} */
var lineStrings = _ol_xml_.pushParseAndPop([],
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
@@ -312,7 +312,7 @@ _ol_format_GMLBase_.prototype.readMultiLineString = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
-_ol_format_GMLBase_.prototype.readMultiPolygon = function(node, objectStack) {
+GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
/** @type {Array.} */
var polygons = _ol_xml_.pushParseAndPop([],
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
@@ -331,7 +331,7 @@ _ol_format_GMLBase_.prototype.readMultiPolygon = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GMLBase_.prototype.pointMemberParser_ = function(node, objectStack) {
+GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
_ol_xml_.parseNode(this.POINTMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -342,7 +342,7 @@ _ol_format_GMLBase_.prototype.pointMemberParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GMLBase_.prototype.lineStringMemberParser_ = function(node, objectStack) {
+GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
_ol_xml_.parseNode(this.LINESTRINGMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -353,7 +353,7 @@ _ol_format_GMLBase_.prototype.lineStringMemberParser_ = function(node, objectSta
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GMLBase_.prototype.polygonMemberParser_ = function(node, objectStack) {
+GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
_ol_xml_.parseNode(this.POLYGONMEMBER_PARSERS_, node,
objectStack, this);
};
@@ -364,7 +364,7 @@ _ol_format_GMLBase_.prototype.polygonMemberParser_ = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.LineString|undefined} LineString.
*/
-_ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
+GMLBase.prototype.readLineString = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
@@ -383,7 +383,7 @@ _ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
* @private
* @return {Array.|undefined} LinearRing flat coordinates.
*/
-_ol_format_GMLBase_.prototype.readFlatLinearRing_ = function(node, objectStack) {
+GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
var ring = _ol_xml_.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
objectStack, this);
@@ -400,7 +400,7 @@ _ol_format_GMLBase_.prototype.readFlatLinearRing_ = function(node, objectStack)
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.LinearRing|undefined} LinearRing.
*/
-_ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
+GMLBase.prototype.readLinearRing = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
@@ -418,7 +418,7 @@ _ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @return {ol.geom.Polygon|undefined} Polygon.
*/
-_ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) {
+GMLBase.prototype.readPolygon = function(node, objectStack) {
/** @type {Array.>} */
var flatLinearRings = _ol_xml_.pushParseAndPop([null],
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
@@ -446,7 +446,7 @@ _ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) {
* @private
* @return {Array.} Flat coordinates.
*/
-_ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
+GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
objectStack, this);
@@ -458,12 +458,12 @@ _ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_ = function(node, obje
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.MULTIPOINT_PARSERS_ = {
+GMLBase.prototype.MULTIPOINT_PARSERS_ = {
'http://www.opengis.net/gml': {
'pointMember': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.pointMemberParser_),
+ GMLBase.prototype.pointMemberParser_),
'pointMembers': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.pointMemberParser_)
+ GMLBase.prototype.pointMemberParser_)
}
};
@@ -473,12 +473,12 @@ _ol_format_GMLBase_.prototype.MULTIPOINT_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.MULTILINESTRING_PARSERS_ = {
+GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
'http://www.opengis.net/gml': {
'lineStringMember': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.lineStringMemberParser_),
+ GMLBase.prototype.lineStringMemberParser_),
'lineStringMembers': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.lineStringMemberParser_)
+ GMLBase.prototype.lineStringMemberParser_)
}
};
@@ -488,12 +488,12 @@ _ol_format_GMLBase_.prototype.MULTILINESTRING_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.MULTIPOLYGON_PARSERS_ = {
+GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
'http://www.opengis.net/gml': {
'polygonMember': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.polygonMemberParser_),
+ GMLBase.prototype.polygonMemberParser_),
'polygonMembers': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.polygonMemberParser_)
+ GMLBase.prototype.polygonMemberParser_)
}
};
@@ -503,10 +503,10 @@ _ol_format_GMLBase_.prototype.MULTIPOLYGON_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.POINTMEMBER_PARSERS_ = {
+GMLBase.prototype.POINTMEMBER_PARSERS_ = {
'http://www.opengis.net/gml': {
'Point': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_)
+ GMLBase.prototype.readFlatCoordinatesFromNode_)
}
};
@@ -516,10 +516,10 @@ _ol_format_GMLBase_.prototype.POINTMEMBER_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.LINESTRINGMEMBER_PARSERS_ = {
+GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
'http://www.opengis.net/gml': {
'LineString': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.readLineString)
+ GMLBase.prototype.readLineString)
}
};
@@ -529,10 +529,10 @@ _ol_format_GMLBase_.prototype.LINESTRINGMEMBER_PARSERS_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GMLBase_.prototype.POLYGONMEMBER_PARSERS_ = {
+GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
'http://www.opengis.net/gml': {
'Polygon': _ol_xml_.makeArrayPusher(
- _ol_format_GMLBase_.prototype.readPolygon)
+ GMLBase.prototype.readPolygon)
}
};
@@ -542,10 +542,10 @@ _ol_format_GMLBase_.prototype.POLYGONMEMBER_PARSERS_ = {
* @type {Object.>}
* @protected
*/
-_ol_format_GMLBase_.prototype.RING_PARSERS = {
+GMLBase.prototype.RING_PARSERS = {
'http://www.opengis.net/gml': {
'LinearRing': _ol_xml_.makeReplacer(
- _ol_format_GMLBase_.prototype.readFlatLinearRing_)
+ GMLBase.prototype.readFlatLinearRing_)
}
};
@@ -553,7 +553,7 @@ _ol_format_GMLBase_.prototype.RING_PARSERS = {
/**
* @inheritDoc
*/
-_ol_format_GMLBase_.prototype.readGeometryFromNode = function(node, opt_options) {
+GMLBase.prototype.readGeometryFromNode = function(node, opt_options) {
var geometry = this.readGeometryElement(node,
[this.getReadOptions(node, opt_options ? opt_options : {})]);
return geometry ? geometry : null;
@@ -569,13 +569,13 @@ _ol_format_GMLBase_.prototype.readGeometryFromNode = function(node, opt_options)
* @return {Array.} Features.
* @api
*/
-_ol_format_GMLBase_.prototype.readFeatures;
+GMLBase.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_GMLBase_.prototype.readFeaturesFromNode = function(node, opt_options) {
+GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
var options = {
featureType: this.featureType,
featureNS: this.featureNS
@@ -591,8 +591,8 @@ _ol_format_GMLBase_.prototype.readFeaturesFromNode = function(node, opt_options)
/**
* @inheritDoc
*/
-_ol_format_GMLBase_.prototype.readProjectionFromNode = function(node) {
+GMLBase.prototype.readProjectionFromNode = function(node) {
return getProjection(this.srsName ? this.srsName :
node.firstElementChild.getAttribute('srsName'));
};
-export default _ol_format_GMLBase_;
+export default GMLBase;
diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js
index 0f97695965..6fccfe8460 100644
--- a/src/ol/format/GPX.js
+++ b/src/ol/format/GPX.js
@@ -4,9 +4,9 @@
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_array_ from '../array.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
-import _ol_format_XSD_ from '../format/XSD.js';
+import FeatureFormat from '../format/Feature.js';
+import XMLFeature from '../format/XMLFeature.js';
+import XSD from '../format/XSD.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js';
import MultiLineString from '../geom/MultiLineString.js';
@@ -23,11 +23,11 @@ import _ol_xml_ from '../xml.js';
* @param {olx.format.GPXOptions=} opt_options Options.
* @api
*/
-var _ol_format_GPX_ = function(opt_options) {
+var GPX = function(opt_options) {
var options = opt_options ? opt_options : {};
- _ol_format_XMLFeature_.call(this);
+ XMLFeature.call(this);
/**
* @inheritDoc
@@ -41,7 +41,7 @@ var _ol_format_GPX_ = function(opt_options) {
this.readExtensions_ = options.readExtensions;
};
-inherits(_ol_format_GPX_, _ol_format_XMLFeature_);
+inherits(GPX, XMLFeature);
/**
@@ -49,7 +49,7 @@ inherits(_ol_format_GPX_, _ol_format_XMLFeature_);
* @private
* @type {Array.}
*/
-_ol_format_GPX_.NAMESPACE_URIS_ = [
+GPX.NAMESPACE_URIS_ = [
null,
'http://www.topografix.com/GPX/1/0',
'http://www.topografix.com/GPX/1/1'
@@ -61,7 +61,7 @@ _ol_format_GPX_.NAMESPACE_URIS_ = [
* @type {string}
* @private
*/
-_ol_format_GPX_.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
+GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
'http://www.topografix.com/GPX/1/1/gpx.xsd';
@@ -73,7 +73,7 @@ _ol_format_GPX_.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
* @private
* @return {Array.} Flat coordinates.
*/
-_ol_format_GPX_.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
+GPX.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
flatCoordinates.push(
parseFloat(node.getAttribute('lon')),
parseFloat(node.getAttribute('lat')));
@@ -104,7 +104,7 @@ _ol_format_GPX_.appendCoordinate_ = function(flatCoordinates, layoutOptions, nod
* @param {Array.=} ends Ends.
* @return {ol.geom.GeometryLayout} Layout.
*/
-_ol_format_GPX_.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, ends) {
+GPX.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, ends) {
var layout = GeometryLayout.XY;
var stride = 2;
if (layoutOptions.hasZ && layoutOptions.hasM) {
@@ -145,13 +145,13 @@ _ol_format_GPX_.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, e
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.parseLink_ = function(node, objectStack) {
+GPX.parseLink_ = function(node, objectStack) {
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var href = node.getAttribute('href');
if (href !== null) {
values['link'] = href;
}
- _ol_xml_.parseNode(_ol_format_GPX_.LINK_PARSERS_, node, objectStack);
+ _ol_xml_.parseNode(GPX.LINK_PARSERS_, node, objectStack);
};
@@ -160,7 +160,7 @@ _ol_format_GPX_.parseLink_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.parseExtensions_ = function(node, objectStack) {
+GPX.parseExtensions_ = function(node, objectStack) {
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values['extensionsNode_'] = node;
};
@@ -171,16 +171,16 @@ _ol_format_GPX_.parseExtensions_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.parseRtePt_ = function(node, objectStack) {
+GPX.parseRtePt_ = function(node, objectStack) {
var values = _ol_xml_.pushParseAndPop(
- {}, _ol_format_GPX_.RTEPT_PARSERS_, node, objectStack);
+ {}, GPX.RTEPT_PARSERS_, node, objectStack);
if (values) {
var rteValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var flatCoordinates = /** @type {Array.} */
(rteValues['flatCoordinates']);
var layoutOptions = /** @type {ol.LayoutOptions} */
(rteValues['layoutOptions']);
- _ol_format_GPX_.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
+ GPX.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
}
};
@@ -190,16 +190,16 @@ _ol_format_GPX_.parseRtePt_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.parseTrkPt_ = function(node, objectStack) {
+GPX.parseTrkPt_ = function(node, objectStack) {
var values = _ol_xml_.pushParseAndPop(
- {}, _ol_format_GPX_.TRKPT_PARSERS_, node, objectStack);
+ {}, GPX.TRKPT_PARSERS_, node, objectStack);
if (values) {
var trkValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var flatCoordinates = /** @type {Array.} */
(trkValues['flatCoordinates']);
var layoutOptions = /** @type {ol.LayoutOptions} */
(trkValues['layoutOptions']);
- _ol_format_GPX_.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
+ GPX.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
}
};
@@ -209,9 +209,9 @@ _ol_format_GPX_.parseTrkPt_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.parseTrkSeg_ = function(node, objectStack) {
+GPX.parseTrkSeg_ = function(node, objectStack) {
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
- _ol_xml_.parseNode(_ol_format_GPX_.TRKSEG_PARSERS_, node, objectStack);
+ _ol_xml_.parseNode(GPX.TRKSEG_PARSERS_, node, objectStack);
var flatCoordinates = /** @type {Array.} */
(values['flatCoordinates']);
var ends = /** @type {Array.} */ (values['ends']);
@@ -225,12 +225,12 @@ _ol_format_GPX_.parseTrkSeg_ = function(node, objectStack) {
* @private
* @return {ol.Feature|undefined} Track.
*/
-_ol_format_GPX_.readRte_ = function(node, objectStack) {
+GPX.readRte_ = function(node, objectStack) {
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = _ol_xml_.pushParseAndPop({
'flatCoordinates': [],
'layoutOptions': {}
- }, _ol_format_GPX_.RTE_PARSERS_, node, objectStack);
+ }, GPX.RTE_PARSERS_, node, objectStack);
if (!values) {
return undefined;
}
@@ -239,10 +239,10 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
delete values['flatCoordinates'];
var layoutOptions = /** @type {ol.LayoutOptions} */ (values['layoutOptions']);
delete values['layoutOptions'];
- var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates);
+ var layout = GPX.applyLayoutOptions_(layoutOptions, flatCoordinates);
var geometry = new LineString(null);
geometry.setFlatCoordinates(layout, flatCoordinates);
- _ol_format_Feature_.transformWithOptions(geometry, false, options);
+ FeatureFormat.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);
feature.setProperties(values);
return feature;
@@ -255,13 +255,13 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
* @private
* @return {ol.Feature|undefined} Track.
*/
-_ol_format_GPX_.readTrk_ = function(node, objectStack) {
+GPX.readTrk_ = function(node, objectStack) {
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = _ol_xml_.pushParseAndPop({
'flatCoordinates': [],
'ends': [],
'layoutOptions': {}
- }, _ol_format_GPX_.TRK_PARSERS_, node, objectStack);
+ }, GPX.TRK_PARSERS_, node, objectStack);
if (!values) {
return undefined;
}
@@ -272,10 +272,10 @@ _ol_format_GPX_.readTrk_ = function(node, objectStack) {
delete values['ends'];
var layoutOptions = /** @type {ol.LayoutOptions} */ (values['layoutOptions']);
delete values['layoutOptions'];
- var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
+ var layout = GPX.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
var geometry = new MultiLineString(null);
geometry.setFlatCoordinates(layout, flatCoordinates, ends);
- _ol_format_Feature_.transformWithOptions(geometry, false, options);
+ FeatureFormat.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);
feature.setProperties(values);
return feature;
@@ -288,18 +288,18 @@ _ol_format_GPX_.readTrk_ = function(node, objectStack) {
* @private
* @return {ol.Feature|undefined} Waypoint.
*/
-_ol_format_GPX_.readWpt_ = function(node, objectStack) {
+GPX.readWpt_ = function(node, objectStack) {
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = _ol_xml_.pushParseAndPop(
- {}, _ol_format_GPX_.WPT_PARSERS_, node, objectStack);
+ {}, GPX.WPT_PARSERS_, node, objectStack);
if (!values) {
return undefined;
}
var layoutOptions = /** @type {ol.LayoutOptions} */ ({});
- var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
- var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
+ var coordinates = GPX.appendCoordinate_([], layoutOptions, node, values);
+ var layout = GPX.applyLayoutOptions_(layoutOptions, coordinates);
var geometry = new Point(coordinates, layout);
- _ol_format_Feature_.transformWithOptions(geometry, false, options);
+ FeatureFormat.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);
feature.setProperties(values);
return feature;
@@ -311,10 +311,10 @@ _ol_format_GPX_.readWpt_ = function(node, objectStack) {
* @type {Object.): (ol.Feature|undefined)>}
* @private
*/
-_ol_format_GPX_.FEATURE_READER_ = {
- 'rte': _ol_format_GPX_.readRte_,
- 'trk': _ol_format_GPX_.readTrk_,
- 'wpt': _ol_format_GPX_.readWpt_
+GPX.FEATURE_READER_ = {
+ 'rte': GPX.readRte_,
+ 'trk': GPX.readTrk_,
+ 'wpt': GPX.readWpt_
};
@@ -323,11 +323,11 @@ _ol_format_GPX_.FEATURE_READER_ = {
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'rte': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readRte_),
- 'trk': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readTrk_),
- 'wpt': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readWpt_)
+GPX.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'rte': _ol_xml_.makeArrayPusher(GPX.readRte_),
+ 'trk': _ol_xml_.makeArrayPusher(GPX.readTrk_),
+ 'wpt': _ol_xml_.makeArrayPusher(GPX.readWpt_)
});
@@ -336,12 +336,12 @@ _ol_format_GPX_.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
+GPX.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
'text':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkText'),
+ _ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkText'),
'type':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkType')
+ _ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkType')
});
@@ -350,18 +350,18 @@ _ol_format_GPX_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'link': _ol_format_GPX_.parseLink_,
+GPX.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'link': GPX.parseLink_,
'number':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
- 'extensions': _ol_format_GPX_.parseExtensions_,
- 'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'rtept': _ol_format_GPX_.parseRtePt_
+ _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
+ 'extensions': GPX.parseExtensions_,
+ 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'rtept': GPX.parseRtePt_
});
@@ -370,10 +370,10 @@ _ol_format_GPX_.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime)
+GPX.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
});
@@ -382,18 +382,18 @@ _ol_format_GPX_.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'link': _ol_format_GPX_.parseLink_,
+GPX.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'link': GPX.parseLink_,
'number':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
- 'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'extensions': _ol_format_GPX_.parseExtensions_,
- 'trkseg': _ol_format_GPX_.parseTrkSeg_
+ _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
+ 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'extensions': GPX.parseExtensions_,
+ 'trkseg': GPX.parseTrkSeg_
});
@@ -402,9 +402,9 @@ _ol_format_GPX_.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'trkpt': _ol_format_GPX_.parseTrkPt_
+GPX.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'trkpt': GPX.parseTrkPt_
});
@@ -413,10 +413,10 @@ _ol_format_GPX_.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime)
+GPX.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
});
@@ -425,30 +425,30 @@ _ol_format_GPX_.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime),
- 'magvar': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'geoidheight': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'link': _ol_format_GPX_.parseLink_,
- 'sym': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'fix': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
+GPX.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime),
+ 'magvar': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'geoidheight': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'link': GPX.parseLink_,
+ 'sym': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'fix': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'sat': _ol_xml_.makeObjectPropertySetter(
- _ol_format_XSD_.readNonNegativeInteger),
- 'hdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'vdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'pdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
+ XSD.readNonNegativeInteger),
+ 'hdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'vdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'pdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'ageofdgpsdata':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
+ _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'dgpsid':
- _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
- 'extensions': _ol_format_GPX_.parseExtensions_
+ _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
+ 'extensions': GPX.parseExtensions_
});
@@ -456,7 +456,7 @@ _ol_format_GPX_.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
* @param {Array.} features List of features.
* @private
*/
-_ol_format_GPX_.prototype.handleReadExtensions_ = function(features) {
+GPX.prototype.handleReadExtensions_ = function(features) {
if (!features) {
features = [];
}
@@ -482,17 +482,17 @@ _ol_format_GPX_.prototype.handleReadExtensions_ = function(features) {
* @return {ol.Feature} Feature.
* @api
*/
-_ol_format_GPX_.prototype.readFeature;
+GPX.prototype.readFeature;
/**
* @inheritDoc
*/
-_ol_format_GPX_.prototype.readFeatureFromNode = function(node, opt_options) {
- if (!_ol_array_.includes(_ol_format_GPX_.NAMESPACE_URIS_, node.namespaceURI)) {
+GPX.prototype.readFeatureFromNode = function(node, opt_options) {
+ if (!_ol_array_.includes(GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
}
- var featureReader = _ol_format_GPX_.FEATURE_READER_[node.localName];
+ var featureReader = GPX.FEATURE_READER_[node.localName];
if (!featureReader) {
return null;
}
@@ -516,19 +516,19 @@ _ol_format_GPX_.prototype.readFeatureFromNode = function(node, opt_options) {
* @return {Array.} Features.
* @api
*/
-_ol_format_GPX_.prototype.readFeatures;
+GPX.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_GPX_.prototype.readFeaturesFromNode = function(node, opt_options) {
- if (!_ol_array_.includes(_ol_format_GPX_.NAMESPACE_URIS_, node.namespaceURI)) {
+GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
+ if (!_ol_array_.includes(GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
}
if (node.localName == 'gpx') {
/** @type {Array.} */
- var features = _ol_xml_.pushParseAndPop([], _ol_format_GPX_.GPX_PARSERS_,
+ var features = _ol_xml_.pushParseAndPop([], GPX.GPX_PARSERS_,
node, [this.getReadOptions(node, opt_options)]);
if (features) {
this.handleReadExtensions_(features);
@@ -549,7 +549,7 @@ _ol_format_GPX_.prototype.readFeaturesFromNode = function(node, opt_options) {
* @return {ol.proj.Projection} Projection.
* @api
*/
-_ol_format_GPX_.prototype.readProjection;
+GPX.prototype.readProjection;
/**
@@ -558,7 +558,7 @@ _ol_format_GPX_.prototype.readProjection;
* @param {Array.<*>} objectStack Node stack.
* @private
*/
-_ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
+GPX.writeLink_ = function(node, value, objectStack) {
node.setAttribute('href', value);
var context = objectStack[objectStack.length - 1];
var properties = context['properties'];
@@ -567,8 +567,8 @@ _ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
properties['linkType']
];
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node}),
- _ol_format_GPX_.LINK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
- link, objectStack, _ol_format_GPX_.LINK_SEQUENCE_);
+ GPX.LINK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
+ link, objectStack, GPX.LINK_SEQUENCE_);
};
@@ -578,7 +578,7 @@ _ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
+GPX.writeWptType_ = function(node, coordinate, objectStack) {
var context = objectStack[objectStack.length - 1];
var parentNode = context.node;
var namespaceURI = parentNode.namespaceURI;
@@ -607,12 +607,12 @@ _ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
// pass
}
var orderedKeys = (node.nodeName == 'rtept') ?
- _ol_format_GPX_.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
- _ol_format_GPX_.WPT_TYPE_SEQUENCE_[namespaceURI];
+ GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
+ GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
var values = _ol_xml_.makeSequence(properties, orderedKeys);
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
({node: node, 'properties': properties}),
- _ol_format_GPX_.WPT_TYPE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
+ GPX.WPT_TYPE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
};
@@ -623,22 +623,22 @@ _ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.writeRte_ = function(node, feature, objectStack) {
+GPX.writeRte_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var properties = feature.getProperties();
var context = {node: node, 'properties': properties};
var geometry = feature.getGeometry();
if (geometry) {
geometry = /** @type {ol.geom.LineString} */
- (_ol_format_Feature_.transformWithOptions(geometry, true, options));
+ (FeatureFormat.transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout();
properties['rtept'] = geometry.getCoordinates();
}
var parentNode = objectStack[objectStack.length - 1].node;
- var orderedKeys = _ol_format_GPX_.RTE_SEQUENCE_[parentNode.namespaceURI];
+ var orderedKeys = GPX.RTE_SEQUENCE_[parentNode.namespaceURI];
var values = _ol_xml_.makeSequence(properties, orderedKeys);
_ol_xml_.pushSerializeAndPop(context,
- _ol_format_GPX_.RTE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
+ GPX.RTE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
};
@@ -649,7 +649,7 @@ _ol_format_GPX_.writeRte_ = function(node, feature, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
+GPX.writeTrk_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var properties = feature.getProperties();
/** @type {ol.XmlNodeStackItem} */
@@ -657,14 +657,14 @@ _ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
var geometry = feature.getGeometry();
if (geometry) {
geometry = /** @type {ol.geom.MultiLineString} */
- (_ol_format_Feature_.transformWithOptions(geometry, true, options));
+ (FeatureFormat.transformWithOptions(geometry, true, options));
properties['trkseg'] = geometry.getLineStrings();
}
var parentNode = objectStack[objectStack.length - 1].node;
- var orderedKeys = _ol_format_GPX_.TRK_SEQUENCE_[parentNode.namespaceURI];
+ var orderedKeys = GPX.TRK_SEQUENCE_[parentNode.namespaceURI];
var values = _ol_xml_.makeSequence(properties, orderedKeys);
_ol_xml_.pushSerializeAndPop(context,
- _ol_format_GPX_.TRK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
+ GPX.TRK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
};
@@ -675,12 +675,12 @@ _ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.writeTrkSeg_ = function(node, lineString, objectStack) {
+GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
/** @type {ol.XmlNodeStackItem} */
var context = {node: node, 'geometryLayout': lineString.getLayout(),
'properties': {}};
_ol_xml_.pushSerializeAndPop(context,
- _ol_format_GPX_.TRKSEG_SERIALIZERS_, _ol_format_GPX_.TRKSEG_NODE_FACTORY_,
+ GPX.TRKSEG_SERIALIZERS_, GPX.TRKSEG_NODE_FACTORY_,
lineString.getCoordinates(), objectStack);
};
@@ -691,16 +691,16 @@ _ol_format_GPX_.writeTrkSeg_ = function(node, lineString, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_GPX_.writeWpt_ = function(node, feature, objectStack) {
+GPX.writeWpt_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var context = objectStack[objectStack.length - 1];
context['properties'] = feature.getProperties();
var geometry = feature.getGeometry();
if (geometry) {
geometry = /** @type {ol.geom.Point} */
- (_ol_format_Feature_.transformWithOptions(geometry, true, options));
+ (FeatureFormat.transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout();
- _ol_format_GPX_.writeWptType_(node, geometry.getCoordinates(), objectStack);
+ GPX.writeWptType_(node, geometry.getCoordinates(), objectStack);
}
};
@@ -710,17 +710,17 @@ _ol_format_GPX_.writeWpt_ = function(node, feature, objectStack) {
* @type {Array.}
* @private
*/
-_ol_format_GPX_.LINK_SEQUENCE_ = ['text', 'type'];
+GPX.LINK_SEQUENCE_ = ['text', 'type'];
/**
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'text': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
+GPX.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'text': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
});
@@ -729,8 +729,8 @@ _ol_format_GPX_.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, [
+GPX.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, [
'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'rtept'
]);
@@ -740,18 +740,18 @@ _ol_format_GPX_.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
+GPX.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
'number': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeNonNegativeIntegerTextNode),
- 'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
+ XSD.writeNonNegativeIntegerTextNode),
+ 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'rtept': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
- _ol_format_GPX_.writeWptType_))
+ GPX.writeWptType_))
});
@@ -760,8 +760,8 @@ _ol_format_GPX_.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, [
+GPX.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, [
'ele', 'time'
]);
@@ -771,8 +771,8 @@ _ol_format_GPX_.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, [
+GPX.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, [
'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'trkseg'
]);
@@ -782,18 +782,18 @@ _ol_format_GPX_.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
+GPX.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
'number': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeNonNegativeIntegerTextNode),
- 'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
+ XSD.writeNonNegativeIntegerTextNode),
+ 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'trkseg': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
- _ol_format_GPX_.writeTrkSeg_))
+ GPX.writeTrkSeg_))
});
@@ -802,7 +802,7 @@ _ol_format_GPX_.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @type {function(*, Array.<*>, string=): (Node|undefined)}
* @private
*/
-_ol_format_GPX_.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
+GPX.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
/**
@@ -810,9 +810,9 @@ _ol_format_GPX_.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'trkpt': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeWptType_)
+GPX.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'trkpt': _ol_xml_.makeChildAppender(GPX.writeWptType_)
});
@@ -821,8 +821,8 @@ _ol_format_GPX_.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, [
+GPX.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, [
'ele', 'time', 'magvar', 'geoidheight', 'name', 'cmt', 'desc', 'src',
'link', 'sym', 'type', 'fix', 'sat', 'hdop', 'vdop', 'pdop',
'ageofdgpsdata', 'dgpsid'
@@ -833,30 +833,30 @@ _ol_format_GPX_.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'ele': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
- 'time': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDateTimeTextNode),
- 'magvar': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
+GPX.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'ele': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
+ 'time': _ol_xml_.makeChildAppender(XSD.writeDateTimeTextNode),
+ 'magvar': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'geoidheight': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeDecimalTextNode),
- 'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
- 'sym': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
- 'fix': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
+ XSD.writeDecimalTextNode),
+ 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
+ 'sym': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
+ 'fix': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'sat': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeNonNegativeIntegerTextNode),
- 'hdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
- 'vdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
- 'pdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
+ XSD.writeNonNegativeIntegerTextNode),
+ 'hdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
+ 'vdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
+ 'pdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'ageofdgpsdata': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeDecimalTextNode),
+ XSD.writeDecimalTextNode),
'dgpsid': _ol_xml_.makeChildAppender(
- _ol_format_XSD_.writeNonNegativeIntegerTextNode)
+ XSD.writeNonNegativeIntegerTextNode)
});
@@ -865,7 +865,7 @@ _ol_format_GPX_.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @type {Object.}
* @private
*/
-_ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_ = {
+GPX.GEOMETRY_TYPE_TO_NODENAME_ = {
'Point': 'wpt',
'LineString': 'rte',
'MultiLineString': 'trk'
@@ -880,10 +880,10 @@ _ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_ = {
* @return {Node|undefined} Node.
* @private
*/
-_ol_format_GPX_.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
+GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var geometry = /** @type {ol.Feature} */ (value).getGeometry();
if (geometry) {
- var nodeName = _ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
+ var nodeName = GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
if (nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
return _ol_xml_.createElementNS(parentNode.namespaceURI, nodeName);
@@ -897,11 +897,11 @@ _ol_format_GPX_.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
* @type {Object.>}
* @private
*/
-_ol_format_GPX_.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
- _ol_format_GPX_.NAMESPACE_URIS_, {
- 'rte': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeRte_),
- 'trk': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeTrk_),
- 'wpt': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeWpt_)
+GPX.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
+ GPX.NAMESPACE_URIS_, {
+ 'rte': _ol_xml_.makeChildAppender(GPX.writeRte_),
+ 'trk': _ol_xml_.makeChildAppender(GPX.writeTrk_),
+ 'wpt': _ol_xml_.makeChildAppender(GPX.writeWpt_)
});
@@ -916,7 +916,7 @@ _ol_format_GPX_.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
* @return {string} Result.
* @api
*/
-_ol_format_GPX_.prototype.writeFeatures;
+GPX.prototype.writeFeatures;
/**
@@ -930,7 +930,7 @@ _ol_format_GPX_.prototype.writeFeatures;
* @override
* @api
*/
-_ol_format_GPX_.prototype.writeFeaturesNode = function(features, opt_options) {
+GPX.prototype.writeFeaturesNode = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
//FIXME Serialize metadata
var gpx = _ol_xml_.createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');
@@ -938,13 +938,13 @@ _ol_format_GPX_.prototype.writeFeaturesNode = function(features, opt_options) {
var xmlSchemaInstanceUri = 'http://www.w3.org/2001/XMLSchema-instance';
_ol_xml_.setAttributeNS(gpx, xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri);
_ol_xml_.setAttributeNS(gpx, xmlSchemaInstanceUri, 'xsi:schemaLocation',
- _ol_format_GPX_.SCHEMA_LOCATION_);
+ GPX.SCHEMA_LOCATION_);
gpx.setAttribute('version', '1.1');
gpx.setAttribute('creator', 'OpenLayers');
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
- ({node: gpx}), _ol_format_GPX_.GPX_SERIALIZERS_,
- _ol_format_GPX_.GPX_NODE_FACTORY_, features, [opt_options]);
+ ({node: gpx}), GPX.GPX_SERIALIZERS_,
+ GPX.GPX_NODE_FACTORY_, features, [opt_options]);
return gpx;
};
-export default _ol_format_GPX_;
+export default GPX;
diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js
index 0c4e0ede91..bd9c4eeb79 100644
--- a/src/ol/format/GeoJSON.js
+++ b/src/ol/format/GeoJSON.js
@@ -7,8 +7,8 @@
import {inherits} from '../index.js';
import _ol_asserts_ from '../asserts.js';
import _ol_Feature_ from '../Feature.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
+import FeatureFormat from '../format/Feature.js';
+import JSONFeature from '../format/JSONFeature.js';
import GeometryCollection from '../geom/GeometryCollection.js';
import LineString from '../geom/LineString.js';
import MultiLineString from '../geom/MultiLineString.js';
@@ -28,11 +28,11 @@ import {get as getProjection} from '../proj.js';
* @param {olx.format.GeoJSONOptions=} opt_options Options.
* @api
*/
-var _ol_format_GeoJSON_ = function(opt_options) {
+var GeoJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
- _ol_format_JSONFeature_.call(this);
+ JSONFeature.call(this);
/**
* @inheritDoc
@@ -62,7 +62,7 @@ var _ol_format_GeoJSON_ = function(opt_options) {
};
-inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_);
+inherits(GeoJSON, JSONFeature);
/**
@@ -71,13 +71,13 @@ inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_);
* @private
* @return {ol.geom.Geometry} Geometry.
*/
-_ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) {
+GeoJSON.readGeometry_ = function(object, opt_options) {
if (!object) {
return null;
}
- var geometryReader = _ol_format_GeoJSON_.GEOMETRY_READERS_[object.type];
+ var geometryReader = GeoJSON.GEOMETRY_READERS_[object.type];
return (
- /** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
+ /** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
geometryReader(object), false, opt_options)
);
};
@@ -89,7 +89,7 @@ _ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) {
* @private
* @return {ol.geom.GeometryCollection} Geometry collection.
*/
-_ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
+GeoJSON.readGeometryCollectionGeometry_ = function(
object, opt_options) {
var geometries = object.geometries.map(
/**
@@ -97,7 +97,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
* @return {ol.geom.Geometry} geometry Geometry.
*/
function(geometry) {
- return _ol_format_GeoJSON_.readGeometry_(geometry, opt_options);
+ return GeoJSON.readGeometry_(geometry, opt_options);
});
return new GeometryCollection(geometries);
};
@@ -108,7 +108,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
* @private
* @return {ol.geom.Point} Point.
*/
-_ol_format_GeoJSON_.readPointGeometry_ = function(object) {
+GeoJSON.readPointGeometry_ = function(object) {
return new Point(object.coordinates);
};
@@ -118,7 +118,7 @@ _ol_format_GeoJSON_.readPointGeometry_ = function(object) {
* @private
* @return {ol.geom.LineString} LineString.
*/
-_ol_format_GeoJSON_.readLineStringGeometry_ = function(object) {
+GeoJSON.readLineStringGeometry_ = function(object) {
return new LineString(object.coordinates);
};
@@ -128,7 +128,7 @@ _ol_format_GeoJSON_.readLineStringGeometry_ = function(object) {
* @private
* @return {ol.geom.MultiLineString} MultiLineString.
*/
-_ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) {
+GeoJSON.readMultiLineStringGeometry_ = function(object) {
return new MultiLineString(object.coordinates);
};
@@ -138,7 +138,7 @@ _ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) {
* @private
* @return {ol.geom.MultiPoint} MultiPoint.
*/
-_ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) {
+GeoJSON.readMultiPointGeometry_ = function(object) {
return new MultiPoint(object.coordinates);
};
@@ -148,7 +148,7 @@ _ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) {
* @private
* @return {ol.geom.MultiPolygon} MultiPolygon.
*/
-_ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
+GeoJSON.readMultiPolygonGeometry_ = function(object) {
return new MultiPolygon(object.coordinates);
};
@@ -158,7 +158,7 @@ _ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
* @private
* @return {ol.geom.Polygon} Polygon.
*/
-_ol_format_GeoJSON_.readPolygonGeometry_ = function(object) {
+GeoJSON.readPolygonGeometry_ = function(object) {
return new Polygon(object.coordinates);
};
@@ -169,10 +169,10 @@ _ol_format_GeoJSON_.readPolygonGeometry_ = function(object) {
* @private
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
- var geometryWriter = _ol_format_GeoJSON_.GEOMETRY_WRITERS_[geometry.getType()];
+GeoJSON.writeGeometry_ = function(geometry, opt_options) {
+ var geometryWriter = GeoJSON.GEOMETRY_WRITERS_[geometry.getType()];
return geometryWriter(/** @type {ol.geom.Geometry} */ (
- _ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
+ FeatureFormat.transformWithOptions(geometry, true, opt_options)),
opt_options);
};
@@ -182,7 +182,7 @@ _ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
* @private
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
*/
-_ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
+GeoJSON.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
return /** @type {GeoJSONGeometryCollection} */ ({
type: 'GeometryCollection',
geometries: []
@@ -196,12 +196,12 @@ _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
* @private
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
*/
-_ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function(
+GeoJSON.writeGeometryCollectionGeometry_ = function(
geometry, opt_options) {
var geometries = geometry.getGeometriesArray().map(function(geometry) {
var options = _ol_obj_.assign({}, opt_options);
delete options.featureProjection;
- return _ol_format_GeoJSON_.writeGeometry_(geometry, options);
+ return GeoJSON.writeGeometry_(geometry, options);
});
return /** @type {GeoJSONGeometryCollection} */ ({
type: 'GeometryCollection',
@@ -216,7 +216,7 @@ _ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function(
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
+GeoJSON.writeLineStringGeometry_ = function(geometry, opt_options) {
return /** @type {GeoJSONGeometry} */ ({
type: 'LineString',
coordinates: geometry.getCoordinates()
@@ -230,7 +230,7 @@ _ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
+GeoJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
return /** @type {GeoJSONGeometry} */ ({
type: 'MultiLineString',
coordinates: geometry.getCoordinates()
@@ -244,7 +244,7 @@ _ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_optio
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
+GeoJSON.writeMultiPointGeometry_ = function(geometry, opt_options) {
return /** @type {GeoJSONGeometry} */ ({
type: 'MultiPoint',
coordinates: geometry.getCoordinates()
@@ -258,7 +258,7 @@ _ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options) {
+GeoJSON.writeMultiPolygonGeometry_ = function(geometry, opt_options) {
var right;
if (opt_options) {
right = opt_options.rightHanded;
@@ -276,7 +276,7 @@ _ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options)
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) {
+GeoJSON.writePointGeometry_ = function(geometry, opt_options) {
return /** @type {GeoJSONGeometry} */ ({
type: 'Point',
coordinates: geometry.getCoordinates()
@@ -290,7 +290,7 @@ _ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) {
* @private
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
-_ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
+GeoJSON.writePolygonGeometry_ = function(geometry, opt_options) {
var right;
if (opt_options) {
right = opt_options.rightHanded;
@@ -307,14 +307,14 @@ _ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
* @private
* @type {Object.}
*/
-_ol_format_GeoJSON_.GEOMETRY_READERS_ = {
- 'Point': _ol_format_GeoJSON_.readPointGeometry_,
- 'LineString': _ol_format_GeoJSON_.readLineStringGeometry_,
- 'Polygon': _ol_format_GeoJSON_.readPolygonGeometry_,
- 'MultiPoint': _ol_format_GeoJSON_.readMultiPointGeometry_,
- 'MultiLineString': _ol_format_GeoJSON_.readMultiLineStringGeometry_,
- 'MultiPolygon': _ol_format_GeoJSON_.readMultiPolygonGeometry_,
- 'GeometryCollection': _ol_format_GeoJSON_.readGeometryCollectionGeometry_
+GeoJSON.GEOMETRY_READERS_ = {
+ 'Point': GeoJSON.readPointGeometry_,
+ 'LineString': GeoJSON.readLineStringGeometry_,
+ 'Polygon': GeoJSON.readPolygonGeometry_,
+ 'MultiPoint': GeoJSON.readMultiPointGeometry_,
+ 'MultiLineString': GeoJSON.readMultiLineStringGeometry_,
+ 'MultiPolygon': GeoJSON.readMultiPolygonGeometry_,
+ 'GeometryCollection': GeoJSON.readGeometryCollectionGeometry_
};
@@ -323,15 +323,15 @@ _ol_format_GeoJSON_.GEOMETRY_READERS_ = {
* @private
* @type {Object.}
*/
-_ol_format_GeoJSON_.GEOMETRY_WRITERS_ = {
- 'Point': _ol_format_GeoJSON_.writePointGeometry_,
- 'LineString': _ol_format_GeoJSON_.writeLineStringGeometry_,
- 'Polygon': _ol_format_GeoJSON_.writePolygonGeometry_,
- 'MultiPoint': _ol_format_GeoJSON_.writeMultiPointGeometry_,
- 'MultiLineString': _ol_format_GeoJSON_.writeMultiLineStringGeometry_,
- 'MultiPolygon': _ol_format_GeoJSON_.writeMultiPolygonGeometry_,
- 'GeometryCollection': _ol_format_GeoJSON_.writeGeometryCollectionGeometry_,
- 'Circle': _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_
+GeoJSON.GEOMETRY_WRITERS_ = {
+ 'Point': GeoJSON.writePointGeometry_,
+ 'LineString': GeoJSON.writeLineStringGeometry_,
+ 'Polygon': GeoJSON.writePolygonGeometry_,
+ 'MultiPoint': GeoJSON.writeMultiPointGeometry_,
+ 'MultiLineString': GeoJSON.writeMultiLineStringGeometry_,
+ 'MultiPolygon': GeoJSON.writeMultiPolygonGeometry_,
+ 'GeometryCollection': GeoJSON.writeGeometryCollectionGeometry_,
+ 'Circle': GeoJSON.writeEmptyGeometryCollectionGeometry_
};
@@ -347,7 +347,7 @@ _ol_format_GeoJSON_.GEOMETRY_WRITERS_ = {
* @return {ol.Feature} Feature.
* @api
*/
-_ol_format_GeoJSON_.prototype.readFeature;
+GeoJSON.prototype.readFeature;
/**
@@ -361,13 +361,13 @@ _ol_format_GeoJSON_.prototype.readFeature;
* @return {Array.} Features.
* @api
*/
-_ol_format_GeoJSON_.prototype.readFeatures;
+GeoJSON.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
+GeoJSON.prototype.readFeatureFromObject = function(
object, opt_options) {
/**
* @type {GeoJSONFeature}
@@ -382,7 +382,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
});
}
- var geometry = _ol_format_GeoJSON_.readGeometry_(geoJSONFeature.geometry, opt_options);
+ var geometry = GeoJSON.readGeometry_(geoJSONFeature.geometry, opt_options);
var feature = new _ol_Feature_();
if (this.geometryName_) {
feature.setGeometryName(this.geometryName_);
@@ -403,7 +403,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
/**
* @inheritDoc
*/
-_ol_format_GeoJSON_.prototype.readFeaturesFromObject = function(
+GeoJSON.prototype.readFeaturesFromObject = function(
object, opt_options) {
var geoJSONObject = /** @type {GeoJSONObject} */ (object);
/** @type {Array.} */
@@ -434,15 +434,15 @@ _ol_format_GeoJSON_.prototype.readFeaturesFromObject = function(
* @return {ol.geom.Geometry} Geometry.
* @api
*/
-_ol_format_GeoJSON_.prototype.readGeometry;
+GeoJSON.prototype.readGeometry;
/**
* @inheritDoc
*/
-_ol_format_GeoJSON_.prototype.readGeometryFromObject = function(
+GeoJSON.prototype.readGeometryFromObject = function(
object, opt_options) {
- return _ol_format_GeoJSON_.readGeometry_(
+ return GeoJSON.readGeometry_(
/** @type {GeoJSONGeometry} */ (object), opt_options);
};
@@ -455,13 +455,13 @@ _ol_format_GeoJSON_.prototype.readGeometryFromObject = function(
* @return {ol.proj.Projection} Projection.
* @api
*/
-_ol_format_GeoJSON_.prototype.readProjection;
+GeoJSON.prototype.readProjection;
/**
* @inheritDoc
*/
-_ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) {
+GeoJSON.prototype.readProjectionFromObject = function(object) {
var geoJSONObject = /** @type {GeoJSONObject} */ (object);
var crs = geoJSONObject.crs;
var projection;
@@ -488,7 +488,7 @@ _ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) {
* @override
* @api
*/
-_ol_format_GeoJSON_.prototype.writeFeature;
+GeoJSON.prototype.writeFeature;
/**
@@ -500,7 +500,7 @@ _ol_format_GeoJSON_.prototype.writeFeature;
* @override
* @api
*/
-_ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options) {
+GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
opt_options = this.adaptOptions(opt_options);
var object = /** @type {GeoJSONFeature} */ ({
@@ -513,7 +513,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options
var geometry = feature.getGeometry();
if (geometry) {
object.geometry =
- _ol_format_GeoJSON_.writeGeometry_(geometry, opt_options);
+ GeoJSON.writeGeometry_(geometry, opt_options);
} else {
object.geometry = null;
}
@@ -537,7 +537,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options
* @return {string} GeoJSON.
* @api
*/
-_ol_format_GeoJSON_.prototype.writeFeatures;
+GeoJSON.prototype.writeFeatures;
/**
@@ -549,7 +549,7 @@ _ol_format_GeoJSON_.prototype.writeFeatures;
* @override
* @api
*/
-_ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_options) {
+GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
var objects = [];
var i, ii;
@@ -572,7 +572,7 @@ _ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_optio
* @return {string} GeoJSON.
* @api
*/
-_ol_format_GeoJSON_.prototype.writeGeometry;
+GeoJSON.prototype.writeGeometry;
/**
@@ -584,9 +584,9 @@ _ol_format_GeoJSON_.prototype.writeGeometry;
* @override
* @api
*/
-_ol_format_GeoJSON_.prototype.writeGeometryObject = function(geometry,
+GeoJSON.prototype.writeGeometryObject = function(geometry,
opt_options) {
- return _ol_format_GeoJSON_.writeGeometry_(geometry,
+ return GeoJSON.writeGeometry_(geometry,
this.adaptOptions(opt_options));
};
-export default _ol_format_GeoJSON_;
+export default GeoJSON;
diff --git a/src/ol/format/IGC.js b/src/ol/format/IGC.js
index dc238e7445..5bc8e137ff 100644
--- a/src/ol/format/IGC.js
+++ b/src/ol/format/IGC.js
@@ -3,9 +3,9 @@
*/
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
-import _ol_format_Feature_ from '../format/Feature.js';
+import FeatureFormat from '../format/Feature.js';
import _ol_format_IGCZ_ from '../format/IGCZ.js';
-import _ol_format_TextFeature_ from '../format/TextFeature.js';
+import TextFeature from '../format/TextFeature.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js';
import {get as getProjection} from '../proj.js';
@@ -19,11 +19,11 @@ import {get as getProjection} from '../proj.js';
* @param {olx.format.IGCOptions=} opt_options Options.
* @api
*/
-var _ol_format_IGC_ = function(opt_options) {
+var IGC = function(opt_options) {
var options = opt_options ? opt_options : {};
- _ol_format_TextFeature_.call(this);
+ TextFeature.call(this);
/**
* @inheritDoc
@@ -39,7 +39,7 @@ var _ol_format_IGC_ = function(opt_options) {
};
-inherits(_ol_format_IGC_, _ol_format_TextFeature_);
+inherits(IGC, TextFeature);
/**
@@ -47,7 +47,7 @@ inherits(_ol_format_IGC_, _ol_format_TextFeature_);
* @type {RegExp}
* @private
*/
-_ol_format_IGC_.B_RECORD_RE_ =
+IGC.B_RECORD_RE_ =
/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;
@@ -56,7 +56,7 @@ _ol_format_IGC_.B_RECORD_RE_ =
* @type {RegExp}
* @private
*/
-_ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
+IGC.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
/**
@@ -64,7 +64,7 @@ _ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
* @type {RegExp}
* @private
*/
-_ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
+IGC.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
/**
@@ -74,7 +74,7 @@ _ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
* @type {RegExp}
* @private
*/
-_ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
+IGC.NEWLINE_RE_ = /\r\n|\r|\n/;
/**
@@ -86,15 +86,15 @@ _ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
* @return {ol.Feature} Feature.
* @api
*/
-_ol_format_IGC_.prototype.readFeature;
+IGC.prototype.readFeature;
/**
* @inheritDoc
*/
-_ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
+IGC.prototype.readFeatureFromText = function(text, opt_options) {
var altitudeMode = this.altitudeMode_;
- var lines = text.split(_ol_format_IGC_.NEWLINE_RE_);
+ var lines = text.split(IGC.NEWLINE_RE_);
/** @type {Object.} */
var properties = {};
var flatCoordinates = [];
@@ -107,7 +107,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
var line = lines[i];
var m;
if (line.charAt(0) == 'B') {
- m = _ol_format_IGC_.B_RECORD_RE_.exec(line);
+ m = IGC.B_RECORD_RE_.exec(line);
if (m) {
var hour = parseInt(m[1], 10);
var minute = parseInt(m[2], 10);
@@ -141,13 +141,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
lastDateTime = dateTime;
}
} else if (line.charAt(0) == 'H') {
- m = _ol_format_IGC_.HFDTE_RECORD_RE_.exec(line);
+ m = IGC.HFDTE_RECORD_RE_.exec(line);
if (m) {
day = parseInt(m[1], 10);
month = parseInt(m[2], 10) - 1;
year = 2000 + parseInt(m[3], 10);
} else {
- m = _ol_format_IGC_.H_RECORD_RE_.exec(line);
+ m = IGC.H_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = m[2].trim();
}
@@ -161,7 +161,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
GeometryLayout.XYM : GeometryLayout.XYZM;
lineString.setFlatCoordinates(layout, flatCoordinates);
- var feature = new _ol_Feature_(_ol_format_Feature_.transformWithOptions(
+ var feature = new _ol_Feature_(FeatureFormat.transformWithOptions(
lineString, false, opt_options));
feature.setProperties(properties);
return feature;
@@ -178,13 +178,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
* @return {Array.} Features.
* @api
*/
-_ol_format_IGC_.prototype.readFeatures;
+IGC.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
+IGC.prototype.readFeaturesFromText = function(text, opt_options) {
var feature = this.readFeatureFromText(text, opt_options);
if (feature) {
return [feature];
@@ -202,33 +202,33 @@ _ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
* @return {ol.proj.Projection} Projection.
* @api
*/
-_ol_format_IGC_.prototype.readProjection;
+IGC.prototype.readProjection;
/**
* Not implemented.
* @inheritDoc
*/
-_ol_format_IGC_.prototype.writeFeatureText = function(feature, opt_options) {};
+IGC.prototype.writeFeatureText = function(feature, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
-_ol_format_IGC_.prototype.writeFeaturesText = function(features, opt_options) {};
+IGC.prototype.writeFeaturesText = function(features, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
-_ol_format_IGC_.prototype.writeGeometryText = function(geometry, opt_options) {};
+IGC.prototype.writeGeometryText = function(geometry, opt_options) {};
/**
* Not implemented.
* @inheritDoc
*/
-_ol_format_IGC_.prototype.readGeometryFromText = function(text, opt_options) {};
-export default _ol_format_IGC_;
+IGC.prototype.readGeometryFromText = function(text, opt_options) {};
+export default IGC;
diff --git a/src/ol/format/JSONFeature.js b/src/ol/format/JSONFeature.js
index 39facbebbe..802c59d83c 100644
--- a/src/ol/format/JSONFeature.js
+++ b/src/ol/format/JSONFeature.js
@@ -2,7 +2,7 @@
* @module ol/format/JSONFeature
*/
import {inherits} from '../index.js';
-import _ol_format_Feature_ from '../format/Feature.js';
+import FeatureFormat from '../format/Feature.js';
import _ol_format_FormatType_ from '../format/FormatType.js';
/**
@@ -15,11 +15,11 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
* @abstract
* @extends {ol.format.Feature}
*/
-var _ol_format_JSONFeature_ = function() {
- _ol_format_Feature_.call(this);
+var JSONFeature = function() {
+ FeatureFormat.call(this);
};
-inherits(_ol_format_JSONFeature_, _ol_format_Feature_);
+inherits(JSONFeature, FeatureFormat);
/**
@@ -27,7 +27,7 @@ inherits(_ol_format_JSONFeature_, _ol_format_Feature_);
* @private
* @return {Object} Object.
*/
-_ol_format_JSONFeature_.prototype.getObject_ = function(source) {
+JSONFeature.prototype.getObject_ = function(source) {
if (typeof source === 'string') {
var object = JSON.parse(source);
return object ? /** @type {Object} */ (object) : null;
@@ -42,7 +42,7 @@ _ol_format_JSONFeature_.prototype.getObject_ = function(source) {
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.getType = function() {
+JSONFeature.prototype.getType = function() {
return _ol_format_FormatType_.JSON;
};
@@ -50,7 +50,7 @@ _ol_format_JSONFeature_.prototype.getType = function() {
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.readFeature = function(source, opt_options) {
+JSONFeature.prototype.readFeature = function(source, opt_options) {
return this.readFeatureFromObject(
this.getObject_(source), this.getReadOptions(source, opt_options));
};
@@ -59,7 +59,7 @@ _ol_format_JSONFeature_.prototype.readFeature = function(source, opt_options) {
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.readFeatures = function(source, opt_options) {
+JSONFeature.prototype.readFeatures = function(source, opt_options) {
return this.readFeaturesFromObject(
this.getObject_(source), this.getReadOptions(source, opt_options));
};
@@ -72,7 +72,7 @@ _ol_format_JSONFeature_.prototype.readFeatures = function(source, opt_options) {
* @protected
* @return {ol.Feature} Feature.
*/
-_ol_format_JSONFeature_.prototype.readFeatureFromObject = function(object, opt_options) {};
+JSONFeature.prototype.readFeatureFromObject = function(object, opt_options) {};
/**
@@ -82,13 +82,13 @@ _ol_format_JSONFeature_.prototype.readFeatureFromObject = function(object, opt_o
* @protected
* @return {Array.} Features.
*/
-_ol_format_JSONFeature_.prototype.readFeaturesFromObject = function(object, opt_options) {};
+JSONFeature.prototype.readFeaturesFromObject = function(object, opt_options) {};
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.readGeometry = function(source, opt_options) {
+JSONFeature.prototype.readGeometry = function(source, opt_options) {
return this.readGeometryFromObject(
this.getObject_(source), this.getReadOptions(source, opt_options));
};
@@ -101,13 +101,13 @@ _ol_format_JSONFeature_.prototype.readGeometry = function(source, opt_options) {
* @protected
* @return {ol.geom.Geometry} Geometry.
*/
-_ol_format_JSONFeature_.prototype.readGeometryFromObject = function(object, opt_options) {};
+JSONFeature.prototype.readGeometryFromObject = function(object, opt_options) {};
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.readProjection = function(source) {
+JSONFeature.prototype.readProjection = function(source) {
return this.readProjectionFromObject(this.getObject_(source));
};
@@ -118,13 +118,13 @@ _ol_format_JSONFeature_.prototype.readProjection = function(source) {
* @protected
* @return {ol.proj.Projection} Projection.
*/
-_ol_format_JSONFeature_.prototype.readProjectionFromObject = function(object) {};
+JSONFeature.prototype.readProjectionFromObject = function(object) {};
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.writeFeature = function(feature, opt_options) {
+JSONFeature.prototype.writeFeature = function(feature, opt_options) {
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
};
@@ -135,13 +135,13 @@ _ol_format_JSONFeature_.prototype.writeFeature = function(feature, opt_options)
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
-_ol_format_JSONFeature_.prototype.writeFeatureObject = function(feature, opt_options) {};
+JSONFeature.prototype.writeFeatureObject = function(feature, opt_options) {};
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.writeFeatures = function(features, opt_options) {
+JSONFeature.prototype.writeFeatures = function(features, opt_options) {
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
};
@@ -152,13 +152,13 @@ _ol_format_JSONFeature_.prototype.writeFeatures = function(features, opt_options
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
-_ol_format_JSONFeature_.prototype.writeFeaturesObject = function(features, opt_options) {};
+JSONFeature.prototype.writeFeaturesObject = function(features, opt_options) {};
/**
* @inheritDoc
*/
-_ol_format_JSONFeature_.prototype.writeGeometry = function(geometry, opt_options) {
+JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
};
@@ -169,5 +169,5 @@ _ol_format_JSONFeature_.prototype.writeGeometry = function(geometry, opt_options
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
-_ol_format_JSONFeature_.prototype.writeGeometryObject = function(geometry, opt_options) {};
-export default _ol_format_JSONFeature_;
+JSONFeature.prototype.writeGeometryObject = function(geometry, opt_options) {};
+export default JSONFeature;
diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js
index 6237861a47..c5087535e9 100644
--- a/src/ol/format/KML.js
+++ b/src/ol/format/KML.js
@@ -1,19 +1,14 @@
/**
* @module ol/format/KML
*/
-// FIXME http://earth.google.com/kml/1.0 namespace?
-// FIXME why does node.getAttribute return an unknown type?
-// FIXME serialize arbitrary feature properties
-// FIXME don't parse style if extractStyles is false
-
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_array_ from '../array.js';
import _ol_asserts_ from '../asserts.js';
import _ol_color_ from '../color.js';
-import _ol_format_Feature_ from '../format/Feature.js';
-import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
-import _ol_format_XSD_ from '../format/XSD.js';
+import FeatureFormat from '../format/Feature.js';
+import XMLFeature from '../format/XMLFeature.js';
+import XSD from '../format/XSD.js';
import GeometryCollection from '../geom/GeometryCollection.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
@@ -46,14 +41,14 @@ import _ol_xml_ from '../xml.js';
* @param {olx.format.KMLOptions=} opt_options Options.
* @api
*/
-var _ol_format_KML_ = function(opt_options) {
+var KML = function(opt_options) {
var options = opt_options ? opt_options : {};
- _ol_format_XMLFeature_.call(this);
+ XMLFeature.call(this);
- if (!_ol_format_KML_.DEFAULT_STYLE_ARRAY_) {
- _ol_format_KML_.createStyleDefaults_();
+ if (!KML.DEFAULT_STYLE_ARRAY_) {
+ KML.createStyleDefaults_();
}
/**
@@ -66,7 +61,7 @@ var _ol_format_KML_ = function(opt_options) {
* @type {Array.}
*/
this.defaultStyle_ = options.defaultStyle ?
- options.defaultStyle : _ol_format_KML_.DEFAULT_STYLE_ARRAY_;
+ options.defaultStyle : KML.DEFAULT_STYLE_ARRAY_;
/**
* @private
@@ -97,7 +92,7 @@ var _ol_format_KML_ = function(opt_options) {
};
-inherits(_ol_format_KML_, _ol_format_XMLFeature_);
+inherits(KML, XMLFeature);
/**
@@ -105,7 +100,7 @@ inherits(_ol_format_KML_, _ol_format_XMLFeature_);
* @type {Array.}
* @private
*/
-_ol_format_KML_.GX_NAMESPACE_URIS_ = [
+KML.GX_NAMESPACE_URIS_ = [
'http://www.google.com/kml/ext/2.2'
];
@@ -115,7 +110,7 @@ _ol_format_KML_.GX_NAMESPACE_URIS_ = [
* @type {Array.}
* @private
*/
-_ol_format_KML_.NAMESPACE_URIS_ = [
+KML.NAMESPACE_URIS_ = [
null,
'http://earth.google.com/kml/2.0',
'http://earth.google.com/kml/2.1',
@@ -129,7 +124,7 @@ _ol_format_KML_.NAMESPACE_URIS_ = [
* @type {string}
* @private
*/
-_ol_format_KML_.SCHEMA_LOCATION_ = 'http://www.opengis.net/kml/2.2 ' +
+KML.SCHEMA_LOCATION_ = 'http://www.opengis.net/kml/2.2 ' +
'https://developers.google.com/kml/schema/kml22gx.xsd';
@@ -137,21 +132,21 @@ _ol_format_KML_.SCHEMA_LOCATION_ = 'http://www.opengis.net/kml/2.2 ' +
* @return {Array.} Default style.
* @private
*/
-_ol_format_KML_.createStyleDefaults_ = function() {
+KML.createStyleDefaults_ = function() {
/**
* @const
* @type {ol.Color}
* @private
*/
- _ol_format_KML_.DEFAULT_COLOR_ = [255, 255, 255, 1];
+ KML.DEFAULT_COLOR_ = [255, 255, 255, 1];
/**
* @const
* @type {ol.style.Fill}
* @private
*/
- _ol_format_KML_.DEFAULT_FILL_STYLE_ = new _ol_style_Fill_({
- color: _ol_format_KML_.DEFAULT_COLOR_
+ KML.DEFAULT_FILL_STYLE_ = new _ol_style_Fill_({
+ color: KML.DEFAULT_COLOR_
});
/**
@@ -159,14 +154,14 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.Size}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_ = [20, 2]; // FIXME maybe [8, 32] ?
+ KML.DEFAULT_IMAGE_STYLE_ANCHOR_ = [20, 2]; // FIXME maybe [8, 32] ?
/**
* @const
* @type {ol.style.IconAnchorUnits}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_ =
+ KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_ =
_ol_style_IconAnchorUnits_.PIXELS;
/**
@@ -174,7 +169,7 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.style.IconAnchorUnits}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_ =
+ KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_ =
_ol_style_IconAnchorUnits_.PIXELS;
/**
@@ -182,14 +177,14 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.Size}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_SIZE_ = [64, 64];
+ KML.DEFAULT_IMAGE_STYLE_SIZE_ = [64, 64];
/**
* @const
* @type {string}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_SRC_ =
+ KML.DEFAULT_IMAGE_STYLE_SRC_ =
'https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png';
/**
@@ -197,23 +192,23 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {number}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_SCALE_MULTIPLIER_ = 0.5;
+ KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_ = 0.5;
/**
* @const
* @type {ol.style.Image}
* @private
*/
- _ol_format_KML_.DEFAULT_IMAGE_STYLE_ = new _ol_style_Icon_({
- anchor: _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_,
+ KML.DEFAULT_IMAGE_STYLE_ = new _ol_style_Icon_({
+ anchor: KML.DEFAULT_IMAGE_STYLE_ANCHOR_,
anchorOrigin: _ol_style_IconOrigin_.BOTTOM_LEFT,
- anchorXUnits: _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,
- anchorYUnits: _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_,
+ anchorXUnits: KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,
+ anchorYUnits: KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_,
crossOrigin: 'anonymous',
rotation: 0,
- scale: _ol_format_KML_.DEFAULT_IMAGE_SCALE_MULTIPLIER_,
- size: _ol_format_KML_.DEFAULT_IMAGE_STYLE_SIZE_,
- src: _ol_format_KML_.DEFAULT_IMAGE_STYLE_SRC_
+ scale: KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_,
+ size: KML.DEFAULT_IMAGE_STYLE_SIZE_,
+ src: KML.DEFAULT_IMAGE_STYLE_SRC_
});
/**
@@ -221,15 +216,15 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {string}
* @private
*/
- _ol_format_KML_.DEFAULT_NO_IMAGE_STYLE_ = 'NO_IMAGE';
+ KML.DEFAULT_NO_IMAGE_STYLE_ = 'NO_IMAGE';
/**
* @const
* @type {ol.style.Stroke}
* @private
*/
- _ol_format_KML_.DEFAULT_STROKE_STYLE_ = new _ol_style_Stroke_({
- color: _ol_format_KML_.DEFAULT_COLOR_,
+ KML.DEFAULT_STROKE_STYLE_ = new _ol_style_Stroke_({
+ color: KML.DEFAULT_COLOR_,
width: 1
});
@@ -238,7 +233,7 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.style.Stroke}
* @private
*/
- _ol_format_KML_.DEFAULT_TEXT_STROKE_STYLE_ = new _ol_style_Stroke_({
+ KML.DEFAULT_TEXT_STROKE_STYLE_ = new _ol_style_Stroke_({
color: [51, 51, 51, 1],
width: 2
});
@@ -248,10 +243,10 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.style.Text}
* @private
*/
- _ol_format_KML_.DEFAULT_TEXT_STYLE_ = new _ol_style_Text_({
+ KML.DEFAULT_TEXT_STYLE_ = new _ol_style_Text_({
font: 'bold 16px Helvetica',
- fill: _ol_format_KML_.DEFAULT_FILL_STYLE_,
- stroke: _ol_format_KML_.DEFAULT_TEXT_STROKE_STYLE_,
+ fill: KML.DEFAULT_FILL_STYLE_,
+ stroke: KML.DEFAULT_TEXT_STROKE_STYLE_,
scale: 0.8
});
@@ -260,11 +255,11 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {ol.style.Style}
* @private
*/
- _ol_format_KML_.DEFAULT_STYLE_ = new _ol_style_Style_({
- fill: _ol_format_KML_.DEFAULT_FILL_STYLE_,
- image: _ol_format_KML_.DEFAULT_IMAGE_STYLE_,
- text: _ol_format_KML_.DEFAULT_TEXT_STYLE_,
- stroke: _ol_format_KML_.DEFAULT_STROKE_STYLE_,
+ KML.DEFAULT_STYLE_ = new _ol_style_Style_({
+ fill: KML.DEFAULT_FILL_STYLE_,
+ image: KML.DEFAULT_IMAGE_STYLE_,
+ text: KML.DEFAULT_TEXT_STYLE_,
+ stroke: KML.DEFAULT_STROKE_STYLE_,
zIndex: 0
});
@@ -273,9 +268,9 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {Array.}
* @private
*/
- _ol_format_KML_.DEFAULT_STYLE_ARRAY_ = [_ol_format_KML_.DEFAULT_STYLE_];
+ KML.DEFAULT_STYLE_ARRAY_ = [KML.DEFAULT_STYLE_];
- return _ol_format_KML_.DEFAULT_STYLE_ARRAY_;
+ return KML.DEFAULT_STYLE_ARRAY_;
};
@@ -284,7 +279,7 @@ _ol_format_KML_.createStyleDefaults_ = function() {
* @type {Object.}
* @private
*/
-_ol_format_KML_.ICON_ANCHOR_UNITS_MAP_ = {
+KML.ICON_ANCHOR_UNITS_MAP_ = {
'fraction': _ol_style_IconAnchorUnits_.FRACTION,
'pixels': _ol_style_IconAnchorUnits_.PIXELS,
'insetPixels': _ol_style_IconAnchorUnits_.PIXELS
@@ -297,14 +292,14 @@ _ol_format_KML_.ICON_ANCHOR_UNITS_MAP_ = {
* @return {ol.style.Style} style Style.
* @private
*/
-_ol_format_KML_.createNameStyleFunction_ = function(foundStyle, name) {
+KML.createNameStyleFunction_ = function(foundStyle, name) {
var textStyle = null;
var textOffset = [0, 0];
var textAlign = 'start';
if (foundStyle.getImage()) {
var imageSize = foundStyle.getImage().getImageSize();
if (imageSize === null) {
- imageSize = _ol_format_KML_.DEFAULT_IMAGE_STYLE_SIZE_;
+ imageSize = KML.DEFAULT_IMAGE_STYLE_SIZE_;
}
if (imageSize.length == 2) {
var imageScale = foundStyle.getImage().getScale();
@@ -320,12 +315,12 @@ _ol_format_KML_.createNameStyleFunction_ = function(foundStyle, name) {
// Note that kml does not support many text options that OpenLayers does (rotation, textBaseline).
var foundText = foundStyle.getText();
textStyle = foundText.clone();
- textStyle.setFont(foundText.getFont() || _ol_format_KML_.DEFAULT_TEXT_STYLE_.getFont());
- textStyle.setScale(foundText.getScale() || _ol_format_KML_.DEFAULT_TEXT_STYLE_.getScale());
- textStyle.setFill(foundText.getFill() || _ol_format_KML_.DEFAULT_TEXT_STYLE_.getFill());
- textStyle.setStroke(foundText.getStroke() || _ol_format_KML_.DEFAULT_TEXT_STROKE_STYLE_);
+ textStyle.setFont(foundText.getFont() || KML.DEFAULT_TEXT_STYLE_.getFont());
+ textStyle.setScale(foundText.getScale() || KML.DEFAULT_TEXT_STYLE_.getScale());
+ textStyle.setFill(foundText.getFill() || KML.DEFAULT_TEXT_STYLE_.getFill());
+ textStyle.setStroke(foundText.getStroke() || KML.DEFAULT_TEXT_STROKE_STYLE_);
} else {
- textStyle = _ol_format_KML_.DEFAULT_TEXT_STYLE_.clone();
+ textStyle = KML.DEFAULT_TEXT_STYLE_.clone();
}
textStyle.setText(name);
textStyle.setOffsetX(textOffset[0]);
@@ -350,7 +345,7 @@ _ol_format_KML_.createNameStyleFunction_ = function(foundStyle, name) {
* @return {ol.FeatureStyleFunction} Feature style function.
* @private
*/
-_ol_format_KML_.createFeatureStyleFunction_ = function(style, styleUrl,
+KML.createFeatureStyleFunction_ = function(style, styleUrl,
defaultStyle, sharedStyles, showPointNames) {
return (
@@ -378,24 +373,24 @@ _ol_format_KML_.createFeatureStyleFunction_ = function(style, styleUrl,
if (style) {
if (drawName) {
- nameStyle = _ol_format_KML_.createNameStyleFunction_(style[0],
+ nameStyle = KML.createNameStyleFunction_(style[0],
name);
return style.concat(nameStyle);
}
return style;
}
if (styleUrl) {
- var foundStyle = _ol_format_KML_.findStyle_(styleUrl, defaultStyle,
+ var foundStyle = KML.findStyle_(styleUrl, defaultStyle,
sharedStyles);
if (drawName) {
- nameStyle = _ol_format_KML_.createNameStyleFunction_(foundStyle[0],
+ nameStyle = KML.createNameStyleFunction_(foundStyle[0],
name);
return foundStyle.concat(nameStyle);
}
return foundStyle;
}
if (drawName) {
- nameStyle = _ol_format_KML_.createNameStyleFunction_(defaultStyle[0],
+ nameStyle = KML.createNameStyleFunction_(defaultStyle[0],
name);
return defaultStyle.concat(nameStyle);
}
@@ -413,7 +408,7 @@ _ol_format_KML_.createFeatureStyleFunction_ = function(style, styleUrl,
* @return {Array.} Style.
* @private
*/
-_ol_format_KML_.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
+KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
if (Array.isArray(styleValue)) {
return styleValue;
} else if (typeof styleValue === 'string') {
@@ -423,7 +418,7 @@ _ol_format_KML_.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
if (!(styleValue in sharedStyles) && ('#' + styleValue in sharedStyles)) {
styleValue = '#' + styleValue;
}
- return _ol_format_KML_.findStyle_(
+ return KML.findStyle_(
sharedStyles[styleValue], defaultStyle, sharedStyles);
} else {
return defaultStyle;
@@ -436,7 +431,7 @@ _ol_format_KML_.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
* @private
* @return {ol.Color|undefined} Color.
*/
-_ol_format_KML_.readColor_ = function(node) {
+KML.readColor_ = function(node) {
var s = _ol_xml_.getAllTextContent(node, false);
// The KML specification states that colors should not include a leading `#`
// but we tolerate them.
@@ -461,7 +456,7 @@ _ol_format_KML_.readColor_ = function(node) {
* @private
* @return {Array.|undefined} Flat coordinates.
*/
-_ol_format_KML_.readFlatCoordinates_ = function(node) {
+KML.readFlatCoordinates_ = function(node) {
var s = _ol_xml_.getAllTextContent(node, false);
var flatCoordinates = [];
// The KML specification states that coordinate tuples should not include
@@ -488,7 +483,7 @@ _ol_format_KML_.readFlatCoordinates_ = function(node) {
* @private
* @return {string} URI.
*/
-_ol_format_KML_.readURI_ = function(node) {
+KML.readURI_ = function(node) {
var s = _ol_xml_.getAllTextContent(node, false).trim();
var baseURI = node.baseURI;
if (!baseURI || baseURI == 'about:blank') {
@@ -508,7 +503,7 @@ _ol_format_KML_.readURI_ = function(node) {
* @private
* @return {ol.KMLVec2_} Vec2.
*/
-_ol_format_KML_.readVec2_ = function(node) {
+KML.readVec2_ = function(node) {
var xunits = node.getAttribute('xunits');
var yunits = node.getAttribute('yunits');
var origin;
@@ -527,9 +522,9 @@ _ol_format_KML_.readVec2_ = function(node) {
}
return {
x: parseFloat(node.getAttribute('x')),
- xunits: _ol_format_KML_.ICON_ANCHOR_UNITS_MAP_[xunits],
+ xunits: KML.ICON_ANCHOR_UNITS_MAP_[xunits],
y: parseFloat(node.getAttribute('y')),
- yunits: _ol_format_KML_.ICON_ANCHOR_UNITS_MAP_[yunits],
+ yunits: KML.ICON_ANCHOR_UNITS_MAP_[yunits],
origin: origin
};
};
@@ -540,8 +535,8 @@ _ol_format_KML_.readVec2_ = function(node) {
* @private
* @return {number|undefined} Scale.
*/
-_ol_format_KML_.readScale_ = function(node) {
- return _ol_format_XSD_.readDecimal(node);
+KML.readScale_ = function(node) {
+ return XSD.readDecimal(node);
};
@@ -551,16 +546,16 @@ _ol_format_KML_.readScale_ = function(node) {
* @private
* @return {Array.|string|undefined} StyleMap.
*/
-_ol_format_KML_.readStyleMapValue_ = function(node, objectStack) {
+KML.readStyleMapValue_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop(undefined,
- _ol_format_KML_.STYLE_MAP_PARSERS_, node, objectStack);
+ KML.STYLE_MAP_PARSERS_, node, objectStack);
};
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
+KML.IconStyleParser_ = function(node, objectStack) {
// FIXME refreshMode
// FIXME refreshInterval
// FIXME viewRefreshTime
@@ -568,7 +563,7 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
// FIXME viewFormat
// FIXME httpQuery
var object = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.ICON_STYLE_PARSERS_, node, objectStack);
+ {}, KML.ICON_STYLE_PARSERS_, node, objectStack);
if (!object) {
return;
}
@@ -581,7 +576,7 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
if (href) {
src = href;
} else if (drawIcon) {
- src = _ol_format_KML_.DEFAULT_IMAGE_STYLE_SRC_;
+ src = KML.DEFAULT_IMAGE_STYLE_SRC_;
}
var anchor, anchorXUnits, anchorYUnits;
var anchorOrigin = _ol_style_IconOrigin_.BOTTOM_LEFT;
@@ -592,10 +587,10 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
anchorXUnits = hotSpot.xunits;
anchorYUnits = hotSpot.yunits;
anchorOrigin = hotSpot.origin;
- } else if (src === _ol_format_KML_.DEFAULT_IMAGE_STYLE_SRC_) {
- anchor = _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_;
- anchorXUnits = _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_;
- anchorYUnits = _ol_format_KML_.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_;
+ } else if (src === KML.DEFAULT_IMAGE_STYLE_SRC_) {
+ anchor = KML.DEFAULT_IMAGE_STYLE_ANCHOR_;
+ anchorXUnits = KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_;
+ anchorYUnits = KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_;
} else if (/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(src)) {
anchor = [0.5, 0];
anchorXUnits = _ol_style_IconAnchorUnits_.FRACTION;
@@ -631,10 +626,10 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
(object['scale']);
if (drawIcon) {
- if (src == _ol_format_KML_.DEFAULT_IMAGE_STYLE_SRC_) {
- size = _ol_format_KML_.DEFAULT_IMAGE_STYLE_SIZE_;
+ if (src == KML.DEFAULT_IMAGE_STYLE_SRC_) {
+ size = KML.DEFAULT_IMAGE_STYLE_SIZE_;
if (scale === undefined) {
- scale = _ol_format_KML_.DEFAULT_IMAGE_SCALE_MULTIPLIER_;
+ scale = KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_;
}
}
@@ -654,7 +649,7 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
styleObject['imageStyle'] = imageStyle;
} else {
// handle the case when we explicitly want to draw no icon.
- styleObject['imageStyle'] = _ol_format_KML_.DEFAULT_NO_IMAGE_STYLE_;
+ styleObject['imageStyle'] = KML.DEFAULT_NO_IMAGE_STYLE_;
}
};
@@ -664,10 +659,10 @@ _ol_format_KML_.IconStyleParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.LabelStyleParser_ = function(node, objectStack) {
+KML.LabelStyleParser_ = function(node, objectStack) {
// FIXME colorMode
var object = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.LABEL_STYLE_PARSERS_, node, objectStack);
+ {}, KML.LABEL_STYLE_PARSERS_, node, objectStack);
if (!object) {
return;
}
@@ -675,7 +670,7 @@ _ol_format_KML_.LabelStyleParser_ = function(node, objectStack) {
var textStyle = new _ol_style_Text_({
fill: new _ol_style_Fill_({
color: /** @type {ol.Color} */
- ('color' in object ? object['color'] : _ol_format_KML_.DEFAULT_COLOR_)
+ ('color' in object ? object['color'] : KML.DEFAULT_COLOR_)
}),
scale: /** @type {number|undefined} */
(object['scale'])
@@ -689,21 +684,21 @@ _ol_format_KML_.LabelStyleParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.LineStyleParser_ = function(node, objectStack) {
+KML.LineStyleParser_ = function(node, objectStack) {
// FIXME colorMode
// FIXME gx:outerColor
// FIXME gx:outerWidth
// FIXME gx:physicalWidth
// FIXME gx:labelVisibility
var object = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.LINE_STYLE_PARSERS_, node, objectStack);
+ {}, KML.LINE_STYLE_PARSERS_, node, objectStack);
if (!object) {
return;
}
var styleObject = objectStack[objectStack.length - 1];
var strokeStyle = new _ol_style_Stroke_({
color: /** @type {ol.Color} */
- ('color' in object ? object['color'] : _ol_format_KML_.DEFAULT_COLOR_),
+ ('color' in object ? object['color'] : KML.DEFAULT_COLOR_),
width: /** @type {number} */ ('width' in object ? object['width'] : 1)
});
styleObject['strokeStyle'] = strokeStyle;
@@ -715,17 +710,17 @@ _ol_format_KML_.LineStyleParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.PolyStyleParser_ = function(node, objectStack) {
+KML.PolyStyleParser_ = function(node, objectStack) {
// FIXME colorMode
var object = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.POLY_STYLE_PARSERS_, node, objectStack);
+ {}, KML.POLY_STYLE_PARSERS_, node, objectStack);
if (!object) {
return;
}
var styleObject = objectStack[objectStack.length - 1];
var fillStyle = new _ol_style_Fill_({
color: /** @type {ol.Color} */
- ('color' in object ? object['color'] : _ol_format_KML_.DEFAULT_COLOR_)
+ ('color' in object ? object['color'] : KML.DEFAULT_COLOR_)
});
styleObject['fillStyle'] = fillStyle;
var fill = /** @type {boolean|undefined} */ (object['fill']);
@@ -746,9 +741,9 @@ _ol_format_KML_.PolyStyleParser_ = function(node, objectStack) {
* @private
* @return {Array.} LinearRing flat coordinates.
*/
-_ol_format_KML_.readFlatLinearRing_ = function(node, objectStack) {
+KML.readFlatLinearRing_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop(null,
- _ol_format_KML_.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
+ KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
};
@@ -757,7 +752,7 @@ _ol_format_KML_.readFlatLinearRing_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.gxCoordParser_ = function(node, objectStack) {
+KML.gxCoordParser_ = function(node, objectStack) {
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]);
var flatCoordinates = gxTrackObject.flatCoordinates;
@@ -782,9 +777,9 @@ _ol_format_KML_.gxCoordParser_ = function(node, objectStack) {
* @private
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
-_ol_format_KML_.readGxMultiTrack_ = function(node, objectStack) {
+KML.readGxMultiTrack_ = function(node, objectStack) {
var lineStrings = _ol_xml_.pushParseAndPop([],
- _ol_format_KML_.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
+ KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
if (!lineStrings) {
return undefined;
}
@@ -800,12 +795,12 @@ _ol_format_KML_.readGxMultiTrack_ = function(node, objectStack) {
* @private
* @return {ol.geom.LineString|undefined} LineString.
*/
-_ol_format_KML_.readGxTrack_ = function(node, objectStack) {
+KML.readGxTrack_ = function(node, objectStack) {
var gxTrackObject = _ol_xml_.pushParseAndPop(
/** @type {ol.KMLGxTrackObject_} */ ({
flatCoordinates: [],
whens: []
- }), _ol_format_KML_.GX_TRACK_PARSERS_, node, objectStack);
+ }), KML.GX_TRACK_PARSERS_, node, objectStack);
if (!gxTrackObject) {
return undefined;
}
@@ -828,9 +823,9 @@ _ol_format_KML_.readGxTrack_ = function(node, objectStack) {
* @private
* @return {Object} Icon object.
*/
-_ol_format_KML_.readIcon_ = function(node, objectStack) {
+KML.readIcon_ = function(node, objectStack) {
var iconObject = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.ICON_PARSERS_, node, objectStack);
+ {}, KML.ICON_PARSERS_, node, objectStack);
if (iconObject) {
return iconObject;
} else {
@@ -845,9 +840,9 @@ _ol_format_KML_.readIcon_ = function(node, objectStack) {
* @private
* @return {Array.} Flat coordinates.
*/
-_ol_format_KML_.readFlatCoordinatesFromNode_ = function(node, objectStack) {
+KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
return _ol_xml_.pushParseAndPop(null,
- _ol_format_KML_.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
+ KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
};
@@ -857,12 +852,12 @@ _ol_format_KML_.readFlatCoordinatesFromNode_ = function(node, objectStack) {
* @private
* @return {ol.geom.LineString|undefined} LineString.
*/
-_ol_format_KML_.readLineString_ = function(node, objectStack) {
+KML.readLineString_ = function(node, objectStack) {
var properties = _ol_xml_.pushParseAndPop({},
- _ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
+ KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
var flatCoordinates =
- _ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
+ KML.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var lineString = new LineString(null);
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
@@ -880,12 +875,12 @@ _ol_format_KML_.readLineString_ = function(node, objectStack) {
* @private
* @return {ol.geom.Polygon|undefined} Polygon.
*/
-_ol_format_KML_.readLinearRing_ = function(node, objectStack) {
+KML.readLinearRing_ = function(node, objectStack) {
var properties = _ol_xml_.pushParseAndPop({},
- _ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
+ KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
var flatCoordinates =
- _ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
+ KML.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var polygon = new Polygon(null);
polygon.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates,
@@ -904,9 +899,9 @@ _ol_format_KML_.readLinearRing_ = function(node, objectStack) {
* @private
* @return {ol.geom.Geometry} Geometry.
*/
-_ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
+KML.readMultiGeometry_ = function(node, objectStack) {
var geometries = _ol_xml_.pushParseAndPop([],
- _ol_format_KML_.MULTI_GEOMETRY_PARSERS_, node, objectStack);
+ KML.MULTI_GEOMETRY_PARSERS_, node, objectStack);
if (!geometries) {
return null;
}
@@ -938,15 +933,15 @@ _ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
}
multiGeometry = new MultiPoint(null);
multiGeometry.setFlatCoordinates(layout, flatCoordinates);
- _ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
+ KML.setCommonGeometryProperties_(multiGeometry, geometries);
} else if (type == GeometryType.LINE_STRING) {
multiGeometry = new MultiLineString(null);
multiGeometry.setLineStrings(geometries);
- _ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
+ KML.setCommonGeometryProperties_(multiGeometry, geometries);
} else if (type == GeometryType.POLYGON) {
multiGeometry = new MultiPolygon(null);
multiGeometry.setPolygons(geometries);
- _ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
+ KML.setCommonGeometryProperties_(multiGeometry, geometries);
} else if (type == GeometryType.GEOMETRY_COLLECTION) {
multiGeometry = new GeometryCollection(geometries);
} else {
@@ -965,12 +960,12 @@ _ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
* @private
* @return {ol.geom.Point|undefined} Point.
*/
-_ol_format_KML_.readPoint_ = function(node, objectStack) {
+KML.readPoint_ = function(node, objectStack) {
var properties = _ol_xml_.pushParseAndPop({},
- _ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
+ KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
var flatCoordinates =
- _ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
+ KML.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var point = new Point(null);
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
@@ -988,12 +983,12 @@ _ol_format_KML_.readPoint_ = function(node, objectStack) {
* @private
* @return {ol.geom.Polygon|undefined} Polygon.
*/
-_ol_format_KML_.readPolygon_ = function(node, objectStack) {
+KML.readPolygon_ = function(node, objectStack) {
var properties = _ol_xml_.pushParseAndPop(/** @type {Object} */ ({}),
- _ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
+ KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
var flatLinearRings = _ol_xml_.pushParseAndPop([null],
- _ol_format_KML_.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack);
+ KML.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack);
if (flatLinearRings && flatLinearRings[0]) {
var polygon = new Polygon(null);
var flatCoordinates = flatLinearRings[0];
@@ -1019,31 +1014,31 @@ _ol_format_KML_.readPolygon_ = function(node, objectStack) {
* @private
* @return {Array.} Style.
*/
-_ol_format_KML_.readStyle_ = function(node, objectStack) {
+KML.readStyle_ = function(node, objectStack) {
var styleObject = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.STYLE_PARSERS_, node, objectStack);
+ {}, KML.STYLE_PARSERS_, node, objectStack);
if (!styleObject) {
return null;
}
var fillStyle = /** @type {ol.style.Fill} */
('fillStyle' in styleObject ?
- styleObject['fillStyle'] : _ol_format_KML_.DEFAULT_FILL_STYLE_);
+ styleObject['fillStyle'] : KML.DEFAULT_FILL_STYLE_);
var fill = /** @type {boolean|undefined} */ (styleObject['fill']);
if (fill !== undefined && !fill) {
fillStyle = null;
}
var imageStyle = /** @type {ol.style.Image} */
('imageStyle' in styleObject ?
- styleObject['imageStyle'] : _ol_format_KML_.DEFAULT_IMAGE_STYLE_);
- if (imageStyle == _ol_format_KML_.DEFAULT_NO_IMAGE_STYLE_) {
+ styleObject['imageStyle'] : KML.DEFAULT_IMAGE_STYLE_);
+ if (imageStyle == KML.DEFAULT_NO_IMAGE_STYLE_) {
imageStyle = undefined;
}
var textStyle = /** @type {ol.style.Text} */
('textStyle' in styleObject ?
- styleObject['textStyle'] : _ol_format_KML_.DEFAULT_TEXT_STYLE_);
+ styleObject['textStyle'] : KML.DEFAULT_TEXT_STYLE_);
var strokeStyle = /** @type {ol.style.Stroke} */
('strokeStyle' in styleObject ?
- styleObject['strokeStyle'] : _ol_format_KML_.DEFAULT_STROKE_STYLE_);
+ styleObject['strokeStyle'] : KML.DEFAULT_STROKE_STYLE_);
var outline = /** @type {boolean|undefined} */
(styleObject['outline']);
if (outline !== undefined && !outline) {
@@ -1067,7 +1062,7 @@ _ol_format_KML_.readStyle_ = function(node, objectStack) {
* @param {Array.} geometries List of geometries.
* @private
*/
-_ol_format_KML_.setCommonGeometryProperties_ = function(multiGeometry,
+KML.setCommonGeometryProperties_ = function(multiGeometry,
geometries) {
var ii = geometries.length;
var extrudes = new Array(geometries.length);
@@ -1101,9 +1096,9 @@ _ol_format_KML_.setCommonGeometryProperties_ = function(multiGeometry,
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.DataParser_ = function(node, objectStack) {
+KML.DataParser_ = function(node, objectStack) {
var name = node.getAttribute('name');
- _ol_xml_.parseNode(_ol_format_KML_.DATA_PARSERS_, node, objectStack);
+ _ol_xml_.parseNode(KML.DATA_PARSERS_, node, objectStack);
var featureObject = /** @type {Object} */ (objectStack[objectStack.length - 1]);
if (name !== null) {
featureObject[name] = featureObject.value;
@@ -1119,8 +1114,8 @@ _ol_format_KML_.DataParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.ExtendedDataParser_ = function(node, objectStack) {
- _ol_xml_.parseNode(_ol_format_KML_.EXTENDED_DATA_PARSERS_, node, objectStack);
+KML.ExtendedDataParser_ = function(node, objectStack) {
+ _ol_xml_.parseNode(KML.EXTENDED_DATA_PARSERS_, node, objectStack);
};
/**
@@ -1128,8 +1123,8 @@ _ol_format_KML_.ExtendedDataParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.RegionParser_ = function(node, objectStack) {
- _ol_xml_.parseNode(_ol_format_KML_.REGION_PARSERS_, node, objectStack);
+KML.RegionParser_ = function(node, objectStack) {
+ _ol_xml_.parseNode(KML.REGION_PARSERS_, node, objectStack);
};
/**
@@ -1137,9 +1132,9 @@ _ol_format_KML_.RegionParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.PairDataParser_ = function(node, objectStack) {
+KML.PairDataParser_ = function(node, objectStack) {
var pairObject = _ol_xml_.pushParseAndPop(
- {}, _ol_format_KML_.PAIR_PARSERS_, node, objectStack);
+ {}, KML.PAIR_PARSERS_, node, objectStack);
if (!pairObject) {
return;
}
@@ -1165,8 +1160,8 @@ _ol_format_KML_.PairDataParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.PlacemarkStyleMapParser_ = function(node, objectStack) {
- var styleMapValue = _ol_format_KML_.readStyleMapValue_(node, objectStack);
+KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
+ var styleMapValue = KML.readStyleMapValue_(node, objectStack);
if (!styleMapValue) {
return;
}
@@ -1186,8 +1181,8 @@ _ol_format_KML_.PlacemarkStyleMapParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.SchemaDataParser_ = function(node, objectStack) {
- _ol_xml_.parseNode(_ol_format_KML_.SCHEMA_DATA_PARSERS_, node, objectStack);
+KML.SchemaDataParser_ = function(node, objectStack) {
+ _ol_xml_.parseNode(KML.SCHEMA_DATA_PARSERS_, node, objectStack);
};
@@ -1196,10 +1191,10 @@ _ol_format_KML_.SchemaDataParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.SimpleDataParser_ = function(node, objectStack) {
+KML.SimpleDataParser_ = function(node, objectStack) {
var name = node.getAttribute('name');
if (name !== null) {
- var data = _ol_format_XSD_.readString(node);
+ var data = XSD.readString(node);
var featureObject =
/** @type {Object} */ (objectStack[objectStack.length - 1]);
featureObject[name] = data;
@@ -1212,8 +1207,8 @@ _ol_format_KML_.SimpleDataParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.LatLonAltBoxParser_ = function(node, objectStack) {
- var object = _ol_xml_.pushParseAndPop({}, _ol_format_KML_.LAT_LON_ALT_BOX_PARSERS_, node, objectStack);
+KML.LatLonAltBoxParser_ = function(node, objectStack) {
+ var object = _ol_xml_.pushParseAndPop({}, KML.LAT_LON_ALT_BOX_PARSERS_, node, objectStack);
if (!object) {
return;
}
@@ -1236,8 +1231,8 @@ _ol_format_KML_.LatLonAltBoxParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.LodParser_ = function(node, objectStack) {
- var object = _ol_xml_.pushParseAndPop({}, _ol_format_KML_.LOD_PARSERS_, node, objectStack);
+KML.LodParser_ = function(node, objectStack) {
+ var object = _ol_xml_.pushParseAndPop({}, KML.LOD_PARSERS_, node, objectStack);
if (!object) {
return;
}
@@ -1254,10 +1249,10 @@ _ol_format_KML_.LodParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.innerBoundaryIsParser_ = function(node, objectStack) {
+KML.innerBoundaryIsParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
- _ol_format_KML_.INNER_BOUNDARY_IS_PARSERS_, node, objectStack);
+ KML.INNER_BOUNDARY_IS_PARSERS_, node, objectStack);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.>} */
(objectStack[objectStack.length - 1]);
@@ -1271,10 +1266,10 @@ _ol_format_KML_.innerBoundaryIsParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.outerBoundaryIsParser_ = function(node, objectStack) {
+KML.outerBoundaryIsParser_ = function(node, objectStack) {
/** @type {Array.|undefined} */
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
- _ol_format_KML_.OUTER_BOUNDARY_IS_PARSERS_, node, objectStack);
+ KML.OUTER_BOUNDARY_IS_PARSERS_, node, objectStack);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.>} */
(objectStack[objectStack.length - 1]);
@@ -1288,8 +1283,8 @@ _ol_format_KML_.outerBoundaryIsParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.LinkParser_ = function(node, objectStack) {
- _ol_xml_.parseNode(_ol_format_KML_.LINK_PARSERS_, node, objectStack);
+KML.LinkParser_ = function(node, objectStack) {
+ _ol_xml_.parseNode(KML.LINK_PARSERS_, node, objectStack);
};
@@ -1298,7 +1293,7 @@ _ol_format_KML_.LinkParser_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.whenParser_ = function(node, objectStack) {
+KML.whenParser_ = function(node, objectStack) {
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]);
var whens = gxTrackObject.whens;
@@ -1313,10 +1308,10 @@ _ol_format_KML_.whenParser_ = function(node, objectStack) {
* @type {Object.>}
* @private
*/
-_ol_format_KML_.DATA_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'displayName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'value': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString)
+KML.DATA_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'displayName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'value': _ol_xml_.makeObjectPropertySetter(XSD.readString)
});
@@ -1325,10 +1320,10 @@ _ol_format_KML_.DATA_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.EXTENDED_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'Data': _ol_format_KML_.DataParser_,
- 'SchemaData': _ol_format_KML_.SchemaDataParser_
+KML.EXTENDED_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'Data': KML.DataParser_,
+ 'SchemaData': KML.SchemaDataParser_
});
@@ -1337,10 +1332,10 @@ _ol_format_KML_.EXTENDED_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.REGION_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'LatLonAltBox': _ol_format_KML_.LatLonAltBoxParser_,
- 'Lod': _ol_format_KML_.LodParser_
+KML.REGION_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'LatLonAltBox': KML.LatLonAltBoxParser_,
+ 'Lod': KML.LodParser_
});
@@ -1349,15 +1344,15 @@ _ol_format_KML_.REGION_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'altitudeMode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'minAltitude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'maxAltitude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'north': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'south': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'east': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'west': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal)
+KML.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'altitudeMode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'minAltitude': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'maxAltitude': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'north': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'south': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'east': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'west': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
});
@@ -1366,12 +1361,12 @@ _ol_format_KML_.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.LOD_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'minLodPixels': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'maxLodPixels': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'minFadeExtent': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'maxFadeExtent': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal)
+KML.LOD_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'minLodPixels': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'maxLodPixels': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'minFadeExtent': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'maxFadeExtent': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
});
@@ -1380,11 +1375,11 @@ _ol_format_KML_.LOD_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'extrude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean),
- 'tessellate': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean),
- 'altitudeMode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString)
+KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'extrude': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
+ 'tessellate': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
+ 'altitudeMode': _ol_xml_.makeObjectPropertySetter(XSD.readString)
});
@@ -1393,9 +1388,9 @@ _ol_format_KML_.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.FLAT_LINEAR_RING_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'coordinates': _ol_xml_.makeReplacer(_ol_format_KML_.readFlatCoordinates_)
+KML.FLAT_LINEAR_RING_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'coordinates': _ol_xml_.makeReplacer(KML.readFlatCoordinates_)
});
@@ -1404,10 +1399,10 @@ _ol_format_KML_.FLAT_LINEAR_RING_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.FLAT_LINEAR_RINGS_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'innerBoundaryIs': _ol_format_KML_.innerBoundaryIsParser_,
- 'outerBoundaryIs': _ol_format_KML_.outerBoundaryIsParser_
+KML.FLAT_LINEAR_RINGS_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'innerBoundaryIs': KML.innerBoundaryIsParser_,
+ 'outerBoundaryIs': KML.outerBoundaryIsParser_
});
@@ -1416,12 +1411,12 @@ _ol_format_KML_.FLAT_LINEAR_RINGS_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.GX_TRACK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'when': _ol_format_KML_.whenParser_
+KML.GX_TRACK_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'when': KML.whenParser_
}, _ol_xml_.makeStructureNS(
- _ol_format_KML_.GX_NAMESPACE_URIS_, {
- 'coord': _ol_format_KML_.gxCoordParser_
+ KML.GX_NAMESPACE_URIS_, {
+ 'coord': KML.gxCoordParser_
}));
@@ -1430,9 +1425,9 @@ _ol_format_KML_.GX_TRACK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.GEOMETRY_FLAT_COORDINATES_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'coordinates': _ol_xml_.makeReplacer(_ol_format_KML_.readFlatCoordinates_)
+KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'coordinates': _ol_xml_.makeReplacer(KML.readFlatCoordinates_)
});
@@ -1441,15 +1436,15 @@ _ol_format_KML_.GEOMETRY_FLAT_COORDINATES_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.ICON_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'href': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readURI_)
+KML.ICON_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'href': _ol_xml_.makeObjectPropertySetter(KML.readURI_)
}, _ol_xml_.makeStructureNS(
- _ol_format_KML_.GX_NAMESPACE_URIS_, {
- 'x': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'y': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'w': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'h': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal)
+ KML.GX_NAMESPACE_URIS_, {
+ 'x': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'y': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'w': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'h': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
}));
@@ -1458,12 +1453,12 @@ _ol_format_KML_.ICON_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.ICON_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'Icon': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readIcon_),
- 'heading': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
- 'hotSpot': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readVec2_),
- 'scale': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readScale_)
+KML.ICON_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'Icon': _ol_xml_.makeObjectPropertySetter(KML.readIcon_),
+ 'heading': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
+ 'hotSpot': _ol_xml_.makeObjectPropertySetter(KML.readVec2_),
+ 'scale': _ol_xml_.makeObjectPropertySetter(KML.readScale_)
});
@@ -1472,9 +1467,9 @@ _ol_format_KML_.ICON_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.INNER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'LinearRing': _ol_xml_.makeReplacer(_ol_format_KML_.readFlatLinearRing_)
+KML.INNER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'LinearRing': _ol_xml_.makeReplacer(KML.readFlatLinearRing_)
});
@@ -1483,10 +1478,10 @@ _ol_format_KML_.INNER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.LABEL_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'color': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readColor_),
- 'scale': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readScale_)
+KML.LABEL_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_),
+ 'scale': _ol_xml_.makeObjectPropertySetter(KML.readScale_)
});
@@ -1495,10 +1490,10 @@ _ol_format_KML_.LABEL_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.LINE_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'color': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readColor_),
- 'width': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal)
+KML.LINE_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_),
+ 'width': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
});
@@ -1507,13 +1502,13 @@ _ol_format_KML_.LINE_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.MULTI_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'LineString': _ol_xml_.makeArrayPusher(_ol_format_KML_.readLineString_),
- 'LinearRing': _ol_xml_.makeArrayPusher(_ol_format_KML_.readLinearRing_),
- 'MultiGeometry': _ol_xml_.makeArrayPusher(_ol_format_KML_.readMultiGeometry_),
- 'Point': _ol_xml_.makeArrayPusher(_ol_format_KML_.readPoint_),
- 'Polygon': _ol_xml_.makeArrayPusher(_ol_format_KML_.readPolygon_)
+KML.MULTI_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'LineString': _ol_xml_.makeArrayPusher(KML.readLineString_),
+ 'LinearRing': _ol_xml_.makeArrayPusher(KML.readLinearRing_),
+ 'MultiGeometry': _ol_xml_.makeArrayPusher(KML.readMultiGeometry_),
+ 'Point': _ol_xml_.makeArrayPusher(KML.readPoint_),
+ 'Polygon': _ol_xml_.makeArrayPusher(KML.readPolygon_)
});
@@ -1522,9 +1517,9 @@ _ol_format_KML_.MULTI_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.GX_MULTITRACK_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.GX_NAMESPACE_URIS_, {
- 'Track': _ol_xml_.makeArrayPusher(_ol_format_KML_.readGxTrack_)
+KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.GX_NAMESPACE_URIS_, {
+ 'Track': _ol_xml_.makeArrayPusher(KML.readGxTrack_)
});
@@ -1533,17 +1528,17 @@ _ol_format_KML_.GX_MULTITRACK_GEOMETRY_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.NETWORK_LINK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'ExtendedData': _ol_format_KML_.ExtendedDataParser_,
- 'Region': _ol_format_KML_.RegionParser_,
- 'Link': _ol_format_KML_.LinkParser_,
- 'address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'description': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'open': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean),
- 'phoneNumber': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'visibility': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean)
+KML.NETWORK_LINK_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'ExtendedData': KML.ExtendedDataParser_,
+ 'Region': KML.RegionParser_,
+ 'Link': KML.LinkParser_,
+ 'address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'description': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'open': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
+ 'phoneNumber': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'visibility': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
});
@@ -1552,9 +1547,9 @@ _ol_format_KML_.NETWORK_LINK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'href': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readURI_)
+KML.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'href': _ol_xml_.makeObjectPropertySetter(KML.readURI_)
});
@@ -1563,9 +1558,9 @@ _ol_format_KML_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.OUTER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'LinearRing': _ol_xml_.makeReplacer(_ol_format_KML_.readFlatLinearRing_)
+KML.OUTER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'LinearRing': _ol_xml_.makeReplacer(KML.readFlatLinearRing_)
});
@@ -1574,11 +1569,11 @@ _ol_format_KML_.OUTER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.PAIR_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'Style': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readStyle_),
- 'key': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'styleUrl': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readURI_)
+KML.PAIR_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_),
+ 'key': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_)
});
@@ -1587,35 +1582,35 @@ _ol_format_KML_.PAIR_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.PLACEMARK_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'ExtendedData': _ol_format_KML_.ExtendedDataParser_,
- 'Region': _ol_format_KML_.RegionParser_,
+KML.PLACEMARK_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'ExtendedData': KML.ExtendedDataParser_,
+ 'Region': KML.RegionParser_,
'MultiGeometry': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readMultiGeometry_, 'geometry'),
+ KML.readMultiGeometry_, 'geometry'),
'LineString': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readLineString_, 'geometry'),
+ KML.readLineString_, 'geometry'),
'LinearRing': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readLinearRing_, 'geometry'),
+ KML.readLinearRing_, 'geometry'),
'Point': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readPoint_, 'geometry'),
+ KML.readPoint_, 'geometry'),
'Polygon': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readPolygon_, 'geometry'),
- 'Style': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readStyle_),
- 'StyleMap': _ol_format_KML_.PlacemarkStyleMapParser_,
- 'address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'description': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'open': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean),
- 'phoneNumber': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
- 'styleUrl': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readURI_),
- 'visibility': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean)
+ KML.readPolygon_, 'geometry'),
+ 'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_),
+ 'StyleMap': KML.PlacemarkStyleMapParser_,
+ 'address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'description': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'open': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
+ 'phoneNumber': _ol_xml_.makeObjectPropertySetter(XSD.readString),
+ 'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_),
+ 'visibility': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
}, _ol_xml_.makeStructureNS(
- _ol_format_KML_.GX_NAMESPACE_URIS_, {
+ KML.GX_NAMESPACE_URIS_, {
'MultiTrack': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readGxMultiTrack_, 'geometry'),
+ KML.readGxMultiTrack_, 'geometry'),
'Track': _ol_xml_.makeObjectPropertySetter(
- _ol_format_KML_.readGxTrack_, 'geometry')
+ KML.readGxTrack_, 'geometry')
}
));
@@ -1625,11 +1620,11 @@ _ol_format_KML_.PLACEMARK_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.POLY_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'color': _ol_xml_.makeObjectPropertySetter(_ol_format_KML_.readColor_),
- 'fill': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean),
- 'outline': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean)
+KML.POLY_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_),
+ 'fill': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
+ 'outline': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
});
@@ -1638,9 +1633,9 @@ _ol_format_KML_.POLY_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.SCHEMA_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'SimpleData': _ol_format_KML_.SimpleDataParser_
+KML.SCHEMA_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'SimpleData': KML.SimpleDataParser_
});
@@ -1649,12 +1644,12 @@ _ol_format_KML_.SCHEMA_DATA_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'IconStyle': _ol_format_KML_.IconStyleParser_,
- 'LabelStyle': _ol_format_KML_.LabelStyleParser_,
- 'LineStyle': _ol_format_KML_.LineStyleParser_,
- 'PolyStyle': _ol_format_KML_.PolyStyleParser_
+KML.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'IconStyle': KML.IconStyleParser_,
+ 'LabelStyle': KML.LabelStyleParser_,
+ 'LineStyle': KML.LineStyleParser_,
+ 'PolyStyle': KML.PolyStyleParser_
});
@@ -1663,9 +1658,9 @@ _ol_format_KML_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
* @type {Object.>}
* @private
*/
-_ol_format_KML_.STYLE_MAP_PARSERS_ = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
- 'Pair': _ol_format_KML_.PairDataParser_
+KML.STYLE_MAP_PARSERS_ = _ol_xml_.makeStructureNS(
+ KML.NAMESPACE_URIS_, {
+ 'Pair': KML.PairDataParser_
});
@@ -1675,10 +1670,10 @@ _ol_format_KML_.STYLE_MAP_PARSERS_ = _ol_xml_.makeStructureNS(
* @private
* @return {Array.|undefined} Features.
*/
-_ol_format_KML_.prototype.readDocumentOrFolder_ = function(node, objectStack) {
+KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
// FIXME use scope somehow
var parsersNS = _ol_xml_.makeStructureNS(
- _ol_format_KML_.NAMESPACE_URIS_, {
+ KML.NAMESPACE_URIS_, {
'Document': _ol_xml_.makeArrayExtender(this.readDocumentOrFolder_, this),
'Folder': _ol_xml_.makeArrayExtender(this.readDocumentOrFolder_, this),
'Placemark': _ol_xml_.makeArrayPusher(this.readPlacemark_, this),
@@ -1701,9 +1696,9 @@ _ol_format_KML_.prototype.readDocumentOrFolder_ = function(node, objectStack) {
* @private
* @return {ol.Feature|undefined} Feature.
*/
-_ol_format_KML_.prototype.readPlacemark_ = function(node, objectStack) {
+KML.prototype.readPlacemark_ = function(node, objectStack) {
var object = _ol_xml_.pushParseAndPop({'geometry': null},
- _ol_format_KML_.PLACEMARK_PARSERS_, node, objectStack);
+ KML.PLACEMARK_PARSERS_, node, objectStack);
if (!object) {
return undefined;
}
@@ -1716,7 +1711,7 @@ _ol_format_KML_.prototype.readPlacemark_ = function(node, objectStack) {
var geometry = object['geometry'];
if (geometry) {
- _ol_format_Feature_.transformWithOptions(geometry, false, options);
+ FeatureFormat.transformWithOptions(geometry, false, options);
}
feature.setGeometry(geometry);
delete object['geometry'];
@@ -1724,7 +1719,7 @@ _ol_format_KML_.prototype.readPlacemark_ = function(node, objectStack) {
if (this.extractStyles_) {
var style = object['Style'];
var styleUrl = object['styleUrl'];
- var styleFunction = _ol_format_KML_.createFeatureStyleFunction_(
+ var styleFunction = KML.createFeatureStyleFunction_(
style, styleUrl, this.defaultStyle_, this.sharedStyles_,
this.showPointNames_);
feature.setStyle(styleFunction);
@@ -1744,10 +1739,10 @@ _ol_format_KML_.prototype.readPlacemark_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.prototype.readSharedStyle_ = function(node, objectStack) {
+KML.prototype.readSharedStyle_ = function(node, objectStack) {
var id = node.getAttribute('id');
if (id !== null) {
- var style = _ol_format_KML_.readStyle_(node, objectStack);
+ var style = KML.readStyle_(node, objectStack);
if (style) {
var styleUri;
var baseURI = node.baseURI;
@@ -1771,12 +1766,12 @@ _ol_format_KML_.prototype.readSharedStyle_ = function(node, objectStack) {
* @param {Array.<*>} objectStack Object stack.
* @private
*/
-_ol_format_KML_.prototype.readSharedStyleMap_ = function(node, objectStack) {
+KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
var id = node.getAttribute('id');
if (id === null) {
return;
}
- var styleMapValue = _ol_format_KML_.readStyleMapValue_(node, objectStack);
+ var styleMapValue = KML.readStyleMapValue_(node, objectStack);
if (!styleMapValue) {
return;
}
@@ -1806,14 +1801,14 @@ _ol_format_KML_.prototype.readSharedStyleMap_ = function(node, objectStack) {
* @return {ol.Feature} Feature.
* @api
*/
-_ol_format_KML_.prototype.readFeature;
+KML.prototype.readFeature;
/**
* @inheritDoc
*/
-_ol_format_KML_.prototype.readFeatureFromNode = function(node, opt_options) {
- if (!_ol_array_.includes(_ol_format_KML_.NAMESPACE_URIS_, node.namespaceURI)) {
+KML.prototype.readFeatureFromNode = function(node, opt_options) {
+ if (!_ol_array_.includes(KML.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
}
var feature = this.readPlacemark_(
@@ -1837,14 +1832,14 @@ _ol_format_KML_.prototype.readFeatureFromNode = function(node, opt_options) {
* @return {Array.} Features.
* @api
*/
-_ol_format_KML_.prototype.readFeatures;
+KML.prototype.readFeatures;
/**
* @inheritDoc
*/
-_ol_format_KML_.prototype.readFeaturesFromNode = function(node, opt_options) {
- if (!_ol_array_.includes(_ol_format_KML_.NAMESPACE_URIS_, node.namespaceURI)) {
+KML.prototype.readFeaturesFromNode = function(node, opt_options) {
+ if (!_ol_array_.includes(KML.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
}
var features;
@@ -1888,7 +1883,7 @@ _ol_format_KML_.prototype.readFeaturesFromNode = function(node, opt_options) {
* @return {string|undefined} Name.
* @api
*/
-_ol_format_KML_.prototype.readName = function(source) {
+KML.prototype.readName = function(source) {
if (_ol_xml_.isDocument(source)) {
return this.readNameFromDocument(/** @type {Document} */ (source));
} else if (_ol_xml_.isNode(source)) {
@@ -1906,7 +1901,7 @@ _ol_format_KML_.prototype.readName = function(source) {
* @param {Document} doc Document.
* @return {string|undefined} Name.
*/
-_ol_format_KML_.prototype.readNameFromDocument = function(doc) {
+KML.prototype.readNameFromDocument = function(doc) {
var n;
for (n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
@@ -1924,17 +1919,17 @@ _ol_format_KML_.prototype.readNameFromDocument = function(doc) {
* @param {Node} node Node.
* @return {string|undefined} Name.
*/
-_ol_format_KML_.prototype.readNameFromNode = function(node) {
+KML.prototype.readNameFromNode = function(node) {
var n;
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
- if (_ol_array_.includes(_ol_format_KML_.NAMESPACE_URIS_, n.namespaceURI) &&
+ if (_ol_array_.includes(KML.NAMESPACE_URIS_, n.namespaceURI) &&
n.localName == 'name') {
- return _ol_format_XSD_.readString(n);
+ return XSD.readString(n);
}
}
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
var localName = n.localName;
- if (_ol_array_.includes(_ol_format_KML_.NAMESPACE_URIS_, n.namespaceURI) &&
+ if (_ol_array_.includes(KML.NAMESPACE_URIS_, n.namespaceURI) &&
(localName == 'Document' ||
localName == 'Folder' ||
localName == 'Placemark' ||
@@ -1956,7 +1951,7 @@ _ol_format_KML_.prototype.readNameFromNode = function(node) {
* @return {Array.