GPX Format - Adding the mandatory creator attribute

This commit is contained in:
Pierre GIRAUD
2012-02-15 11:58:52 +01:00
parent cb65b69556
commit 6608f5fd94
2 changed files with 14 additions and 6 deletions

View File

@@ -71,6 +71,13 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
* "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
*/
schemaLocation: "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",
/**
* Property: creator
* {String} The creator attribute to be added to the written GPX files.
* Defaults to "OpenLayers"
*/
creator: "OpenLayers",
/**
* Constructor: OpenLayers.Format.GPX
@@ -220,6 +227,7 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
features : [features];
var gpx = this.createElementNS(this.namespaces.gpx, "gpx");
gpx.setAttribute("version", "1.1");
gpx.setAttribute("creator", this.creator);
this.setAttributes(gpx, {
"xsi:schemaLocation": this.schemaLocation
});