@@ -1,5 +1,6 @@
|
||||
before_install:
|
||||
- "sudo pip install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz"
|
||||
- "sudo pip install regex"
|
||||
- "git clone --depth=50 https://github.com/jsdoc3/jsdoc build/jsdoc"
|
||||
- "git clone https://code.google.com/p/glsl-unit/ build/glsl-unit"
|
||||
|
||||
|
||||
14
build.py
14
build.py
@@ -5,7 +5,7 @@ import gzip
|
||||
import json
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import regex as re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
@@ -72,7 +72,10 @@ if sys.platform == 'win32':
|
||||
else:
|
||||
variables.GIT = 'git'
|
||||
variables.GJSLINT = 'gjslint'
|
||||
variables.JAVA = 'java'
|
||||
if sys.platform == 'darwin':
|
||||
variables.JAVA = '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
|
||||
else:
|
||||
variables.JAVA = 'java'
|
||||
variables.JAR = 'jar'
|
||||
variables.JSDOC = 'jsdoc'
|
||||
variables.NODE = 'node'
|
||||
@@ -142,8 +145,8 @@ SRC = [path
|
||||
if path.endswith('.js')
|
||||
if path not in SHADER_SRC]
|
||||
|
||||
PLOVR_JAR = 'build/plovr-eba786b34df9.jar'
|
||||
PLOVR_JAR_MD5 = '20eac8ccc4578676511cf7ccbfc65100'
|
||||
PLOVR_JAR = 'build/plovr-2013-rc3.jar'
|
||||
PLOVR_JAR_MD5 = '8690b431a7c257b8849ae7d0fa979537'
|
||||
|
||||
PROJ4JS = 'build/proj4js/lib/proj4js-combined.js'
|
||||
PROJ4JS_ZIP = 'build/proj4js-1.1.0.zip'
|
||||
@@ -312,7 +315,6 @@ def examples_star_json(name, match):
|
||||
'../externs/oli.js',
|
||||
'../externs/proj4js.js',
|
||||
'../externs/tilejson.js',
|
||||
'../externs/w3c_device_sensor_event.js',
|
||||
],
|
||||
})
|
||||
with open(t.name, 'w') as f:
|
||||
@@ -569,7 +571,7 @@ virtual('plovr', PLOVR_JAR)
|
||||
@target(PLOVR_JAR, clean=False)
|
||||
def plovr_jar(t):
|
||||
t.info('downloading %r', t.name)
|
||||
t.download('https://plovr.googlecode.com/files/' +
|
||||
t.download('http://plovr.com/' +
|
||||
os.path.basename(PLOVR_JAR), md5=PLOVR_JAR_MD5)
|
||||
t.info('downloaded %r', t.name)
|
||||
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
"../externs/geojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/tilejson.js"
|
||||
],
|
||||
|
||||
"level": "VERBOSE",
|
||||
@@ -99,7 +98,8 @@
|
||||
"goog.debug.logRecordSerializer",
|
||||
"goog.debug.makeWhitespaceVisible",
|
||||
"goog.debug.normalizeErrorObject",
|
||||
"goog.debug.reflect"
|
||||
"goog.debug.reflect",
|
||||
"goog.log"
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
"../externs/geojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/tilejson.js"
|
||||
],
|
||||
|
||||
"inherits": "base.json",
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
"../externs/geojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/tilejson.js"
|
||||
],
|
||||
|
||||
"inherits": "ol.json",
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
"../externs/geojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/tilejson.js"
|
||||
],
|
||||
|
||||
"inherits": "ol.json",
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
"../externs/geojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/tilejson.js"
|
||||
],
|
||||
|
||||
"inherits": "base.json",
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 The Closure Compiler Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Definitions for W3C's device orientation and device motion
|
||||
* events specification.
|
||||
* This file depends on w3c_event.js.
|
||||
* The whole file has been partially type annotated.
|
||||
* Created from http://dev.w3.org/geo/api/spec-source-orientation.
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {Event}
|
||||
*/
|
||||
function DeviceOrientationEvent() {}
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.alpha;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.beta;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.gamma;
|
||||
|
||||
/** @type {boolean} */
|
||||
DeviceOrientationEvent.prototype.absolute;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function DeviceAcceleration() {}
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceAcceleration.prototype.x;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceAcceleration.prototype.y;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceAcceleration.prototype.z;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function DeviceRotationRate() {}
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.alpha;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.beta;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceOrientationEvent.prototype.gamma;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {Event}
|
||||
*/
|
||||
function DeviceMotionEvent() {}
|
||||
|
||||
/** @type {?DeviceAcceleration} */
|
||||
DeviceMotionEvent.prototype.acceleration;
|
||||
|
||||
/** @type {?DeviceAcceleration} */
|
||||
DeviceMotionEvent.prototype.accelerationIncludingGravity;
|
||||
|
||||
/** @type {?DeviceRotationRate} */
|
||||
DeviceMotionEvent.prototype.rotationRate;
|
||||
|
||||
/** @type {?number} */
|
||||
DeviceMotionEvent.prototype.interval;
|
||||
@@ -15,7 +15,7 @@
|
||||
* @property {ol.Pixel} pixel Pixel coordinate relative to the map viewport.
|
||||
* @property {Array.<ol.layer.Layer>|undefined} layers Layers to restrict the
|
||||
* query to. All map layers will be queried if not provided.
|
||||
* @property {function(Array.<string|undefined>)} success Callback for
|
||||
* @property {function(Array.<Array.<string|undefined>>)} success Callback for
|
||||
* successful queries. The passed argument is the resulting feature
|
||||
* information for each layer, with array indices being the same as in the
|
||||
* passed `layers` array or in the layer collection as returned from
|
||||
|
||||
@@ -10,9 +10,15 @@ goog.require('goog.asserts');
|
||||
* @return {number} Index.
|
||||
*/
|
||||
ol.array.binaryFindNearest = function(arr, target) {
|
||||
var index = goog.array.binarySearch(arr, target, function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
var index = goog.array.binarySearch(arr, target,
|
||||
/**
|
||||
* @param {number} a A.
|
||||
* @param {number} b B.
|
||||
* @return {number} b minus a.
|
||||
*/
|
||||
function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
if (index >= 0) {
|
||||
return index;
|
||||
} else if (index == -1) {
|
||||
|
||||
@@ -126,7 +126,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
|
||||
if (goog.isNull(frameState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.element, false);
|
||||
goog.style.setElementShown(this.element, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -142,14 +142,15 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
for (attributionKey in this.attributionElements_) {
|
||||
if (attributionKey in visibleAttributions) {
|
||||
if (!this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
goog.style.showElement(this.attributionElements_[attributionKey], true);
|
||||
goog.style.setElementShown(
|
||||
this.attributionElements_[attributionKey], true);
|
||||
this.attributionElementRenderedVisible_[attributionKey] = true;
|
||||
}
|
||||
delete visibleAttributions[attributionKey];
|
||||
}
|
||||
else if (attributionKey in hiddenAttributions) {
|
||||
if (this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
goog.style.showElement(
|
||||
goog.style.setElementShown(
|
||||
this.attributionElements_[attributionKey], false);
|
||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||
}
|
||||
@@ -173,7 +174,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
attributionElement = goog.dom.createElement(goog.dom.TagName.LI);
|
||||
attributionElement.innerHTML =
|
||||
hiddenAttributions[attributionKey].getHTML();
|
||||
goog.style.showElement(attributionElement, false);
|
||||
goog.style.setElementShown(attributionElement, false);
|
||||
goog.dom.appendChild(this.ulElement_, attributionElement);
|
||||
this.attributionElements_[attributionKey] = attributionElement;
|
||||
}
|
||||
@@ -181,7 +182,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
var renderVisible =
|
||||
!goog.object.isEmpty(this.attributionElementRenderedVisible_);
|
||||
if (this.renderedVisible_ != renderVisible) {
|
||||
goog.style.showElement(this.element, renderVisible);
|
||||
goog.style.setElementShown(this.element, renderVisible);
|
||||
this.renderedVisible_ = renderVisible;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ ol.control.Logo.prototype.updateElement_ = function(frameState) {
|
||||
|
||||
if (goog.isNull(frameState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.element, false);
|
||||
goog.style.setElementShown(this.element, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ ol.control.Logo.prototype.updateElement_ = function(frameState) {
|
||||
|
||||
var renderVisible = !goog.object.isEmpty(logos);
|
||||
if (this.renderedVisible_ != renderVisible) {
|
||||
goog.style.showElement(this.element, renderVisible);
|
||||
goog.style.setElementShown(this.element, renderVisible);
|
||||
this.renderedVisible_ = renderVisible;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
|
||||
if (goog.isNull(view2DState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.element_, false);
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -322,7 +322,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.showElement(this.element_, true);
|
||||
goog.style.setElementShown(this.element_, true);
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ ol.DeviceOrientation = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?number}
|
||||
* @type {goog.events.Key}
|
||||
*/
|
||||
this.listenerKey_ = null;
|
||||
|
||||
|
||||
@@ -215,7 +215,9 @@ ol.extent.getForView2DAndSize =
|
||||
var dy = resolution * size[1] / 2;
|
||||
var cosRotation = Math.cos(rotation);
|
||||
var sinRotation = Math.sin(rotation);
|
||||
/** @type {Array.<number>} */
|
||||
var xs = [-dx, -dx, dx, dx];
|
||||
/** @type {Array.<number>} */
|
||||
var ys = [-dy, dy, -dy, dy];
|
||||
var i, x, y;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
|
||||
@@ -87,7 +87,7 @@ ol.geom2.LineStringCollection.pack =
|
||||
goog.asserts.assert(unpackedLineStrings[i].length > 1);
|
||||
start = offset;
|
||||
offset = ol.geom2.packPoints(arr, offset, unpackedLineStrings[i], dim);
|
||||
ranges[/** @type {string} */ (start)] = offset;
|
||||
ranges[start + ''] = offset;
|
||||
}
|
||||
goog.asserts.assert(offset <= capacity);
|
||||
var buf = new ol.structs.Buffer(arr, offset);
|
||||
@@ -103,7 +103,7 @@ ol.geom2.LineStringCollection.prototype.add = function(lineString) {
|
||||
var n = lineString.length * this.dim;
|
||||
var offset = this.buf.allocate(n);
|
||||
goog.asserts.assert(offset != -1);
|
||||
this.ranges[/** @type {string} */ (offset)] = offset + n;
|
||||
this.ranges[offset + ''] = offset + n;
|
||||
ol.geom2.packPoints(this.buf.getArray(), offset, lineString, this.dim);
|
||||
return offset;
|
||||
};
|
||||
@@ -115,7 +115,7 @@ ol.geom2.LineStringCollection.prototype.add = function(lineString) {
|
||||
*/
|
||||
ol.geom2.LineStringCollection.prototype.get = function(offset) {
|
||||
goog.asserts.assert(offset in this.ranges);
|
||||
var range = this.ranges[/** @type {string} */ (offset)];
|
||||
var range = this.ranges[offset + ''];
|
||||
return ol.geom2.unpackPoints(
|
||||
this.buf.getArray(), offset, range, this.dim);
|
||||
};
|
||||
@@ -165,9 +165,9 @@ ol.geom2.LineStringCollection.prototype.getIndices = function() {
|
||||
*/
|
||||
ol.geom2.LineStringCollection.prototype.remove = function(offset) {
|
||||
goog.asserts.assert(offset in this.ranges);
|
||||
var range = this.ranges[/** @type {string} */ (offset)];
|
||||
var range = this.ranges[offset + ''];
|
||||
this.buf.remove(range - offset, offset);
|
||||
delete this.ranges[/** @type {string} */ (offset)];
|
||||
delete this.ranges[offset + ''];
|
||||
};
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ ol.geom2.LineStringCollection.prototype.remove = function(offset) {
|
||||
ol.geom2.LineStringCollection.prototype.set = function(offset, lineString) {
|
||||
var dim = this.dim;
|
||||
goog.asserts.assert(offset in this.ranges);
|
||||
var range = this.ranges[/** @type {string} */ (offset)];
|
||||
var range = this.ranges[offset + ''];
|
||||
if (lineString.length * dim == range - offset) {
|
||||
ol.geom2.packPoints(this.buf.getArray(), offset, lineString, dim);
|
||||
this.buf.markDirty(range - offset, offset);
|
||||
|
||||
@@ -34,6 +34,8 @@ ol.ImageState = {
|
||||
*/
|
||||
ol.Image = function(extent, resolution, src, crossOrigin, attributions) {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<ol.Attribution>}
|
||||
|
||||
@@ -108,10 +108,15 @@ ol.Kinetic.prototype.pan = function(source) {
|
||||
var initialVelocity = this.initialVelocity_;
|
||||
var minVelocity = this.minVelocity_;
|
||||
var duration = this.getDuration_();
|
||||
var easingFunction = function(t) {
|
||||
return initialVelocity * (Math.exp((decay * t) * duration) - 1) /
|
||||
(minVelocity - initialVelocity);
|
||||
};
|
||||
var easingFunction = (
|
||||
/**
|
||||
* @param {number} t T.
|
||||
* @return {number} Easing.
|
||||
*/
|
||||
function(t) {
|
||||
return initialVelocity * (Math.exp((decay * t) * duration) - 1) /
|
||||
(minVelocity - initialVelocity);
|
||||
});
|
||||
return ol.animation.pan({
|
||||
source: source,
|
||||
duration: duration,
|
||||
|
||||
@@ -54,11 +54,17 @@ ol.layer.Layer = function(options) {
|
||||
var values = goog.object.clone(options);
|
||||
delete values.source;
|
||||
|
||||
/** @type {number} */
|
||||
values.brightness = goog.isDef(values.brightness) ? values.brightness : 0;
|
||||
/** @type {number} */
|
||||
values.contrast = goog.isDef(values.contrast) ? values.contrast : 1;
|
||||
/** @type {number} */
|
||||
values.hue = goog.isDef(values.hue) ? values.hue : 0;
|
||||
/** @type {number} */
|
||||
values.opacity = goog.isDef(values.opacity) ? values.opacity : 1;
|
||||
/** @type {number} */
|
||||
values.saturation = goog.isDef(values.saturation) ? values.saturation : 1;
|
||||
/** @type {boolean} */
|
||||
values.visible = goog.isDef(values.visible) ? values.visible : true;
|
||||
|
||||
this.setValues(values);
|
||||
|
||||
@@ -13,8 +13,6 @@ goog.require('goog.asserts');
|
||||
goog.require('goog.async.AnimationDelay');
|
||||
goog.require('goog.async.Delay');
|
||||
goog.require('goog.debug.Console');
|
||||
goog.require('goog.debug.Logger');
|
||||
goog.require('goog.debug.Logger.Level');
|
||||
goog.require('goog.dispose');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
@@ -27,6 +25,8 @@ goog.require('goog.events.KeyHandler');
|
||||
goog.require('goog.events.KeyHandler.EventType');
|
||||
goog.require('goog.events.MouseWheelHandler');
|
||||
goog.require('goog.events.MouseWheelHandler.EventType');
|
||||
goog.require('goog.log');
|
||||
goog.require('goog.log.Level');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.style');
|
||||
goog.require('goog.vec.Mat4');
|
||||
@@ -196,7 +196,7 @@ ol.Map = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?number}
|
||||
* @type {goog.events.Key}
|
||||
*/
|
||||
this.viewPropertyListenerKey_ = null;
|
||||
|
||||
@@ -1169,7 +1169,7 @@ ol.proj.addCommonProjections();
|
||||
if (goog.DEBUG) {
|
||||
(function() {
|
||||
goog.debug.Console.autoInstall();
|
||||
var logger = goog.debug.Logger.getLogger('ol');
|
||||
logger.setLevel(goog.debug.Logger.Level.FINEST);
|
||||
var logger = goog.log.getLogger('ol');
|
||||
logger.setLevel(goog.log.Level.FINEST);
|
||||
})();
|
||||
}
|
||||
|
||||
@@ -49,20 +49,6 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) {
|
||||
goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
|
||||
|
||||
|
||||
/**
|
||||
* IE specific events.
|
||||
* See http://msdn.microsoft.com/en-us/library/ie/hh673557(v=vs.85).aspx
|
||||
* FIXME: replace with goog.events.EventType enum once we use
|
||||
* goog/events/eventtype.js above r2211
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.MapBrowserEvent.IEEventType = {
|
||||
MSPOINTERDOWN: 'MSPointerDown',
|
||||
MSPOINTERMOVE: 'MSPointerMove',
|
||||
MSPOINTERUP: 'MSPointerUp'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Coordinate} Coordinate.
|
||||
*/
|
||||
@@ -203,15 +189,15 @@ ol.MapBrowserEventHandler = function(map) {
|
||||
this.touchListenerKeys_ = [
|
||||
goog.events.listen(element, [
|
||||
goog.events.EventType.TOUCHSTART,
|
||||
ol.MapBrowserEvent.IEEventType.MSPOINTERDOWN
|
||||
goog.events.EventType.MSPOINTERDOWN
|
||||
], this.handleTouchStart_, false, this),
|
||||
goog.events.listen(element, [
|
||||
goog.events.EventType.TOUCHMOVE,
|
||||
ol.MapBrowserEvent.IEEventType.MSPOINTERMOVE
|
||||
goog.events.EventType.MSPOINTERMOVE
|
||||
], this.handleTouchMove_, false, this),
|
||||
goog.events.listen(element, [
|
||||
goog.events.EventType.TOUCHEND,
|
||||
ol.MapBrowserEvent.IEEventType.MSPOINTERUP
|
||||
goog.events.EventType.MSPOINTERUP
|
||||
], this.handleTouchEnd_, false, this)
|
||||
];
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ ol.Object.getGetterName = function(key) {
|
||||
|
||||
/**
|
||||
* @param {ol.Object} obj Object.
|
||||
* @return {Object.<string, ?number>} Listeners.
|
||||
* @return {Object.<string, goog.events.Key>} Listeners.
|
||||
*/
|
||||
ol.Object.getListeners = function(obj) {
|
||||
return obj[ol.ObjectProperty.BINDINGS] ||
|
||||
@@ -235,7 +235,7 @@ ol.Object.prototype.notifyInternal_ = function(key) {
|
||||
* @param {Function} listener The listener function.
|
||||
* @param {Object=} opt_scope Object is whose scope to call
|
||||
* the listener.
|
||||
* @return {?number} Unique key for the listener.
|
||||
* @return {goog.events.Key} Unique key for the listener.
|
||||
*/
|
||||
ol.Object.prototype.on = function(type, listener, opt_scope) {
|
||||
return goog.events.listen(this, type, listener, false, opt_scope);
|
||||
@@ -248,7 +248,7 @@ ol.Object.prototype.on = function(type, listener, opt_scope) {
|
||||
* @param {Function} listener The listener function.
|
||||
* @param {Object=} opt_scope Object is whose scope to call
|
||||
* the listener.
|
||||
* @return {?number} Unique key for the listener.
|
||||
* @return {goog.events.Key} Unique key for the listener.
|
||||
*/
|
||||
ol.Object.prototype.once = function(type, listener, opt_scope) {
|
||||
return goog.events.listenOnce(this, type, listener, false, opt_scope);
|
||||
|
||||
@@ -78,6 +78,12 @@ ol.Overlay = function(options) {
|
||||
visible: true
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {goog.events.Key}
|
||||
*/
|
||||
this.mapPostrenderListenerKey_ = null;
|
||||
|
||||
goog.events.listen(
|
||||
this, ol.Object.getChangeEventType(ol.OverlayProperty.ELEMENT),
|
||||
this.handleElementChanged, false, this);
|
||||
@@ -280,7 +286,7 @@ ol.Overlay.prototype.updatePixelPosition_ = function() {
|
||||
var position = this.getPosition();
|
||||
if (!goog.isDef(map) || !map.isDef() || !goog.isDef(position)) {
|
||||
if (this.rendered_.visible) {
|
||||
goog.style.showElement(this.element_, false);
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.rendered_.visible = false;
|
||||
}
|
||||
return;
|
||||
@@ -329,7 +335,7 @@ ol.Overlay.prototype.updatePixelPosition_ = function() {
|
||||
}
|
||||
|
||||
if (!this.rendered_.visible) {
|
||||
goog.style.showElement(this.element_, true);
|
||||
goog.style.setElementShown(this.element_, true);
|
||||
this.rendered_.visible = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
|
||||
|
||||
if (goog.isNull(frameState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.canvas_, false);
|
||||
goog.style.setElementShown(this.canvas_, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -156,7 +156,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.showElement(this.canvas_, true);
|
||||
goog.style.setElementShown(this.canvas_, true);
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ ol.renderer.dom.Map.prototype.renderFrame = function(frameState) {
|
||||
|
||||
if (goog.isNull(frameState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.layersPane_, false);
|
||||
goog.style.setElementShown(this.layersPane_, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -98,7 +98,7 @@ ol.renderer.dom.Map.prototype.renderFrame = function(frameState) {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.showElement(this.layersPane_, true);
|
||||
goog.style.setElementShown(this.layersPane_, true);
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
|
||||
|
||||
if (!layerState.visible) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.target, false);
|
||||
goog.style.setElementShown(this.target, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -226,7 +226,7 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
|
||||
}
|
||||
|
||||
if (layerState.visible && !this.renderedVisible_) {
|
||||
goog.style.showElement(this.target, true);
|
||||
goog.style.setElementShown(this.target, true);
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ ol.renderer.Map.prototype.getCanvas = goog.functions.NULL;
|
||||
/**
|
||||
* @param {ol.Pixel} pixel Pixel coordinate relative to the map viewport.
|
||||
* @param {Array.<ol.layer.Layer>} layers Layers to query.
|
||||
* @param {function(Array.<ol.Feature|string>)} success Callback for
|
||||
* @param {function(Array.<Array.<string|undefined>>)} success Callback for
|
||||
* successful queries. The passed argument is the resulting feature
|
||||
* information. Layers that are able to provide attribute data will put
|
||||
* ol.Feature instances, other layers will put a string which can either
|
||||
@@ -137,7 +137,7 @@ ol.renderer.Map.prototype.getFeatureInfoForPixel =
|
||||
/**
|
||||
* @param {ol.Pixel} pixel Pixel coordinate relative to the map viewport.
|
||||
* @param {Array.<ol.layer.Layer>} layers Layers to query.
|
||||
* @param {function(Array.<ol.Feature|string>)} success Callback for
|
||||
* @param {function(Array.<Array.<ol.Feature|undefined>>)} success Callback for
|
||||
* successful queries. The passed argument is the resulting feature
|
||||
* information. Layers that are able to provide attribute data will put
|
||||
* ol.Feature instances, other layers will put a string which can either
|
||||
|
||||
@@ -4,11 +4,12 @@ goog.provide('ol.renderer.webgl.Map');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.debug.Logger');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.Event');
|
||||
goog.require('goog.log');
|
||||
goog.require('goog.log.Logger');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.style');
|
||||
goog.require('goog.webgl');
|
||||
@@ -417,7 +418,7 @@ ol.renderer.webgl.Map.prototype.getProgram = function(
|
||||
if (goog.DEBUG) {
|
||||
if (!gl.getProgramParameter(program, goog.webgl.LINK_STATUS) &&
|
||||
!gl.isContextLost()) {
|
||||
this.logger_.severe(gl.getProgramInfoLog(program));
|
||||
goog.log.error(this.logger_, gl.getProgramInfoLog(program));
|
||||
}
|
||||
}
|
||||
goog.asserts.assert(
|
||||
@@ -445,7 +446,7 @@ ol.renderer.webgl.Map.prototype.getShader = function(shaderObject) {
|
||||
if (goog.DEBUG) {
|
||||
if (!gl.getShaderParameter(shader, goog.webgl.COMPILE_STATUS) &&
|
||||
!gl.isContextLost()) {
|
||||
this.logger_.severe(gl.getShaderInfoLog(shader));
|
||||
goog.log.error(this.logger_, gl.getShaderInfoLog(shader));
|
||||
}
|
||||
}
|
||||
goog.asserts.assert(
|
||||
@@ -519,10 +520,10 @@ ol.renderer.webgl.Map.prototype.isTileTextureLoaded = function(tile) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {goog.debug.Logger}
|
||||
* @type {goog.log.Logger}
|
||||
*/
|
||||
ol.renderer.webgl.Map.prototype.logger_ =
|
||||
goog.debug.Logger.getLogger('ol.renderer.webgl.Map');
|
||||
goog.log.getLogger('ol.renderer.webgl.Map');
|
||||
|
||||
|
||||
/**
|
||||
@@ -538,7 +539,7 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
|
||||
|
||||
if (goog.isNull(frameState)) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.showElement(this.canvas_, false);
|
||||
goog.style.setElementShown(this.canvas_, false);
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return false;
|
||||
@@ -651,7 +652,7 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.showElement(this.canvas_, true);
|
||||
goog.style.setElementShown(this.canvas_, true);
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,8 +280,7 @@ ol.structs.RTree.prototype.insertSubtree_ = function(node, root) {
|
||||
*
|
||||
* @param {Array.<ol.structs.RTreeNode>} nodes Array of nodes.
|
||||
* @private
|
||||
* @return {Array.<Array.<ol.structs.RTreeNode>>} An array of two new arrays
|
||||
* of nodes.
|
||||
* @return {Array.<ol.structs.RTreeNode>} An array of two nodes.
|
||||
*/
|
||||
ol.structs.RTree.prototype.linearSplit_ = function(nodes) {
|
||||
var n = this.pickLinear_(nodes);
|
||||
@@ -298,8 +297,7 @@ ol.structs.RTree.prototype.linearSplit_ = function(nodes) {
|
||||
*
|
||||
* @param {Array.<ol.structs.RTreeNode>} nodes Array of source nodes.
|
||||
* @private
|
||||
* @return {Array.<ol.structs.RTreeNode>} An array of two new arrays
|
||||
* of nodes.
|
||||
* @return {Array.<ol.structs.RTreeNode>} An array of two nodes.
|
||||
*/
|
||||
ol.structs.RTree.prototype.pickLinear_ = function(nodes) {
|
||||
var lowestHighX = nodes.length - 1;
|
||||
|
||||
Reference in New Issue
Block a user