Remove goog.dom
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false",
|
"goog.DEBUG=false",
|
||||||
"ol.ENABLE_DOM=false",
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
goog.provide('ol.control.Attribution');
|
goog.provide('ol.control.Attribution');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
|
goog.require('ol.dom');
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
goog.require('ol.css');
|
goog.require('ol.css');
|
||||||
@@ -68,30 +68,37 @@ ol.control.Attribution = function(opt_options) {
|
|||||||
|
|
||||||
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
|
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
|
||||||
|
|
||||||
/**
|
if (typeof collapseLabel === 'string') {
|
||||||
* @private
|
/**
|
||||||
* @type {Node}
|
* @private
|
||||||
*/
|
* @type {Node}
|
||||||
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
*/
|
||||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
this.collapseLabel_ = document.createElement('span');
|
||||||
collapseLabel;
|
this.collapseLabel_.textContent = collapseLabel;
|
||||||
|
} else {
|
||||||
|
this.collapseLabel_ = collapseLabel;
|
||||||
|
}
|
||||||
|
|
||||||
var label = options.label !== undefined ? options.label : 'i';
|
var label = options.label !== undefined ? options.label : 'i';
|
||||||
|
|
||||||
/**
|
if (typeof label === 'string') {
|
||||||
* @private
|
/**
|
||||||
* @type {Node}
|
* @private
|
||||||
*/
|
* @type {Node}
|
||||||
this.label_ = typeof label === 'string' ?
|
*/
|
||||||
goog.dom.createDom('SPAN', {}, label) :
|
this.label_ = document.createElement('span');
|
||||||
label;
|
this.label_.textContent = label;
|
||||||
|
} else {
|
||||||
|
this.label_ = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
||||||
this.collapseLabel_ : this.label_;
|
this.collapseLabel_ : this.label_;
|
||||||
var button = goog.dom.createDom('BUTTON', {
|
var button = document.createElement('button');
|
||||||
'type': 'button',
|
button.setAttribute('type', 'button');
|
||||||
'title': tipLabel
|
button.title = tipLabel;
|
||||||
}, activeLabel);
|
button.appendChild(activeLabel);
|
||||||
|
|
||||||
ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this);
|
ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this);
|
||||||
|
|
||||||
@@ -99,8 +106,10 @@ ol.control.Attribution = function(opt_options) {
|
|||||||
ol.css.CLASS_CONTROL +
|
ol.css.CLASS_CONTROL +
|
||||||
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
||||||
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
||||||
var element = goog.dom.createDom('DIV',
|
var element = document.createElement('div');
|
||||||
cssClasses, this.ulElement_, button);
|
element.className = cssClasses;
|
||||||
|
element.appendChild(this.ulElement_);
|
||||||
|
element.appendChild(button);
|
||||||
|
|
||||||
var render = options.render ? options.render : ol.control.Attribution.render;
|
var render = options.render ? options.render : ol.control.Attribution.render;
|
||||||
|
|
||||||
@@ -240,7 +249,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
|||||||
}
|
}
|
||||||
delete hiddenAttributions[attributionKey];
|
delete hiddenAttributions[attributionKey];
|
||||||
} else {
|
} else {
|
||||||
goog.dom.removeNode(this.attributionElements_[attributionKey]);
|
ol.dom.removeNode(this.attributionElements_[attributionKey]);
|
||||||
delete this.attributionElements_[attributionKey];
|
delete this.attributionElements_[attributionKey];
|
||||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||||
}
|
}
|
||||||
@@ -293,7 +302,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
|||||||
|
|
||||||
for (logo in logoElements) {
|
for (logo in logoElements) {
|
||||||
if (!(logo in logos)) {
|
if (!(logo in logos)) {
|
||||||
goog.dom.removeNode(logoElements[logo]);
|
ol.dom.removeNode(logoElements[logo]);
|
||||||
delete logoElements[logo];
|
delete logoElements[logo];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,9 +320,8 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
|||||||
if (logoValue === '') {
|
if (logoValue === '') {
|
||||||
logoElement = image;
|
logoElement = image;
|
||||||
} else {
|
} else {
|
||||||
logoElement = goog.dom.createDom('A', {
|
logoElement = document.createElement('a');
|
||||||
'href': logoValue
|
logoElement.href = logoValue;
|
||||||
});
|
|
||||||
logoElement.appendChild(image);
|
logoElement.appendChild(image);
|
||||||
}
|
}
|
||||||
this.logoLi_.appendChild(logoElement);
|
this.logoLi_.appendChild(logoElement);
|
||||||
@@ -342,9 +350,9 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
|
|||||||
ol.control.Attribution.prototype.handleToggle_ = function() {
|
ol.control.Attribution.prototype.handleToggle_ = function() {
|
||||||
this.element.classList.toggle('ol-collapsed');
|
this.element.classList.toggle('ol-collapsed');
|
||||||
if (this.collapsed_) {
|
if (this.collapsed_) {
|
||||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
ol.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||||
} else {
|
} else {
|
||||||
goog.dom.replaceNode(this.label_, this.collapseLabel_);
|
ol.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||||
}
|
}
|
||||||
this.collapsed_ = !this.collapsed_;
|
this.collapsed_ = !this.collapsed_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
goog.provide('ol.control.Control');
|
goog.provide('ol.control.Control');
|
||||||
|
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.MapEventType');
|
goog.require('ol.MapEventType');
|
||||||
goog.require('ol.Object');
|
goog.require('ol.Object');
|
||||||
|
goog.require('ol.dom');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +81,7 @@ ol.inherits(ol.control.Control, ol.Object);
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.control.Control.prototype.disposeInternal = function() {
|
ol.control.Control.prototype.disposeInternal = function() {
|
||||||
goog.dom.removeNode(this.element);
|
ol.dom.removeNode(this.element);
|
||||||
ol.Object.prototype.disposeInternal.call(this);
|
ol.Object.prototype.disposeInternal.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ ol.control.Control.prototype.getMap = function() {
|
|||||||
*/
|
*/
|
||||||
ol.control.Control.prototype.setMap = function(map) {
|
ol.control.Control.prototype.setMap = function(map) {
|
||||||
if (this.map_) {
|
if (this.map_) {
|
||||||
goog.dom.removeNode(this.element);
|
ol.dom.removeNode(this.element);
|
||||||
}
|
}
|
||||||
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
|
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
|
||||||
ol.events.unlistenByKey(this.listenerKeys[i]);
|
ol.events.unlistenByKey(this.listenerKeys[i]);
|
||||||
@@ -135,5 +135,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.control.Control.prototype.setTarget = function(target) {
|
ol.control.Control.prototype.setTarget = function(target) {
|
||||||
this.target_ = goog.dom.getElement(target);
|
this.target_ = typeof target === 'string' ?
|
||||||
|
document.getElementById(target) :
|
||||||
|
target;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
goog.provide('ol.control.FullScreen');
|
goog.provide('ol.control.FullScreen');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.dom.fullscreen');
|
|
||||||
goog.require('goog.dom.fullscreen.EventType');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
|
goog.require('ol.dom');
|
||||||
goog.require('ol.css');
|
goog.require('ol.css');
|
||||||
|
|
||||||
|
|
||||||
@@ -58,19 +56,21 @@ ol.control.FullScreen = function(opt_options) {
|
|||||||
document.createTextNode(labelActive) : labelActive;
|
document.createTextNode(labelActive) : labelActive;
|
||||||
|
|
||||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
||||||
var button = goog.dom.createDom('BUTTON', {
|
var button = document.createElement('button');
|
||||||
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
|
button.className = this.cssClassName_ + '-' + ol.control.FullScreen.isFullScreen();
|
||||||
'type': 'button',
|
button.setAttribute('type', 'button');
|
||||||
'title': tipLabel
|
button.title = tipLabel;
|
||||||
}, this.labelNode_);
|
button.appendChild(this.labelNode_);
|
||||||
|
|
||||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||||
this.handleClick_, this);
|
this.handleClick_, this);
|
||||||
|
|
||||||
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
|
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
|
||||||
' ' + ol.css.CLASS_CONTROL + ' ' +
|
' ' + ol.css.CLASS_CONTROL + ' ' +
|
||||||
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
|
(!ol.control.FullScreen.isFullScreenSupported() ? ol.css.CLASS_UNSUPPORTED : '');
|
||||||
var element = goog.dom.createDom('DIV', cssClasses, button);
|
var element = document.createElement('div');
|
||||||
|
element.className = cssClasses;
|
||||||
|
element.appendChild(button);
|
||||||
|
|
||||||
ol.control.Control.call(this, {
|
ol.control.Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
@@ -107,23 +107,30 @@ ol.control.FullScreen.prototype.handleClick_ = function(event) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
||||||
if (!goog.dom.fullscreen.isSupported()) {
|
if (!ol.control.FullScreen.isFullScreenSupported()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
if (!map) {
|
if (!map) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (goog.dom.fullscreen.isFullScreen()) {
|
if (ol.control.FullScreen.isFullScreen()) {
|
||||||
goog.dom.fullscreen.exitFullScreen();
|
ol.control.FullScreen.exitFullScreen();
|
||||||
} else {
|
} else {
|
||||||
var element = this.source_ ?
|
var element;
|
||||||
goog.dom.getElement(this.source_) : map.getTargetElement();
|
if (this.source_) {
|
||||||
|
element = typeof this.source_ === 'string' ?
|
||||||
|
document.getElementById(this.source_) :
|
||||||
|
this.source_;
|
||||||
|
} else {
|
||||||
|
element = map.getTargetElement();
|
||||||
|
}
|
||||||
goog.asserts.assert(element, 'element should be defined');
|
goog.asserts.assert(element, 'element should be defined');
|
||||||
if (this.keys_) {
|
if (this.keys_) {
|
||||||
goog.dom.fullscreen.requestFullScreenWithKeys(element);
|
ol.control.FullScreen.requestFullScreenWithKeys(element);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
goog.dom.fullscreen.requestFullScreen(element);
|
ol.control.FullScreen.requestFullScreen(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -135,12 +142,12 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
|||||||
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||||
var button = this.element.firstElementChild;
|
var button = this.element.firstElementChild;
|
||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
if (goog.dom.fullscreen.isFullScreen()) {
|
if (ol.control.FullScreen.isFullScreen()) {
|
||||||
button.className = this.cssClassName_ + '-true';
|
button.className = this.cssClassName_ + '-true';
|
||||||
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
ol.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
||||||
} else {
|
} else {
|
||||||
button.className = this.cssClassName_ + '-false';
|
button.className = this.cssClassName_ + '-false';
|
||||||
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
ol.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
||||||
}
|
}
|
||||||
if (map) {
|
if (map) {
|
||||||
map.updateSize();
|
map.updateSize();
|
||||||
@@ -156,8 +163,93 @@ ol.control.FullScreen.prototype.setMap = function(map) {
|
|||||||
ol.control.Control.prototype.setMap.call(this, map);
|
ol.control.Control.prototype.setMap.call(this, map);
|
||||||
if (map) {
|
if (map) {
|
||||||
this.listenerKeys.push(
|
this.listenerKeys.push(
|
||||||
ol.events.listen(ol.global.document, goog.dom.fullscreen.EventType.CHANGE,
|
ol.events.listen(ol.global.document, ol.control.FullScreen.CHANGETYPE,
|
||||||
this.handleFullScreenChange_, this)
|
this.handleFullScreenChange_, this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} Fullscreen is supported by the current platform.
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.isFullScreenSupported = function() {
|
||||||
|
var body = document.body;
|
||||||
|
return !!(
|
||||||
|
body.webkitRequestFullscreen ||
|
||||||
|
(body.mozRequestFullScreen && document.mozFullScreenEnabled) ||
|
||||||
|
(body.msRequestFullscreen && document.msFullscreenEnabled) ||
|
||||||
|
(body.requestFullscreen && document.fullscreenEnabled)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} Element is currently in fullscreen.
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.isFullScreen = function() {
|
||||||
|
return !!(
|
||||||
|
document.webkitIsFullScreen || document.mozFullScreen ||
|
||||||
|
document.msFullscreenElement || document.fullscreenElement
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request to fullscreen an element.
|
||||||
|
* @param {Node} element Element to request fullscreen
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.requestFullScreen = function(element) {
|
||||||
|
if (element.requestFullscreen) {
|
||||||
|
element.requestFullscreen();
|
||||||
|
} else if (element.msRequestFullscreen) {
|
||||||
|
element.msRequestFullscreen();
|
||||||
|
} else if (element.mozRequestFullScreen) {
|
||||||
|
element.mozRequestFullScreen();
|
||||||
|
} else if (element.webkitRequestFullscreen) {
|
||||||
|
element.webkitRequestFullscreen();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request to fullscreen an element with keyboard input.
|
||||||
|
* @param {Node} element Element to request fullscreen
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.requestFullScreenWithKeys = function(element) {
|
||||||
|
if (element.mozRequestFullScreenWithKeys) {
|
||||||
|
element.mozRequestFullScreenWithKeys();
|
||||||
|
} else if (element.webkitRequestFullscreen) {
|
||||||
|
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
||||||
|
} else {
|
||||||
|
ol.control.FullScreen.requestFullScreen(element);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exit fullscreen.
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.exitFullScreen = function() {
|
||||||
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen();
|
||||||
|
} else if (document.msExitFullscreen) {
|
||||||
|
document.msExitFullscreen();
|
||||||
|
} else if (document.mozCancelFullScreen) {
|
||||||
|
document.mozCancelFullScreen();
|
||||||
|
} else if (document.webkitExitFullscreen) {
|
||||||
|
document.webkitExitFullscreen();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
ol.control.FullScreen.CHANGETYPE = (function() {
|
||||||
|
var body = document.body;
|
||||||
|
if (body.webkitRequestFullscreen) {
|
||||||
|
return 'webkitfullscreenchange';
|
||||||
|
} else if (body.mozRequestFullScreen) {
|
||||||
|
return 'mozfullscreenchange';
|
||||||
|
} else if (body.msRequestFullscreen) {
|
||||||
|
return 'MSFullscreenChange';
|
||||||
|
} else if (body.requestFullscreen) {
|
||||||
|
return 'fullscreenchange';
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
})();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.control.OverviewMap');
|
goog.provide('ol.control.OverviewMap');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
@@ -17,6 +16,7 @@ goog.require('ol.ViewProperty');
|
|||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
goog.require('ol.coordinate');
|
goog.require('ol.coordinate');
|
||||||
goog.require('ol.css');
|
goog.require('ol.css');
|
||||||
|
goog.require('ol.dom');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|
||||||
|
|
||||||
@@ -55,30 +55,37 @@ ol.control.OverviewMap = function(opt_options) {
|
|||||||
|
|
||||||
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
|
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
|
||||||
|
|
||||||
/**
|
if (typeof collapseLabel === 'string') {
|
||||||
* @private
|
/**
|
||||||
* @type {Node}
|
* @private
|
||||||
*/
|
* @type {Node}
|
||||||
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
*/
|
||||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
this.collapseLabel_ = document.createElement('span');
|
||||||
collapseLabel;
|
this.collapseLabel_.textContent = collapseLabel;
|
||||||
|
} else {
|
||||||
|
this.collapseLabel_ = collapseLabel;
|
||||||
|
}
|
||||||
|
|
||||||
var label = options.label !== undefined ? options.label : '\u00BB';
|
var label = options.label !== undefined ? options.label : '\u00BB';
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
if (typeof label === 'string') {
|
||||||
* @type {Node}
|
/**
|
||||||
*/
|
* @private
|
||||||
this.label_ = typeof label === 'string' ?
|
* @type {Node}
|
||||||
goog.dom.createDom('SPAN', {}, label) :
|
*/
|
||||||
label;
|
this.label_ = document.createElement('span');
|
||||||
|
this.label_.textContent = label;
|
||||||
|
} else {
|
||||||
|
this.label_ = label;
|
||||||
|
}
|
||||||
|
|
||||||
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
||||||
this.collapseLabel_ : this.label_;
|
this.collapseLabel_ : this.label_;
|
||||||
var button = goog.dom.createDom('BUTTON', {
|
var button = document.createElement('button');
|
||||||
'type': 'button',
|
button.setAttribute('type', 'button');
|
||||||
'title': tipLabel
|
button.title = tipLabel;
|
||||||
}, activeLabel);
|
button.appendChild(activeLabel);
|
||||||
|
|
||||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||||
this.handleClick_, this);
|
this.handleClick_, this);
|
||||||
@@ -127,8 +134,10 @@ ol.control.OverviewMap = function(opt_options) {
|
|||||||
ol.css.CLASS_CONTROL +
|
ol.css.CLASS_CONTROL +
|
||||||
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
||||||
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
||||||
var element = goog.dom.createDom('DIV',
|
var element = document.createElement('div');
|
||||||
cssClasses, ovmapDiv, button);
|
element.className = cssClasses;
|
||||||
|
element.appendChild(ovmapDiv);
|
||||||
|
element.appendChild(button);
|
||||||
|
|
||||||
var render = options.render ? options.render : ol.control.OverviewMap.render;
|
var render = options.render ? options.render : ol.control.OverviewMap.render;
|
||||||
|
|
||||||
@@ -445,9 +454,9 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
|
|||||||
ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
||||||
this.element.classList.toggle('ol-collapsed');
|
this.element.classList.toggle('ol-collapsed');
|
||||||
if (this.collapsed_) {
|
if (this.collapsed_) {
|
||||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
ol.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||||
} else {
|
} else {
|
||||||
goog.dom.replaceNode(this.label_, this.collapseLabel_);
|
ol.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||||
}
|
}
|
||||||
this.collapsed_ = !this.collapsed_;
|
this.collapsed_ = !this.collapsed_;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.provide('ol.control.Rotate');
|
goog.provide('ol.control.Rotate');
|
||||||
|
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
@@ -36,8 +35,9 @@ ol.control.Rotate = function(opt_options) {
|
|||||||
this.label_ = null;
|
this.label_ = null;
|
||||||
|
|
||||||
if (typeof label === 'string') {
|
if (typeof label === 'string') {
|
||||||
this.label_ = goog.dom.createDom('SPAN',
|
this.label_ = document.createElement('span');
|
||||||
'ol-compass', label);
|
this.label_.className = 'ol-compass';
|
||||||
|
this.label_.textContent = label;
|
||||||
} else {
|
} else {
|
||||||
this.label_ = label;
|
this.label_ = label;
|
||||||
this.label_.classList.add('ol-compass');
|
this.label_.classList.add('ol-compass');
|
||||||
@@ -45,18 +45,20 @@ ol.control.Rotate = function(opt_options) {
|
|||||||
|
|
||||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
|
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
|
||||||
|
|
||||||
var button = goog.dom.createDom('BUTTON', {
|
var button = document.createElement('button');
|
||||||
'class': className + '-reset',
|
button.className = className + '-reset';
|
||||||
'type' : 'button',
|
button.setAttribute('type', 'button');
|
||||||
'title': tipLabel
|
button.title = tipLabel;
|
||||||
}, this.label_);
|
button.appendChild(this.label_);
|
||||||
|
|
||||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||||
ol.control.Rotate.prototype.handleClick_, this);
|
ol.control.Rotate.prototype.handleClick_, this);
|
||||||
|
|
||||||
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
||||||
ol.css.CLASS_CONTROL;
|
ol.css.CLASS_CONTROL;
|
||||||
var element = goog.dom.createDom('DIV', cssClasses, button);
|
var element = document.createElement('div');
|
||||||
|
element.className = cssClasses;
|
||||||
|
element.appendChild(button);
|
||||||
|
|
||||||
var render = options.render ? options.render : ol.control.Rotate.render;
|
var render = options.render ? options.render : ol.control.Rotate.render;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.provide('ol.control.Zoom');
|
goog.provide('ol.control.Zoom');
|
||||||
|
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol.animation');
|
goog.require('ol.animation');
|
||||||
@@ -36,27 +35,34 @@ ol.control.Zoom = function(opt_options) {
|
|||||||
var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
|
var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
|
||||||
options.zoomOutTipLabel : 'Zoom out';
|
options.zoomOutTipLabel : 'Zoom out';
|
||||||
|
|
||||||
var inElement = goog.dom.createDom('BUTTON', {
|
var inElement = document.createElement('button');
|
||||||
'class': className + '-in',
|
inElement.className = className + '-in';
|
||||||
'type' : 'button',
|
inElement.setAttribute('type', 'button');
|
||||||
'title': zoomInTipLabel
|
inElement.title = zoomInTipLabel;
|
||||||
}, zoomInLabel);
|
inElement.appendChild(
|
||||||
|
typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel
|
||||||
|
);
|
||||||
|
|
||||||
ol.events.listen(inElement, ol.events.EventType.CLICK,
|
ol.events.listen(inElement, ol.events.EventType.CLICK,
|
||||||
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
|
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
|
||||||
|
|
||||||
var outElement = goog.dom.createDom('BUTTON', {
|
var outElement = document.createElement('button');
|
||||||
'class': className + '-out',
|
outElement.className = className + '-out';
|
||||||
'type' : 'button',
|
outElement.setAttribute('type', 'button');
|
||||||
'title': zoomOutTipLabel
|
outElement.title = zoomOutTipLabel;
|
||||||
}, zoomOutLabel);
|
outElement.appendChild(
|
||||||
|
typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel
|
||||||
|
);
|
||||||
|
|
||||||
ol.events.listen(outElement, ol.events.EventType.CLICK,
|
ol.events.listen(outElement, ol.events.EventType.CLICK,
|
||||||
ol.control.Zoom.prototype.handleClick_.bind(this, -delta));
|
ol.control.Zoom.prototype.handleClick_.bind(this, -delta));
|
||||||
|
|
||||||
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
||||||
ol.css.CLASS_CONTROL;
|
ol.css.CLASS_CONTROL;
|
||||||
var element = goog.dom.createDom('DIV', cssClasses, inElement, outElement);
|
var element = document.createElement('div');
|
||||||
|
element.className = cssClasses;
|
||||||
|
element.appendChild(inElement);
|
||||||
|
element.appendChild(outElement);
|
||||||
|
|
||||||
ol.control.Control.call(this, {
|
ol.control.Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
goog.provide('ol.control.ZoomSlider');
|
goog.provide('ol.control.ZoomSlider');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.Event');
|
goog.require('ol.events.Event');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
@@ -108,14 +107,12 @@ ol.control.ZoomSlider = function(opt_options) {
|
|||||||
this.duration_ = options.duration !== undefined ? options.duration : 200;
|
this.duration_ = options.duration !== undefined ? options.duration : 200;
|
||||||
|
|
||||||
var className = options.className !== undefined ? options.className : 'ol-zoomslider';
|
var className = options.className !== undefined ? options.className : 'ol-zoomslider';
|
||||||
var thumbElement = goog.dom.createDom('BUTTON', {
|
var thumbElement = document.createElement('button');
|
||||||
'type': 'button',
|
thumbElement.setAttribute('type', 'button');
|
||||||
'class': className + '-thumb ' + ol.css.CLASS_UNSELECTABLE
|
thumbElement.className = className + '-thumb ' + ol.css.CLASS_UNSELECTABLE;
|
||||||
});
|
var containerElement = document.createElement('div');
|
||||||
var containerElement = goog.dom.createDom('DIV',
|
containerElement.className = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL;
|
||||||
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
|
containerElement.appendChild(thumbElement);
|
||||||
thumbElement);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.pointer.PointerEventHandler}
|
* @type {ol.pointer.PointerEventHandler}
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.control.ZoomToExtent');
|
goog.provide('ol.control.ZoomToExtent');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
@@ -33,17 +32,21 @@ ol.control.ZoomToExtent = function(opt_options) {
|
|||||||
var label = options.label !== undefined ? options.label : 'E';
|
var label = options.label !== undefined ? options.label : 'E';
|
||||||
var tipLabel = options.tipLabel !== undefined ?
|
var tipLabel = options.tipLabel !== undefined ?
|
||||||
options.tipLabel : 'Fit to extent';
|
options.tipLabel : 'Fit to extent';
|
||||||
var button = goog.dom.createDom('BUTTON', {
|
var button = document.createElement('button');
|
||||||
'type': 'button',
|
button.setAttribute('type', 'button');
|
||||||
'title': tipLabel
|
button.title = tipLabel;
|
||||||
}, label);
|
button.appendChild(
|
||||||
|
typeof label === 'string' ? document.createTextNode(label) : label
|
||||||
|
);
|
||||||
|
|
||||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||||
this.handleClick_, this);
|
this.handleClick_, this);
|
||||||
|
|
||||||
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
||||||
ol.css.CLASS_CONTROL;
|
ol.css.CLASS_CONTROL;
|
||||||
var element = goog.dom.createDom('DIV', cssClasses, button);
|
var element = document.createElement('div');
|
||||||
|
element.className = cssClasses;
|
||||||
|
element.appendChild(button);
|
||||||
|
|
||||||
ol.control.Control.call(this, {
|
ol.control.Control.call(this, {
|
||||||
element: element,
|
element: element,
|
||||||
|
|||||||
@@ -213,3 +213,31 @@ ol.dom.outerHeight = function(element) {
|
|||||||
|
|
||||||
return height;
|
return height;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Node} newNode Node to replace old node
|
||||||
|
* @param {Node} oldNode The node to be replaced
|
||||||
|
*/
|
||||||
|
ol.dom.replaceNode = function(newNode, oldNode) {
|
||||||
|
var parent = oldNode.parentNode;
|
||||||
|
if (parent) {
|
||||||
|
parent.replaceChild(newNode, oldNode);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Node} node The node to remove.
|
||||||
|
* @returns {Node} The node that was removed or null.
|
||||||
|
*/
|
||||||
|
ol.dom.removeNode = function(node) {
|
||||||
|
return node && node.parentNode ? node.parentNode.removeChild(node) : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Node} node The node to remove the children from.
|
||||||
|
*/
|
||||||
|
ol.dom.removeChildren = function(node) {
|
||||||
|
while (node.lastChild) {
|
||||||
|
node.removeChild(node.lastChild);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.GML2');
|
goog.provide('ol.format.GML2');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.format.GMLBase');
|
goog.require('ol.format.GMLBase');
|
||||||
goog.require('ol.format.XSD');
|
goog.require('ol.format.XSD');
|
||||||
@@ -102,7 +101,7 @@ ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
|||||||
* @return {ol.Extent|undefined} Envelope.
|
* @return {ol.Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
|
ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
|
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
@@ -120,7 +119,7 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
||||||
'localName should be innerBoundaryIs');
|
'localName should be innerBoundaryIs');
|
||||||
@@ -145,7 +144,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
||||||
'localName should be outerBoundaryIs');
|
'localName should be outerBoundaryIs');
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ goog.provide('ol.format.GML');
|
|||||||
goog.provide('ol.format.GML3');
|
goog.provide('ol.format.GML3');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
@@ -94,7 +93,7 @@ ol.format.GML3.schemaLocation_ = ol.format.GMLBase.GMLNS +
|
|||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiCurve',
|
goog.asserts.assert(node.localName == 'MultiCurve',
|
||||||
'localName should be MultiCurve');
|
'localName should be MultiCurve');
|
||||||
@@ -118,7 +117,7 @@ ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiSurface',
|
goog.asserts.assert(node.localName == 'MultiSurface',
|
||||||
'localName should be MultiSurface');
|
'localName should be MultiSurface');
|
||||||
@@ -141,7 +140,7 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'curveMember' ||
|
goog.asserts.assert(node.localName == 'curveMember' ||
|
||||||
node.localName == 'curveMembers',
|
node.localName == 'curveMembers',
|
||||||
@@ -156,7 +155,7 @@ ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'surfaceMember' ||
|
goog.asserts.assert(node.localName == 'surfaceMember' ||
|
||||||
node.localName == 'surfaceMembers',
|
node.localName == 'surfaceMembers',
|
||||||
@@ -173,7 +172,7 @@ ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
|||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'patches',
|
goog.asserts.assert(node.localName == 'patches',
|
||||||
'localName should be patches');
|
'localName should be patches');
|
||||||
@@ -189,7 +188,7 @@ ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array.<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'segments',
|
goog.asserts.assert(node.localName == 'segments',
|
||||||
'localName should be segments');
|
'localName should be segments');
|
||||||
@@ -205,7 +204,7 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
|
|||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'npde.nodeType should be ELEMENT');
|
'npde.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'PolygonPatch',
|
goog.asserts.assert(node.localName == 'PolygonPatch',
|
||||||
'localName should be PolygonPatch');
|
'localName should be PolygonPatch');
|
||||||
@@ -221,7 +220,7 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array.<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LineStringSegment',
|
goog.asserts.assert(node.localName == 'LineStringSegment',
|
||||||
'localName should be LineStringSegment');
|
'localName should be LineStringSegment');
|
||||||
@@ -237,7 +236,7 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'interior',
|
goog.asserts.assert(node.localName == 'interior',
|
||||||
'localName should be interior');
|
'localName should be interior');
|
||||||
@@ -262,7 +261,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'exterior',
|
goog.asserts.assert(node.localName == 'exterior',
|
||||||
'localName should be exterior');
|
'localName should be exterior');
|
||||||
@@ -288,7 +287,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Surface',
|
goog.asserts.assert(node.localName == 'Surface',
|
||||||
'localName should be Surface');
|
'localName should be Surface');
|
||||||
@@ -320,7 +319,7 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {ol.geom.LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
|
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
@@ -343,7 +342,7 @@ ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
|
|||||||
* @return {ol.Extent|undefined} Envelope.
|
* @return {ol.Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Envelope',
|
goog.asserts.assert(node.localName == 'Envelope',
|
||||||
'localName should be Envelope');
|
'localName should be Envelope');
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
goog.provide('ol.format.GMLBase');
|
goog.provide('ol.format.GMLBase');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
@@ -109,7 +108,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
|||||||
* @return {Array.<ol.Feature> | undefined} Features.
|
* @return {Array.<ol.Feature> | undefined} Features.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var localName = node.localName;
|
var localName = node.localName;
|
||||||
var features = null;
|
var features = null;
|
||||||
@@ -263,7 +262,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Point|undefined} Point.
|
* @return {ol.geom.Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
||||||
var flatCoordinates =
|
var flatCoordinates =
|
||||||
@@ -284,7 +283,7 @@ ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
|
|||||||
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
|
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiPoint',
|
goog.asserts.assert(node.localName == 'MultiPoint',
|
||||||
'localName should be MultiPoint');
|
'localName should be MultiPoint');
|
||||||
@@ -305,7 +304,7 @@ ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
|||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiLineString',
|
goog.asserts.assert(node.localName == 'MultiLineString',
|
||||||
'localName should be MultiLineString');
|
'localName should be MultiLineString');
|
||||||
@@ -328,7 +327,7 @@ ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
|||||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiPolygon',
|
goog.asserts.assert(node.localName == 'MultiPolygon',
|
||||||
'localName should be MultiPolygon');
|
'localName should be MultiPolygon');
|
||||||
@@ -351,7 +350,7 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'pointMember' ||
|
goog.asserts.assert(node.localName == 'pointMember' ||
|
||||||
node.localName == 'pointMembers',
|
node.localName == 'pointMembers',
|
||||||
@@ -367,7 +366,7 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'lineStringMember' ||
|
goog.asserts.assert(node.localName == 'lineStringMember' ||
|
||||||
node.localName == 'lineStringMembers',
|
node.localName == 'lineStringMembers',
|
||||||
@@ -383,7 +382,7 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'polygonMember' ||
|
goog.asserts.assert(node.localName == 'polygonMember' ||
|
||||||
node.localName == 'polygonMembers',
|
node.localName == 'polygonMembers',
|
||||||
@@ -399,7 +398,7 @@ ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {ol.geom.LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LineString',
|
goog.asserts.assert(node.localName == 'LineString',
|
||||||
'localName should be LineString');
|
'localName should be LineString');
|
||||||
@@ -422,7 +421,7 @@ ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
|
|||||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LinearRing',
|
goog.asserts.assert(node.localName == 'LinearRing',
|
||||||
'localName should be LinearRing');
|
'localName should be LinearRing');
|
||||||
@@ -443,7 +442,7 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LinearRing',
|
goog.asserts.assert(node.localName == 'LinearRing',
|
||||||
'localName should be LinearRing');
|
'localName should be LinearRing');
|
||||||
@@ -465,7 +464,7 @@ ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Polygon',
|
goog.asserts.assert(node.localName == 'Polygon',
|
||||||
'localName should be Polygon');
|
'localName should be Polygon');
|
||||||
@@ -497,7 +496,7 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array.<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return ol.xml.pushParseAndPop(null,
|
return ol.xml.pushParseAndPop(null,
|
||||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.GPX');
|
goog.provide('ol.format.GPX');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
@@ -64,7 +63,7 @@ ol.format.GPX.NAMESPACE_URIS_ = [
|
|||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array.<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
|
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
flatCoordinates.push(
|
flatCoordinates.push(
|
||||||
parseFloat(node.getAttribute('lon')),
|
parseFloat(node.getAttribute('lon')),
|
||||||
@@ -91,7 +90,7 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseLink_ = function(node, objectStack) {
|
ol.format.GPX.parseLink_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'link', 'localName should be link');
|
goog.asserts.assert(node.localName == 'link', 'localName should be link');
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -109,7 +108,7 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'extensions',
|
goog.asserts.assert(node.localName == 'extensions',
|
||||||
'localName should be extensions');
|
'localName should be extensions');
|
||||||
@@ -124,7 +123,7 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'rtept', 'localName should be rtept');
|
goog.asserts.assert(node.localName == 'rtept', 'localName should be rtept');
|
||||||
var values = ol.xml.pushParseAndPop(
|
var values = ol.xml.pushParseAndPop(
|
||||||
@@ -144,7 +143,7 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'trkpt', 'localName should be trkpt');
|
goog.asserts.assert(node.localName == 'trkpt', 'localName should be trkpt');
|
||||||
var values = ol.xml.pushParseAndPop(
|
var values = ol.xml.pushParseAndPop(
|
||||||
@@ -164,7 +163,7 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'trkseg',
|
goog.asserts.assert(node.localName == 'trkseg',
|
||||||
'localName should be trkseg');
|
'localName should be trkseg');
|
||||||
@@ -184,7 +183,7 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
|||||||
* @return {ol.Feature|undefined} Track.
|
* @return {ol.Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.readRte_ = function(node, objectStack) {
|
ol.format.GPX.readRte_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'rte', 'localName should be rte');
|
goog.asserts.assert(node.localName == 'rte', 'localName should be rte');
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
@@ -213,7 +212,7 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
|
|||||||
* @return {ol.Feature|undefined} Track.
|
* @return {ol.Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.readTrk_ = function(node, objectStack) {
|
ol.format.GPX.readTrk_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'trk', 'localName should be trk');
|
goog.asserts.assert(node.localName == 'trk', 'localName should be trk');
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
@@ -246,7 +245,7 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
|
|||||||
* @return {ol.Feature|undefined} Waypoint.
|
* @return {ol.Feature|undefined} Waypoint.
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.readWpt_ = function(node, objectStack) {
|
ol.format.GPX.readWpt_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'wpt', 'localName should be wpt');
|
goog.asserts.assert(node.localName == 'wpt', 'localName should be wpt');
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
@@ -448,7 +447,7 @@ ol.format.GPX.prototype.readFeature;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
|
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return null;
|
return null;
|
||||||
@@ -484,7 +483,7 @@ ol.format.GPX.prototype.readFeatures;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ goog.provide('ol.format.KML');
|
|||||||
|
|
||||||
goog.require('goog.Uri');
|
goog.require('goog.Uri');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
@@ -561,7 +560,7 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be an ELEMENT');
|
'node.nodeType should be an ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'IconStyle',
|
goog.asserts.assert(node.localName == 'IconStyle',
|
||||||
'localName should be IconStyle');
|
'localName should be IconStyle');
|
||||||
@@ -662,7 +661,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LabelStyle',
|
goog.asserts.assert(node.localName == 'LabelStyle',
|
||||||
'localName should be LabelStyle');
|
'localName should be LabelStyle');
|
||||||
@@ -693,7 +692,7 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LineStyle',
|
goog.asserts.assert(node.localName == 'LineStyle',
|
||||||
'localName should be LineStyle');
|
'localName should be LineStyle');
|
||||||
@@ -725,7 +724,7 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'PolyStyle',
|
goog.asserts.assert(node.localName == 'PolyStyle',
|
||||||
'localName should be PolyStyle');
|
'localName should be PolyStyle');
|
||||||
@@ -762,7 +761,7 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} LinearRing flat coordinates.
|
* @return {Array.<number>} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LinearRing',
|
goog.asserts.assert(node.localName == 'LinearRing',
|
||||||
'localName should be LinearRing');
|
'localName should be LinearRing');
|
||||||
@@ -777,7 +776,7 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(ol.array.includes(
|
goog.asserts.assert(ol.array.includes(
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||||
@@ -810,7 +809,7 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
|
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(ol.array.includes(
|
goog.asserts.assert(ol.array.includes(
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||||
@@ -835,7 +834,7 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {ol.geom.LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(ol.array.includes(
|
goog.asserts.assert(ol.array.includes(
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||||
@@ -872,7 +871,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
|||||||
* @return {Object} Icon object.
|
* @return {Object} Icon object.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readIcon_ = function(node, objectStack) {
|
ol.format.KML.readIcon_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Icon', 'localName should be Icon');
|
goog.asserts.assert(node.localName == 'Icon', 'localName should be Icon');
|
||||||
var iconObject = ol.xml.pushParseAndPop(
|
var iconObject = ol.xml.pushParseAndPop(
|
||||||
@@ -892,7 +891,7 @@ ol.format.KML.readIcon_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array.<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return ol.xml.pushParseAndPop(null,
|
return ol.xml.pushParseAndPop(null,
|
||||||
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
|
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
|
||||||
@@ -906,7 +905,7 @@ ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {ol.geom.LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readLineString_ = function(node, objectStack) {
|
ol.format.KML.readLineString_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LineString',
|
goog.asserts.assert(node.localName == 'LineString',
|
||||||
'localName should be LineString');
|
'localName should be LineString');
|
||||||
@@ -933,7 +932,7 @@ ol.format.KML.readLineString_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readLinearRing_ = function(node, objectStack) {
|
ol.format.KML.readLinearRing_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'LinearRing',
|
goog.asserts.assert(node.localName == 'LinearRing',
|
||||||
'localName should be LinearRing');
|
'localName should be LinearRing');
|
||||||
@@ -961,7 +960,7 @@ ol.format.KML.readLinearRing_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {ol.geom.Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
|
ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MultiGeometry',
|
goog.asserts.assert(node.localName == 'MultiGeometry',
|
||||||
'localName should be MultiGeometry');
|
'localName should be MultiGeometry');
|
||||||
@@ -1033,7 +1032,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Point|undefined} Point.
|
* @return {ol.geom.Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readPoint_ = function(node, objectStack) {
|
ol.format.KML.readPoint_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
||||||
var properties = ol.xml.pushParseAndPop({},
|
var properties = ol.xml.pushParseAndPop({},
|
||||||
@@ -1061,7 +1060,7 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readPolygon_ = function(node, objectStack) {
|
ol.format.KML.readPolygon_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Polygon',
|
goog.asserts.assert(node.localName == 'Polygon',
|
||||||
'localName should be Polygon');
|
'localName should be Polygon');
|
||||||
@@ -1096,7 +1095,7 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
|
|||||||
* @return {Array.<ol.style.Style>} Style.
|
* @return {Array.<ol.style.Style>} Style.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readStyle_ = function(node, objectStack) {
|
ol.format.KML.readStyle_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
||||||
var styleObject = ol.xml.pushParseAndPop(
|
var styleObject = ol.xml.pushParseAndPop(
|
||||||
@@ -1172,7 +1171,7 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.DataParser_ = function(node, objectStack) {
|
ol.format.KML.DataParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Data', 'localName should be Data');
|
goog.asserts.assert(node.localName == 'Data', 'localName should be Data');
|
||||||
var name = node.getAttribute('name');
|
var name = node.getAttribute('name');
|
||||||
@@ -1196,7 +1195,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ExtendedData',
|
goog.asserts.assert(node.localName == 'ExtendedData',
|
||||||
'localName should be ExtendedData');
|
'localName should be ExtendedData');
|
||||||
@@ -1210,7 +1209,7 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Pair', 'localName should be Pair');
|
goog.asserts.assert(node.localName == 'Pair', 'localName should be Pair');
|
||||||
var pairObject = ol.xml.pushParseAndPop(
|
var pairObject = ol.xml.pushParseAndPop(
|
||||||
@@ -1241,7 +1240,7 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'StyleMap',
|
goog.asserts.assert(node.localName == 'StyleMap',
|
||||||
'localName should be StyleMap');
|
'localName should be StyleMap');
|
||||||
@@ -1268,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'SchemaData',
|
goog.asserts.assert(node.localName == 'SchemaData',
|
||||||
'localName should be SchemaData');
|
'localName should be SchemaData');
|
||||||
@@ -1282,7 +1281,7 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'SimpleData',
|
goog.asserts.assert(node.localName == 'SimpleData',
|
||||||
'localName should be SimpleData');
|
'localName should be SimpleData');
|
||||||
@@ -1302,7 +1301,7 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
||||||
'localName should be innerBoundaryIs');
|
'localName should be innerBoundaryIs');
|
||||||
@@ -1327,7 +1326,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
||||||
'localName should be outerBoundaryIs');
|
'localName should be outerBoundaryIs');
|
||||||
@@ -1352,7 +1351,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LinkParser_ = function(node, objectStack) {
|
ol.format.KML.LinkParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Link', 'localName should be Link');
|
goog.asserts.assert(node.localName == 'Link', 'localName should be Link');
|
||||||
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
|
||||||
@@ -1365,7 +1364,7 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.whenParser_ = function(node, objectStack) {
|
ol.format.KML.whenParser_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'when', 'localName should be when');
|
goog.asserts.assert(node.localName == 'when', 'localName should be when');
|
||||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||||
@@ -1728,7 +1727,7 @@ ol.format.KML.prototype.getExtensions = function() {
|
|||||||
* @return {Array.<ol.Feature>|undefined} Features.
|
* @return {Array.<ol.Feature>|undefined} Features.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
|
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var localName = node.localName;
|
var localName = node.localName;
|
||||||
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
|
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
|
||||||
@@ -1759,7 +1758,7 @@ ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
|
|||||||
* @return {ol.Feature|undefined} Feature.
|
* @return {ol.Feature|undefined} Feature.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
|
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Placemark',
|
goog.asserts.assert(node.localName == 'Placemark',
|
||||||
'localName should be Placemark');
|
'localName should be Placemark');
|
||||||
@@ -1806,7 +1805,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
|
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
||||||
var id = node.getAttribute('id');
|
var id = node.getAttribute('id');
|
||||||
@@ -1831,7 +1830,7 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
|
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'StyleMap',
|
goog.asserts.assert(node.localName == 'StyleMap',
|
||||||
'localName should be StyleMap');
|
'localName should be StyleMap');
|
||||||
@@ -1871,7 +1870,7 @@ ol.format.KML.prototype.readFeature;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
|
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1906,7 +1905,7 @@ ol.format.KML.prototype.readFeatures;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return [];
|
return [];
|
||||||
@@ -1974,7 +1973,7 @@ ol.format.KML.prototype.readName = function(source) {
|
|||||||
ol.format.KML.prototype.readNameFromDocument = function(doc) {
|
ol.format.KML.prototype.readNameFromDocument = function(doc) {
|
||||||
var n;
|
var n;
|
||||||
for (n = doc.firstChild; n; n = n.nextSibling) {
|
for (n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
var name = this.readNameFromNode(n);
|
var name = this.readNameFromNode(n);
|
||||||
if (name) {
|
if (name) {
|
||||||
return name;
|
return name;
|
||||||
@@ -2046,7 +2045,7 @@ ol.format.KML.prototype.readNetworkLinks = function(source) {
|
|||||||
ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
|
ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
|
||||||
var n, networkLinks = [];
|
var n, networkLinks = [];
|
||||||
for (n = doc.firstChild; n; n = n.nextSibling) {
|
for (n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
|
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
goog.provide('ol.format.OSMXML');
|
goog.provide('ol.format.OSMXML');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
@@ -58,7 +57,7 @@ ol.format.OSMXML.prototype.getExtensions = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'node', 'localName should be node');
|
goog.asserts.assert(node.localName == 'node', 'localName should be node');
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
@@ -91,7 +90,7 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'way', 'localName should be way');
|
goog.asserts.assert(node.localName == 'way', 'localName should be way');
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
@@ -131,7 +130,7 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'nd', 'localName should be nd');
|
goog.asserts.assert(node.localName == 'nd', 'localName should be nd');
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -145,7 +144,7 @@ ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readTag_ = function(node, objectStack) {
|
ol.format.OSMXML.readTag_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'tag', 'localName should be tag');
|
goog.asserts.assert(node.localName == 'tag', 'localName should be tag');
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -214,7 +213,7 @@ ol.format.OSMXML.prototype.readFeatures;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var options = this.getReadOptions(node, opt_options);
|
var options = this.getReadOptions(node, opt_options);
|
||||||
if (node.localName == 'osm') {
|
if (node.localName == 'osm') {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.OWS');
|
goog.provide('ol.format.OWS');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.format.XLink');
|
goog.require('ol.format.XLink');
|
||||||
goog.require('ol.format.XML');
|
goog.require('ol.format.XML');
|
||||||
goog.require('ol.format.XSD');
|
goog.require('ol.format.XSD');
|
||||||
@@ -23,10 +22,10 @@ ol.inherits(ol.format.OWS, ol.format.XML);
|
|||||||
* @return {Object} OWS object.
|
* @return {Object} OWS object.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.prototype.readFromDocument = function(doc) {
|
ol.format.OWS.prototype.readFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be DOCUMENT');
|
'doc.nodeType should be DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +38,7 @@ ol.format.OWS.prototype.readFromDocument = function(doc) {
|
|||||||
* @return {Object} OWS object.
|
* @return {Object} OWS object.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.prototype.readFromNode = function(node) {
|
ol.format.OWS.prototype.readFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var owsObject = ol.xml.pushParseAndPop({},
|
var owsObject = ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.PARSERS_, node, []);
|
ol.format.OWS.PARSERS_, node, []);
|
||||||
@@ -54,7 +53,7 @@ ol.format.OWS.prototype.readFromNode = function(node) {
|
|||||||
* @return {Object|undefined} The address.
|
* @return {Object|undefined} The address.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readAddress_ = function(node, objectStack) {
|
ol.format.OWS.readAddress_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Address',
|
goog.asserts.assert(node.localName == 'Address',
|
||||||
'localName should be Address');
|
'localName should be Address');
|
||||||
@@ -70,7 +69,7 @@ ol.format.OWS.readAddress_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The values.
|
* @return {Object|undefined} The values.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'AllowedValues',
|
goog.asserts.assert(node.localName == 'AllowedValues',
|
||||||
'localName should be AllowedValues');
|
'localName should be AllowedValues');
|
||||||
@@ -86,7 +85,7 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The constraint.
|
* @return {Object|undefined} The constraint.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Constraint',
|
goog.asserts.assert(node.localName == 'Constraint',
|
||||||
'localName should be Constraint');
|
'localName should be Constraint');
|
||||||
@@ -107,7 +106,7 @@ ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The contact info.
|
* @return {Object|undefined} The contact info.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readContactInfo_ = function(node, objectStack) {
|
ol.format.OWS.readContactInfo_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ContactInfo',
|
goog.asserts.assert(node.localName == 'ContactInfo',
|
||||||
'localName should be ContactInfo');
|
'localName should be ContactInfo');
|
||||||
@@ -123,7 +122,7 @@ ol.format.OWS.readContactInfo_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The DCP.
|
* @return {Object|undefined} The DCP.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readDcp_ = function(node, objectStack) {
|
ol.format.OWS.readDcp_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'DCP', 'localName should be DCP');
|
goog.asserts.assert(node.localName == 'DCP', 'localName should be DCP');
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
@@ -138,7 +137,7 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The GET object.
|
* @return {Object|undefined} The GET object.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readGet_ = function(node, objectStack) {
|
ol.format.OWS.readGet_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Get', 'localName should be Get');
|
goog.asserts.assert(node.localName == 'Get', 'localName should be Get');
|
||||||
var href = ol.format.XLink.readHref(node);
|
var href = ol.format.XLink.readHref(node);
|
||||||
@@ -157,7 +156,7 @@ ol.format.OWS.readGet_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The HTTP object.
|
* @return {Object|undefined} The HTTP object.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readHttp_ = function(node, objectStack) {
|
ol.format.OWS.readHttp_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
goog.asserts.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
||||||
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
|
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
|
||||||
@@ -172,7 +171,7 @@ ol.format.OWS.readHttp_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The operation.
|
* @return {Object|undefined} The operation.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readOperation_ = function(node, objectStack) {
|
ol.format.OWS.readOperation_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Operation',
|
goog.asserts.assert(node.localName == 'Operation',
|
||||||
'localName should be Operation');
|
'localName should be Operation');
|
||||||
@@ -198,7 +197,7 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
ol.format.OWS.readOperationsMetadata_ = function(node,
|
ol.format.OWS.readOperationsMetadata_ = function(node,
|
||||||
objectStack) {
|
objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'OperationsMetadata',
|
goog.asserts.assert(node.localName == 'OperationsMetadata',
|
||||||
'localName should be OperationsMetadata');
|
'localName should be OperationsMetadata');
|
||||||
@@ -215,7 +214,7 @@ ol.format.OWS.readOperationsMetadata_ = function(node,
|
|||||||
* @return {Object|undefined} The phone.
|
* @return {Object|undefined} The phone.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readPhone_ = function(node, objectStack) {
|
ol.format.OWS.readPhone_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Phone', 'localName should be Phone');
|
goog.asserts.assert(node.localName == 'Phone', 'localName should be Phone');
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
@@ -231,7 +230,7 @@ ol.format.OWS.readPhone_ = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
ol.format.OWS.readServiceIdentification_ = function(node,
|
ol.format.OWS.readServiceIdentification_ = function(node,
|
||||||
objectStack) {
|
objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ServiceIdentification',
|
goog.asserts.assert(node.localName == 'ServiceIdentification',
|
||||||
'localName should be ServiceIdentification');
|
'localName should be ServiceIdentification');
|
||||||
@@ -248,7 +247,7 @@ ol.format.OWS.readServiceIdentification_ = function(node,
|
|||||||
* @return {Object|undefined} The service contact.
|
* @return {Object|undefined} The service contact.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readServiceContact_ = function(node, objectStack) {
|
ol.format.OWS.readServiceContact_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ServiceContact',
|
goog.asserts.assert(node.localName == 'ServiceContact',
|
||||||
'localName should be ServiceContact');
|
'localName should be ServiceContact');
|
||||||
@@ -265,7 +264,7 @@ ol.format.OWS.readServiceContact_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} The service provider.
|
* @return {Object|undefined} The service provider.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ServiceProvider',
|
goog.asserts.assert(node.localName == 'ServiceProvider',
|
||||||
'localName should be ServiceProvider');
|
'localName should be ServiceProvider');
|
||||||
@@ -282,7 +281,7 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
|||||||
* @return {string|undefined} The value.
|
* @return {string|undefined} The value.
|
||||||
*/
|
*/
|
||||||
ol.format.OWS.readValue_ = function(node, objectStack) {
|
ol.format.OWS.readValue_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Value', 'localName should be Value');
|
goog.asserts.assert(node.localName == 'Value', 'localName should be Value');
|
||||||
return ol.format.XSD.readString(node);
|
return ol.format.XSD.readString(node);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.WFS');
|
goog.provide('ol.format.WFS');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.format.GML3');
|
goog.require('ol.format.GML3');
|
||||||
goog.require('ol.format.GMLBase');
|
goog.require('ol.format.GMLBase');
|
||||||
@@ -180,10 +179,10 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
|||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
|
ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be DOCUMENT');
|
'doc.nodeType should be DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFeatureCollectionMetadataFromNode(n);
|
return this.readFeatureCollectionMetadataFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,7 +209,7 @@ ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
|
|||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'FeatureCollection',
|
goog.asserts.assert(node.localName == 'FeatureCollection',
|
||||||
'localName should be FeatureCollection');
|
'localName should be FeatureCollection');
|
||||||
@@ -321,10 +320,10 @@ ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_ = {
|
|||||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be DOCUMENT');
|
'doc.nodeType should be DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readTransactionResponseFromNode(n);
|
return this.readTransactionResponseFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,7 +336,7 @@ ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
|||||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
|
ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'TransactionResponse',
|
goog.asserts.assert(node.localName == 'TransactionResponse',
|
||||||
'localName should be TransactionResponse');
|
'localName should be TransactionResponse');
|
||||||
@@ -910,10 +909,10 @@ ol.format.WFS.prototype.readProjection;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be a DOCUMENT');
|
'doc.nodeType should be a DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readProjectionFromNode(n);
|
return this.readProjectionFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -925,7 +924,7 @@ ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readProjectionFromNode = function(node) {
|
ol.format.WFS.prototype.readProjectionFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'FeatureCollection',
|
goog.asserts.assert(node.localName == 'FeatureCollection',
|
||||||
'localName should be FeatureCollection');
|
'localName should be FeatureCollection');
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.WMSCapabilities');
|
goog.provide('ol.format.WMSCapabilities');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.format.XLink');
|
goog.require('ol.format.XLink');
|
||||||
goog.require('ol.format.XML');
|
goog.require('ol.format.XML');
|
||||||
@@ -45,10 +44,10 @@ ol.format.WMSCapabilities.prototype.read;
|
|||||||
* @return {Object} WMS Capability object.
|
* @return {Object} WMS Capability object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
|
ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be DOCUMENT');
|
'doc.nodeType should be DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +60,7 @@ ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
|
|||||||
* @return {Object} WMS Capability object.
|
* @return {Object} WMS Capability object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
|
ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'WMS_Capabilities' ||
|
goog.asserts.assert(node.localName == 'WMS_Capabilities' ||
|
||||||
node.localName == 'WMT_MS_Capabilities',
|
node.localName == 'WMT_MS_Capabilities',
|
||||||
@@ -82,7 +81,7 @@ ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Attribution',
|
goog.asserts.assert(node.localName == 'Attribution',
|
||||||
'localName should be Attribution');
|
'localName should be Attribution');
|
||||||
@@ -98,7 +97,7 @@ ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
|
|||||||
* @return {Object} Bounding box object.
|
* @return {Object} Bounding box object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'BoundingBox',
|
goog.asserts.assert(node.localName == 'BoundingBox',
|
||||||
'localName should be BoundingBox');
|
'localName should be BoundingBox');
|
||||||
@@ -130,7 +129,7 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
|||||||
* @return {ol.Extent|undefined} Bounding box object.
|
* @return {ol.Extent|undefined} Bounding box object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'EX_GeographicBoundingBox',
|
goog.asserts.assert(node.localName == 'EX_GeographicBoundingBox',
|
||||||
'localName should be EX_GeographicBoundingBox');
|
'localName should be EX_GeographicBoundingBox');
|
||||||
@@ -167,7 +166,7 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectSt
|
|||||||
* @return {Object|undefined} Capability object.
|
* @return {Object|undefined} Capability object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Capability',
|
goog.asserts.assert(node.localName == 'Capability',
|
||||||
'localName should be Capability');
|
'localName should be Capability');
|
||||||
@@ -183,7 +182,7 @@ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Service object.
|
* @return {Object|undefined} Service object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Service',
|
goog.asserts.assert(node.localName == 'Service',
|
||||||
'localName should be Service');
|
'localName should be Service');
|
||||||
@@ -199,7 +198,7 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Contact information object.
|
* @return {Object|undefined} Contact information object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType shpuld be ELEMENT');
|
'node.nodeType shpuld be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ContactInformation',
|
goog.asserts.assert(node.localName == 'ContactInformation',
|
||||||
'localName should be ContactInformation');
|
'localName should be ContactInformation');
|
||||||
@@ -216,7 +215,7 @@ ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack)
|
|||||||
* @return {Object|undefined} Contact person object.
|
* @return {Object|undefined} Contact person object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ContactPersonPrimary',
|
goog.asserts.assert(node.localName == 'ContactPersonPrimary',
|
||||||
'localName should be ContactPersonPrimary');
|
'localName should be ContactPersonPrimary');
|
||||||
@@ -233,7 +232,7 @@ ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack
|
|||||||
* @return {Object|undefined} Contact address object.
|
* @return {Object|undefined} Contact address object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'ContactAddress',
|
goog.asserts.assert(node.localName == 'ContactAddress',
|
||||||
'localName should be ContactAddress');
|
'localName should be ContactAddress');
|
||||||
@@ -250,7 +249,7 @@ ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
|
|||||||
* @return {Array.<string>|undefined} Format array.
|
* @return {Array.<string>|undefined} Format array.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Exception',
|
goog.asserts.assert(node.localName == 'Exception',
|
||||||
'localName should be Exception');
|
'localName should be Exception');
|
||||||
@@ -266,7 +265,7 @@ ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
@@ -281,7 +280,7 @@ ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
||||||
var parentLayerObject = /** @type {Object.<string,*>} */
|
var parentLayerObject = /** @type {Object.<string,*>} */
|
||||||
@@ -363,7 +362,7 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
|||||||
* @return {Object} Dimension object.
|
* @return {Object} Dimension object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Dimension',
|
goog.asserts.assert(node.localName == 'Dimension',
|
||||||
'localName should be Dimension');
|
'localName should be Dimension');
|
||||||
@@ -390,7 +389,7 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
|
{}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
|
||||||
@@ -405,7 +404,7 @@ ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack
|
|||||||
* @return {Object|undefined} Request object.
|
* @return {Object|undefined} Request object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Request',
|
goog.asserts.assert(node.localName == 'Request',
|
||||||
'localName should be Request');
|
'localName should be Request');
|
||||||
@@ -421,7 +420,7 @@ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} DCP type object.
|
* @return {Object|undefined} DCP type object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'DCPType',
|
goog.asserts.assert(node.localName == 'DCPType',
|
||||||
'localName should be DCPType');
|
'localName should be DCPType');
|
||||||
@@ -437,7 +436,7 @@ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} HTTP object.
|
* @return {Object|undefined} HTTP object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
goog.asserts.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
@@ -452,7 +451,7 @@ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Operation type object.
|
* @return {Object|undefined} Operation type object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
|
||||||
@@ -466,7 +465,7 @@ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var formatOnlineresource =
|
var formatOnlineresource =
|
||||||
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||||
@@ -489,7 +488,7 @@ ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, object
|
|||||||
* @return {Object|undefined} Authority URL object.
|
* @return {Object|undefined} Authority URL object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'AuthorityURL',
|
goog.asserts.assert(node.localName == 'AuthorityURL',
|
||||||
'localName should be AuthorityURL');
|
'localName should be AuthorityURL');
|
||||||
@@ -510,7 +509,7 @@ ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Metadata URL object.
|
* @return {Object|undefined} Metadata URL object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'MetadataURL',
|
goog.asserts.assert(node.localName == 'MetadataURL',
|
||||||
'localName should be MetadataURL');
|
'localName should be MetadataURL');
|
||||||
@@ -531,7 +530,7 @@ ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
@@ -546,7 +545,7 @@ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
|
|||||||
* @return {Array.<string>|undefined} Keyword list.
|
* @return {Array.<string>|undefined} Keyword list.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'KeywordList',
|
goog.asserts.assert(node.localName == 'KeywordList',
|
||||||
'localName should be KeywordList');
|
'localName should be KeywordList');
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.WMSGetFeatureInfo');
|
goog.provide('ol.format.WMSGetFeatureInfo');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.format.GML2');
|
goog.require('ol.format.GML2');
|
||||||
goog.require('ol.format.XMLFeature');
|
goog.require('ol.format.XMLFeature');
|
||||||
@@ -73,7 +72,7 @@ ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer';
|
|||||||
ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack) {
|
ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack) {
|
||||||
|
|
||||||
node.setAttribute('namespaceURI', this.featureNS_);
|
node.setAttribute('namespaceURI', this.featureNS_);
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
var localName = node.localName;
|
var localName = node.localName;
|
||||||
/** @type {Array.<ol.Feature>} */
|
/** @type {Array.<ol.Feature>} */
|
||||||
@@ -84,7 +83,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
|
|||||||
if (localName == 'msGMLOutput') {
|
if (localName == 'msGMLOutput') {
|
||||||
for (var i = 0, ii = node.childNodes.length; i < ii; i++) {
|
for (var i = 0, ii = node.childNodes.length; i < ii; i++) {
|
||||||
var layer = node.childNodes[i];
|
var layer = node.childNodes[i];
|
||||||
if (layer.nodeType !== goog.dom.NodeType.ELEMENT) {
|
if (layer.nodeType !== Node.ELEMENT_NODE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var context = objectStack[0];
|
var context = objectStack[0];
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.WMTSCapabilities');
|
goog.provide('ol.format.WMTSCapabilities');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.format.OWS');
|
goog.require('ol.format.OWS');
|
||||||
goog.require('ol.format.XLink');
|
goog.require('ol.format.XLink');
|
||||||
@@ -46,10 +45,10 @@ ol.format.WMTSCapabilities.prototype.read;
|
|||||||
* @return {Object} WMTS Capability object.
|
* @return {Object} WMTS Capability object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
|
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
|
||||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||||
'doc.nodeType should be DOCUMENT');
|
'doc.nodeType should be DOCUMENT');
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +61,7 @@ ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
|
|||||||
* @return {Object} WMTS Capability object.
|
* @return {Object} WMTS Capability object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Capabilities',
|
goog.asserts.assert(node.localName == 'Capabilities',
|
||||||
'localName should be Capabilities');
|
'localName should be Capabilities');
|
||||||
@@ -86,7 +85,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
|
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Contents',
|
goog.asserts.assert(node.localName == 'Contents',
|
||||||
'localName should be Contents');
|
'localName should be Contents');
|
||||||
@@ -103,7 +102,7 @@ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layers object.
|
* @return {Object|undefined} Layers object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
|
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
goog.asserts.assert(node.localName == 'Layer', 'localName should be Layer');
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.XMLFeature');
|
goog.provide('ol.format.XMLFeature');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
goog.require('ol.format.FormatType');
|
goog.require('ol.format.FormatType');
|
||||||
@@ -113,7 +112,7 @@ ol.format.XMLFeature.prototype.readFeaturesFromDocument = function(
|
|||||||
var features = [];
|
var features = [];
|
||||||
var n;
|
var n;
|
||||||
for (n = doc.firstChild; n; n = n.nextSibling) {
|
for (n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
ol.array.extend(features, this.readFeaturesFromNode(n, opt_options));
|
ol.array.extend(features, this.readFeaturesFromNode(n, opt_options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,7 +209,7 @@ ol.format.XMLFeature.prototype.readProjectionFromNode = function(node) {
|
|||||||
*/
|
*/
|
||||||
ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
|
ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||||
var node = this.writeFeatureNode(feature, opt_options);
|
var node = this.writeFeatureNode(feature, opt_options);
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
@@ -230,7 +229,7 @@ ol.format.XMLFeature.prototype.writeFeatureNode = goog.abstractMethod;
|
|||||||
*/
|
*/
|
||||||
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||||
var node = this.writeFeaturesNode(features, opt_options);
|
var node = this.writeFeaturesNode(features, opt_options);
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
@@ -249,7 +248,7 @@ ol.format.XMLFeature.prototype.writeFeaturesNode = goog.abstractMethod;
|
|||||||
*/
|
*/
|
||||||
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||||
var node = this.writeGeometryNode(geometry, opt_options);
|
var node = this.writeGeometryNode(geometry, opt_options);
|
||||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ goog.provide('ol.MapProperty');
|
|||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.async.nextTick');
|
goog.require('goog.async.nextTick');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.CollectionEventType');
|
goog.require('ol.CollectionEventType');
|
||||||
@@ -25,6 +24,7 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
|
goog.require('ol.dom');
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.Event');
|
goog.require('ol.events.Event');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
@@ -742,7 +742,13 @@ ol.Map.prototype.getTarget = function() {
|
|||||||
*/
|
*/
|
||||||
ol.Map.prototype.getTargetElement = function() {
|
ol.Map.prototype.getTargetElement = function() {
|
||||||
var target = this.getTarget();
|
var target = this.getTarget();
|
||||||
return target !== undefined ? goog.dom.getElement(target) : null;
|
if (target !== undefined) {
|
||||||
|
return typeof target === 'string' ?
|
||||||
|
document.getElementById(target) :
|
||||||
|
target;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1070,7 +1076,7 @@ ol.Map.prototype.handleTargetChanged_ = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!targetElement) {
|
if (!targetElement) {
|
||||||
goog.dom.removeNode(this.viewport_);
|
ol.dom.removeNode(this.viewport_);
|
||||||
if (this.handleResize_ !== undefined) {
|
if (this.handleResize_ !== undefined) {
|
||||||
ol.global.removeEventListener(ol.events.EventType.RESIZE,
|
ol.global.removeEventListener(ol.events.EventType.RESIZE,
|
||||||
this.handleResize_, false);
|
this.handleResize_, false);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ goog.provide('ol.OverlayPositioning');
|
|||||||
goog.provide('ol.OverlayProperty');
|
goog.provide('ol.OverlayProperty');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.MapEventType');
|
goog.require('ol.MapEventType');
|
||||||
@@ -252,7 +251,7 @@ ol.Overlay.prototype.getPositioning = function() {
|
|||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
ol.Overlay.prototype.handleElementChanged = function() {
|
ol.Overlay.prototype.handleElementChanged = function() {
|
||||||
goog.dom.removeChildren(this.element_);
|
ol.dom.removeChildren(this.element_);
|
||||||
var element = this.getElement();
|
var element = this.getElement();
|
||||||
if (element) {
|
if (element) {
|
||||||
this.element_.appendChild(element);
|
this.element_.appendChild(element);
|
||||||
@@ -265,7 +264,7 @@ ol.Overlay.prototype.handleElementChanged = function() {
|
|||||||
*/
|
*/
|
||||||
ol.Overlay.prototype.handleMapChanged = function() {
|
ol.Overlay.prototype.handleMapChanged = function() {
|
||||||
if (this.mapPostrenderListenerKey_) {
|
if (this.mapPostrenderListenerKey_) {
|
||||||
goog.dom.removeNode(this.element_);
|
ol.dom.removeNode(this.element_);
|
||||||
ol.events.unlistenByKey(this.mapPostrenderListenerKey_);
|
ol.events.unlistenByKey(this.mapPostrenderListenerKey_);
|
||||||
this.mapPostrenderListenerKey_ = null;
|
this.mapPostrenderListenerKey_ = null;
|
||||||
}
|
}
|
||||||
@@ -277,7 +276,7 @@ ol.Overlay.prototype.handleMapChanged = function() {
|
|||||||
var container = this.stopEvent_ ?
|
var container = this.stopEvent_ ?
|
||||||
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
||||||
if (this.insertFirst_) {
|
if (this.insertFirst_) {
|
||||||
goog.dom.insertChildAt(container, this.element_, 0);
|
container.insertBefore(this.element_, container.childNodes[0] || null);
|
||||||
} else {
|
} else {
|
||||||
container.appendChild(this.element_);
|
container.appendChild(this.element_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
goog.provide('ol.pointer.PointerEventHandler');
|
goog.provide('ol.pointer.PointerEventHandler');
|
||||||
|
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventTarget');
|
goog.require('ol.events.EventTarget');
|
||||||
|
|
||||||
@@ -334,10 +333,10 @@ ol.pointer.PointerEventHandler.prototype.enterOver = function(data, event) {
|
|||||||
* contains the other element.
|
* contains the other element.
|
||||||
*/
|
*/
|
||||||
ol.pointer.PointerEventHandler.prototype.contains_ = function(container, contained) {
|
ol.pointer.PointerEventHandler.prototype.contains_ = function(container, contained) {
|
||||||
if (!contained) {
|
if (!container || !contained) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return goog.dom.contains(container, contained);
|
return container.contains(contained);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
goog.provide('ol.renderer.canvas.Map');
|
goog.provide('ol.renderer.canvas.Map');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.RendererType');
|
goog.require('ol.RendererType');
|
||||||
@@ -54,7 +53,7 @@ ol.renderer.canvas.Map = function(container, map) {
|
|||||||
this.canvas_.style.width = '100%';
|
this.canvas_.style.width = '100%';
|
||||||
this.canvas_.style.height = '100%';
|
this.canvas_.style.height = '100%';
|
||||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||||
goog.dom.insertChildAt(container, this.canvas_, 0);
|
container.insertBefore(this.canvas_, container.childNodes[0] || null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.renderer.dom.ImageLayer');
|
goog.provide('ol.renderer.dom.ImageLayer');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('ol.ImageBase');
|
goog.require('ol.ImageBase');
|
||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
@@ -66,7 +65,7 @@ ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coord
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.renderer.dom.ImageLayer.prototype.clearFrame = function() {
|
ol.renderer.dom.ImageLayer.prototype.clearFrame = function() {
|
||||||
goog.dom.removeChildren(this.target);
|
ol.dom.removeChildren(this.target);
|
||||||
this.image_ = null;
|
this.image_ = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,7 +132,7 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame = function(frameState, layerSt
|
|||||||
// overriding the max-width style.
|
// overriding the max-width style.
|
||||||
imageElement.style.maxWidth = 'none';
|
imageElement.style.maxWidth = 'none';
|
||||||
imageElement.style.position = 'absolute';
|
imageElement.style.position = 'absolute';
|
||||||
goog.dom.removeChildren(this.target);
|
ol.dom.removeChildren(this.target);
|
||||||
this.target.appendChild(imageElement);
|
this.target.appendChild(imageElement);
|
||||||
this.image_ = image;
|
this.image_ = image;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.renderer.dom.Map');
|
goog.provide('ol.renderer.dom.Map');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.Event');
|
goog.require('ol.events.Event');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
@@ -47,7 +46,7 @@ ol.renderer.dom.Map = function(container, map) {
|
|||||||
canvas.style.width = '100%';
|
canvas.style.width = '100%';
|
||||||
canvas.style.height = '100%';
|
canvas.style.height = '100%';
|
||||||
canvas.className = ol.css.CLASS_UNSELECTABLE;
|
canvas.className = ol.css.CLASS_UNSELECTABLE;
|
||||||
goog.dom.insertChildAt(container, canvas, 0);
|
container.insertBefore(canvas, container.childNodes[0] || null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -70,7 +69,7 @@ ol.renderer.dom.Map = function(container, map) {
|
|||||||
ol.events.listen(this.layersPane_, ol.events.EventType.TOUCHSTART,
|
ol.events.listen(this.layersPane_, ol.events.EventType.TOUCHSTART,
|
||||||
ol.events.Event.preventDefault);
|
ol.events.Event.preventDefault);
|
||||||
|
|
||||||
goog.dom.insertChildAt(container, this.layersPane_, 0);
|
container.insertBefore(this.layersPane_, container.childNodes[0] || null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -86,7 +85,7 @@ ol.inherits(ol.renderer.dom.Map, ol.renderer.Map);
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.renderer.dom.Map.prototype.disposeInternal = function() {
|
ol.renderer.dom.Map.prototype.disposeInternal = function() {
|
||||||
goog.dom.removeNode(this.layersPane_);
|
ol.dom.removeNode(this.layersPane_);
|
||||||
ol.renderer.Map.prototype.disposeInternal.call(this);
|
ol.renderer.Map.prototype.disposeInternal.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -185,7 +184,7 @@ ol.renderer.dom.Map.prototype.renderFrame = function(frameState) {
|
|||||||
this.getLayerRenderer(layer));
|
this.getLayerRenderer(layer));
|
||||||
goog.asserts.assertInstanceof(layerRenderer, ol.renderer.dom.Layer,
|
goog.asserts.assertInstanceof(layerRenderer, ol.renderer.dom.Layer,
|
||||||
'renderer is an instance of ol.renderer.dom.Layer');
|
'renderer is an instance of ol.renderer.dom.Layer');
|
||||||
goog.dom.insertChildAt(this.layersPane_, layerRenderer.getTarget(), i);
|
this.layersPane_.insertBefore(layerRenderer.getTarget(), this.layersPane_.childNodes[i] || null);
|
||||||
if (ol.layer.Layer.visibleAtResolution(layerState, viewResolution) &&
|
if (ol.layer.Layer.visibleAtResolution(layerState, viewResolution) &&
|
||||||
layerState.sourceState == ol.source.State.READY) {
|
layerState.sourceState == ol.source.State.READY) {
|
||||||
if (layerRenderer.prepareFrame(frameState, layerState)) {
|
if (layerRenderer.prepareFrame(frameState, layerState)) {
|
||||||
@@ -203,7 +202,7 @@ ol.renderer.dom.Map.prototype.renderFrame = function(frameState) {
|
|||||||
layerRenderer = this.getLayerRendererByKey(layerKey);
|
layerRenderer = this.getLayerRendererByKey(layerKey);
|
||||||
goog.asserts.assertInstanceof(layerRenderer, ol.renderer.dom.Layer,
|
goog.asserts.assertInstanceof(layerRenderer, ol.renderer.dom.Layer,
|
||||||
'renderer is an instance of ol.renderer.dom.Layer');
|
'renderer is an instance of ol.renderer.dom.Layer');
|
||||||
goog.dom.removeNode(layerRenderer.getTarget());
|
ol.dom.removeNode(layerRenderer.getTarget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
goog.provide('ol.renderer.dom.TileLayer');
|
goog.provide('ol.renderer.dom.TileLayer');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.TileRange');
|
goog.require('ol.TileRange');
|
||||||
@@ -64,7 +63,7 @@ ol.inherits(ol.renderer.dom.TileLayer, ol.renderer.dom.Layer);
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.renderer.dom.TileLayer.prototype.clearFrame = function() {
|
ol.renderer.dom.TileLayer.prototype.clearFrame = function() {
|
||||||
goog.dom.removeChildren(this.target);
|
ol.dom.removeChildren(this.target);
|
||||||
this.renderedRevision_ = 0;
|
this.renderedRevision_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -164,7 +163,7 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame = function(frameState, layerSta
|
|||||||
if (this.renderedRevision_ != tileSource.getRevision()) {
|
if (this.renderedRevision_ != tileSource.getRevision()) {
|
||||||
for (tileLayerZKey in this.tileLayerZs_) {
|
for (tileLayerZKey in this.tileLayerZs_) {
|
||||||
tileLayerZ = this.tileLayerZs_[+tileLayerZKey];
|
tileLayerZ = this.tileLayerZs_[+tileLayerZKey];
|
||||||
goog.dom.removeNode(tileLayerZ.target);
|
ol.dom.removeNode(tileLayerZ.target);
|
||||||
}
|
}
|
||||||
this.tileLayerZs_ = {};
|
this.tileLayerZs_ = {};
|
||||||
this.renderedRevision_ = tileSource.getRevision();
|
this.renderedRevision_ = tileSource.getRevision();
|
||||||
@@ -206,7 +205,7 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame = function(frameState, layerSta
|
|||||||
tileLayerZKey = tileLayerZKeys[i];
|
tileLayerZKey = tileLayerZKeys[i];
|
||||||
tileLayerZ = this.tileLayerZs_[tileLayerZKey];
|
tileLayerZ = this.tileLayerZs_[tileLayerZKey];
|
||||||
if (!(tileLayerZKey in tilesToDrawByZ)) {
|
if (!(tileLayerZKey in tilesToDrawByZ)) {
|
||||||
goog.dom.removeNode(tileLayerZ.target);
|
ol.dom.removeNode(tileLayerZ.target);
|
||||||
delete this.tileLayerZs_[tileLayerZKey];
|
delete this.tileLayerZs_[tileLayerZKey];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -223,13 +222,14 @@ ol.renderer.dom.TileLayer.prototype.prepareFrame = function(frameState, layerSta
|
|||||||
if (tileLayerZKey in newTileLayerZKeys) {
|
if (tileLayerZKey in newTileLayerZKeys) {
|
||||||
for (j = tileLayerZKey - 1; j >= 0; --j) {
|
for (j = tileLayerZKey - 1; j >= 0; --j) {
|
||||||
if (j in this.tileLayerZs_) {
|
if (j in this.tileLayerZs_) {
|
||||||
goog.dom.insertSiblingAfter(
|
if (this.tileLayerZs_[j].target.parentNode) {
|
||||||
tileLayerZ.target, this.tileLayerZs_[j].target);
|
this.tileLayerZs_[j].target.parentNode.insertBefore(tileLayerZ.target, this.tileLayerZs_[j].target.nextSibling);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (j < 0) {
|
if (j < 0) {
|
||||||
goog.dom.insertChildAt(this.target, tileLayerZ.target, 0);
|
this.target.insertBefore(tileLayerZ.target, this.target.childNodes[0] || null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
if (!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
||||||
@@ -430,7 +430,7 @@ ol.renderer.dom.TileLayerZ_.prototype.removeTilesOutsideExtent = function(extent
|
|||||||
for (i = 0, ii = tilesToRemove.length; i < ii; ++i) {
|
for (i = 0, ii = tilesToRemove.length; i < ii; ++i) {
|
||||||
tile = tilesToRemove[i];
|
tile = tilesToRemove[i];
|
||||||
tileCoordKey = tile.tileCoord.toString();
|
tileCoordKey = tile.tileCoord.toString();
|
||||||
goog.dom.removeNode(tile.getImage(this));
|
ol.dom.removeNode(tile.getImage(this));
|
||||||
delete this.tiles_[tileCoordKey];
|
delete this.tiles_[tileCoordKey];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
goog.provide('ol.renderer.webgl.Map');
|
goog.provide('ol.renderer.webgl.Map');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.webgl');
|
goog.require('goog.webgl');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.RendererType');
|
goog.require('ol.RendererType');
|
||||||
@@ -51,7 +50,7 @@ ol.renderer.webgl.Map = function(container, map) {
|
|||||||
this.canvas_.style.width = '100%';
|
this.canvas_.style.width = '100%';
|
||||||
this.canvas_.style.height = '100%';
|
this.canvas_.style.height = '100%';
|
||||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||||
goog.dom.insertChildAt(container, this.canvas_, 0);
|
container.insertBefore(this.canvas_, container.childNodes[0] || null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.xml');
|
goog.provide('ol.xml');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom.NodeType');
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
|
|
||||||
|
|
||||||
@@ -48,8 +47,8 @@ ol.xml.getAllTextContent = function(node, normalizeWhitespace) {
|
|||||||
* @return {Array.<string>} Accumulator.
|
* @return {Array.<string>} Accumulator.
|
||||||
*/
|
*/
|
||||||
ol.xml.getAllTextContent_ = function(node, normalizeWhitespace, accumulator) {
|
ol.xml.getAllTextContent_ = function(node, normalizeWhitespace, accumulator) {
|
||||||
if (node.nodeType == goog.dom.NodeType.CDATA_SECTION ||
|
if (node.nodeType == Node.CDATA_SECTION_NODE ||
|
||||||
node.nodeType == goog.dom.NodeType.TEXT) {
|
node.nodeType == Node.TEXT_NODE) {
|
||||||
if (normalizeWhitespace) {
|
if (normalizeWhitespace) {
|
||||||
// FIXME understand why goog.dom.getTextContent_ uses String here
|
// FIXME understand why goog.dom.getTextContent_ uses String here
|
||||||
accumulator.push(String(node.nodeValue).replace(/(\r\n|\r|\n)/g, ''));
|
accumulator.push(String(node.nodeValue).replace(/(\r\n|\r|\n)/g, ''));
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ Below is a complete `build.json` configuration file that would generate a 'full'
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
|
|||||||
@@ -80,48 +80,46 @@ describe('expect.js', function() {
|
|||||||
it('Test XML document with single root, different prefix', function() {
|
it('Test XML document with single root, different prefix', function() {
|
||||||
var doc1 = '<bar:foo xmlns:bar="http://foo"></bar:foo>';
|
var doc1 = '<bar:foo xmlns:bar="http://foo"></bar:foo>';
|
||||||
var doc2 = '<foo xmlns="http://foo"></foo>';
|
var doc2 = '<foo xmlns="http://foo"></foo>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2));
|
new DOMParser().parseFromString(doc2, 'application/xml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test XML document with single root, different prefix, prefix true',
|
it('Test XML document with single root, different prefix, prefix true',
|
||||||
function() {
|
function() {
|
||||||
var doc1 = '<bar:foo xmlns:bar="http://foo"></bar:foo>';
|
var doc1 = '<bar:foo xmlns:bar="http://foo"></bar:foo>';
|
||||||
var doc2 = '<foo xmlns="http://foo"></foo>';
|
var doc2 = '<foo xmlns="http://foo"></foo>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.not.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.not.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2), {prefix: true});
|
new DOMParser().parseFromString(doc2, 'application/xml'), {prefix: true});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test XML document with different root', function() {
|
it('Test XML document with different root', function() {
|
||||||
var doc1 = '<foo></foo>';
|
var doc1 = '<foo></foo>';
|
||||||
var doc2 = '<bar></bar>';
|
var doc2 = '<bar></bar>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.not.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.not.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2));
|
new DOMParser().parseFromString(doc2, 'application/xml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test different number of attributes', function() {
|
it('Test different number of attributes', function() {
|
||||||
var doc1 = '<foo attr="bla"></foo>';
|
var doc1 = '<foo attr="bla"></foo>';
|
||||||
var doc2 = '<foo></foo>';
|
var doc2 = '<foo></foo>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.not.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.not.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2));
|
new DOMParser().parseFromString(doc2, 'application/xml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test different attribute value', function() {
|
it('Test different attribute value', function() {
|
||||||
var doc1 = '<foo attr="bla"></foo>';
|
var doc1 = '<foo attr="bla"></foo>';
|
||||||
var doc2 = '<foo attr="foo"></foo>';
|
var doc2 = '<foo attr="foo"></foo>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.not.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.not.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2));
|
new DOMParser().parseFromString(doc2, 'application/xml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test different number of children', function() {
|
it('Test different number of children', function() {
|
||||||
var doc1 = '<foo><mynode></mynode></foo>';
|
var doc1 = '<foo><mynode></mynode></foo>';
|
||||||
var doc2 = '<foo></foo>';
|
var doc2 = '<foo></foo>';
|
||||||
expect(goog.dom.xml.loadXml(doc1)).to.not.xmleql(
|
expect(new DOMParser().parseFromString(doc1, 'application/xml')).to.not.xmleql(
|
||||||
goog.dom.xml.loadXml(doc2));
|
new DOMParser().parseFromString(doc2, 'application/xml'));
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dom.xml');
|
|
||||||
|
|||||||
@@ -2521,7 +2521,7 @@ describe('ol.format.KML', function() {
|
|||||||
describe('error handling', function() {
|
describe('error handling', function() {
|
||||||
|
|
||||||
it('should ignore invalid coordinates', function() {
|
it('should ignore invalid coordinates', function() {
|
||||||
var doc = goog.dom.xml.loadXml('<coordinates>INVALID</coordinates>');
|
var doc = new DOMParser().parseFromString('<coordinates>INVALID</coordinates>', 'application/xml');
|
||||||
var node = doc.firstChild;
|
var node = doc.firstChild;
|
||||||
expect(ol.format.KML.readFlatCoordinates_(node)).to.be(undefined);
|
expect(ol.format.KML.readFlatCoordinates_(node)).to.be(undefined);
|
||||||
});
|
});
|
||||||
@@ -2834,7 +2834,6 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('goog.dom.xml');
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.format.GeoJSON');
|
goog.require('ol.format.GeoJSON');
|
||||||
goog.require('ol.format.KML');
|
goog.require('ol.format.KML');
|
||||||
|
|||||||
Reference in New Issue
Block a user