GPX Format - Adding the mandatory creator attribute
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user