set a default EPSG:4326 externalProjection to the KML, OSM and GPX formats. r=pgiraud (closes #2424)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9975 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2010-01-27 14:36:46 +00:00
parent c1f9945838
commit e5aab2453d
6 changed files with 21 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Projection.js
*/
/**
@@ -53,6 +54,9 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
* this instance.
*/
initialize: function(options) {
// GPX coordinates are always in longlat WGS84
this.externalProjection = new OpenLayers.Projection("EPSG:4326");
OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
},

View File

@@ -11,6 +11,7 @@
* @requires OpenLayers/Geometry/Collection.js
* @requires OpenLayers/Request/XMLHttpRequest.js
* @requires OpenLayers/Console.js
* @requires OpenLayers/Projection.js
*/
/**
@@ -122,6 +123,9 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
kmlIconPalette: (/root:\/\/icons\/palette-(\d+)(\.\w+)/),
straightBracket: (/\$\[(.*?)\]/g)
};
// KML coordinates are always in longlat WGS84
this.externalProjection = new OpenLayers.Projection("EPSG:4326");
OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
},

View File

@@ -8,6 +8,7 @@
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/Polygon.js
* @requires OpenLayers/Projection.js
*/
/**
@@ -73,6 +74,9 @@ OpenLayers.Format.OSM = OpenLayers.Class(OpenLayers.Format.XML, {
area[layer_defaults.areaTags[i]] = true;
}
layer_defaults.areaTags = area;
// OSM coordinates are always in longlat WGS84
this.externalProjection = new OpenLayers.Projection("EPSG:4326");
OpenLayers.Format.XML.prototype.initialize.apply(this, [layer_defaults]);
},