Deprecating all prototype extensions. This puts all OpenLayers functionality in the OpenLayers namespace. If you are using any of the Function, String, or Number prototype extensions, start using the functional equivalents in the OpenLayers namespace - the prototype extensions will be gone in 3.0 (closes #712).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4302 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -208,7 +208,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
* @private
|
||||
*/
|
||||
'point': function(str) {
|
||||
var coords = str.trim().split(this.regExes.spaces);
|
||||
var coords = OpenLayers.String.trim(str).split(this.regExes.spaces);
|
||||
return new OpenLayers.Feature.Vector(
|
||||
new OpenLayers.Geometry.Point(coords[0], coords[1])
|
||||
);
|
||||
@@ -221,7 +221,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
* @private
|
||||
*/
|
||||
'multipoint': function(str) {
|
||||
var points = str.trim().split(',');
|
||||
var points = OpenLayers.String.trim(str).split(',');
|
||||
var components = [];
|
||||
for(var i=0; i<points.length; ++i) {
|
||||
components.push(this.parse.point.apply(this, [points[i]]).geometry);
|
||||
@@ -238,7 +238,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
* @private
|
||||
*/
|
||||
'linestring': function(str) {
|
||||
var points = str.trim().split(',');
|
||||
var points = OpenLayers.String.trim(str).split(',');
|
||||
var components = [];
|
||||
for(var i=0; i<points.length; ++i) {
|
||||
components.push(this.parse.point.apply(this, [points[i]]).geometry);
|
||||
@@ -256,7 +256,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
*/
|
||||
'multilinestring': function(str) {
|
||||
var line;
|
||||
var lines = str.trim().split(this.regExes.parenComma);
|
||||
var lines = OpenLayers.String.trim(str).split(this.regExes.parenComma);
|
||||
var components = [];
|
||||
for(var i=0; i<lines.length; ++i) {
|
||||
line = lines[i].replace(this.regExes.trimParens, '$1');
|
||||
@@ -275,7 +275,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
*/
|
||||
'polygon': function(str) {
|
||||
var ring, linestring, linearring;
|
||||
var rings = str.trim().split(this.regExes.parenComma);
|
||||
var rings = OpenLayers.String.trim(str).split(this.regExes.parenComma);
|
||||
var components = [];
|
||||
for(var i=0; i<rings.length; ++i) {
|
||||
ring = rings[i].replace(this.regExes.trimParens, '$1');
|
||||
@@ -296,7 +296,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
*/
|
||||
'multipolygon': function(str) {
|
||||
var polygon;
|
||||
var polygons = str.trim().split(this.regExes.doubleParenComma);
|
||||
var polygons = OpenLayers.String.trim(str).split(this.regExes.doubleParenComma);
|
||||
var components = [];
|
||||
for(var i=0; i<polygons.length; ++i) {
|
||||
polygon = polygons[i].replace(this.regExes.trimParens, '$1');
|
||||
@@ -316,7 +316,7 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
|
||||
'geometrycollection': function(str) {
|
||||
// separate components of the collection with |
|
||||
str = str.replace(/,\s*([A-Za-z])/g, '|$1');
|
||||
var wktArray = str.trim().split('|');
|
||||
var wktArray = OpenLayers.String.trim(str).split('|');
|
||||
var components = [];
|
||||
for(var i=0; i<wktArray.length; ++i) {
|
||||
components.push(OpenLayers.Format.WKT.prototype.read.apply(this,[wktArray[i]]));
|
||||
|
||||
@@ -60,21 +60,23 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
|
||||
text = text.substring(index);
|
||||
}
|
||||
var node = OpenLayers.Util.Try(
|
||||
(function() {
|
||||
var xmldom;
|
||||
/**
|
||||
* Since we want to be able to call this method on the prototype
|
||||
* itself, this.xmldom may not exist even if in IE.
|
||||
*/
|
||||
if(window.ActiveXObject && !this.xmldom) {
|
||||
xmldom = new ActiveXObject("Microsoft.XMLDOM");
|
||||
} else {
|
||||
xmldom = this.xmldom;
|
||||
|
||||
OpenLayers.Function.bind((
|
||||
function() {
|
||||
var xmldom;
|
||||
/**
|
||||
* Since we want to be able to call this method on the prototype
|
||||
* itself, this.xmldom may not exist even if in IE.
|
||||
*/
|
||||
if(window.ActiveXObject && !this.xmldom) {
|
||||
xmldom = new ActiveXObject("Microsoft.XMLDOM");
|
||||
} else {
|
||||
xmldom = this.xmldom;
|
||||
|
||||
}
|
||||
xmldom.loadXML(text);
|
||||
return xmldom;
|
||||
}
|
||||
xmldom.loadXML(text);
|
||||
return xmldom;
|
||||
}).bind(this),
|
||||
), this),
|
||||
function() {
|
||||
return new DOMParser().parseFromString(text, 'text/xml');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user