Merge remote-tracking branch 'upstream/master' into webgl-point
Conflicts: src/ol/style/circlestyle.js src/ol/style/regularshapestyle.js test/spec/ol/style/regularshapestyle.test.js
This commit is contained in:
@@ -94,6 +94,8 @@ ol.color.blend = function(dst, src, opt_color) {
|
||||
|
||||
|
||||
/**
|
||||
* Return the color as an array. This function maintains a cache of calculated
|
||||
* arrays which means the result should not be modified.
|
||||
* @param {ol.Color|string} color Color.
|
||||
* @return {ol.Color} Color.
|
||||
* @api
|
||||
@@ -109,6 +111,7 @@ ol.color.asArray = function(color) {
|
||||
|
||||
|
||||
/**
|
||||
* Return the color as an rgba string.
|
||||
* @param {ol.Color|string} color Color.
|
||||
* @return {string} Rgba string.
|
||||
* @api
|
||||
@@ -137,12 +140,11 @@ ol.color.equals = function(color1, color2) {
|
||||
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @param {ol.Color=} opt_color Color.
|
||||
* @return {ol.Color} Color.
|
||||
*/
|
||||
ol.color.fromString = (
|
||||
/**
|
||||
* @return {function(string, ol.Color=): ol.Color}
|
||||
* @return {function(string): ol.Color}
|
||||
*/
|
||||
function() {
|
||||
|
||||
@@ -169,10 +171,9 @@ ol.color.fromString = (
|
||||
return (
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @param {ol.Color=} opt_color Color.
|
||||
* @return {ol.Color} Color.
|
||||
*/
|
||||
function(s, opt_color) {
|
||||
function(s) {
|
||||
var color;
|
||||
if (cache.hasOwnProperty(s)) {
|
||||
color = cache[s];
|
||||
@@ -191,7 +192,7 @@ ol.color.fromString = (
|
||||
cache[s] = color;
|
||||
++cacheSize;
|
||||
}
|
||||
return ol.color.returnOrUpdate(color, opt_color);
|
||||
return color;
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -275,24 +276,6 @@ ol.color.normalize = function(color, opt_color) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {ol.Color=} opt_color Color.
|
||||
* @return {ol.Color} Color.
|
||||
*/
|
||||
ol.color.returnOrUpdate = function(color, opt_color) {
|
||||
if (goog.isDef(opt_color)) {
|
||||
opt_color[0] = color[0];
|
||||
opt_color[1] = color[1];
|
||||
opt_color[2] = color[2];
|
||||
opt_color[3] = color[3];
|
||||
return opt_color;
|
||||
} else {
|
||||
return color;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} color Color.
|
||||
* @return {string} String.
|
||||
|
||||
@@ -6,7 +6,6 @@ goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol.CoordinateFormatType');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Pixel');
|
||||
@@ -162,9 +161,7 @@ goog.exportProperty(
|
||||
*/
|
||||
ol.control.MousePosition.prototype.handleMouseMove = function(browserEvent) {
|
||||
var map = this.getMap();
|
||||
var eventPosition = goog.style.getRelativePosition(
|
||||
browserEvent, map.getViewport());
|
||||
this.lastMouseMovePixel_ = [eventPosition.x, eventPosition.y];
|
||||
this.lastMouseMovePixel_ = map.getEventPixel(browserEvent.getBrowserEvent());
|
||||
this.updateHTML_(this.lastMouseMovePixel_);
|
||||
};
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ ol.format.GMLBase.prototype.readFeatures_ = function(node, objectStack) {
|
||||
var parsers = {};
|
||||
var parsersNS = {};
|
||||
parsers[featureType] = (localName == 'featureMembers') ?
|
||||
ol.xml.makeArrayPusher(this.readFeature_, this) :
|
||||
ol.xml.makeReplacer(this.readFeature_, this);
|
||||
ol.xml.makeArrayPusher(this.readFeatureElement, this) :
|
||||
ol.xml.makeReplacer(this.readFeatureElement, this);
|
||||
parsersNS[goog.object.get(context, 'featureNS')] = parsers;
|
||||
features = ol.xml.pushParseAndPop([], parsersNS, node, objectStack);
|
||||
}
|
||||
@@ -150,9 +150,8 @@ ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.Feature} Feature.
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.readFeature_ = function(node, objectStack) {
|
||||
ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||
var n;
|
||||
var fid = node.getAttribute('fid') ||
|
||||
ol.xml.getAttributeNS(node, 'http://www.opengis.net/gml', 'id');
|
||||
|
||||
@@ -582,7 +582,7 @@ ol.format.WKT.Parser.prototype.parse = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {!ol.geom.Geometry|!ol.geom.GeometryCollection} The geometry.
|
||||
* @return {!(ol.geom.Geometry|ol.geom.GeometryCollection)} The geometry.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WKT.Parser.prototype.parseGeometry_ = function() {
|
||||
|
||||
146
src/ol/format/wmsgetfeatureinfoformat.js
Normal file
146
src/ol/format/wmsgetfeatureinfoformat.js
Normal file
@@ -0,0 +1,146 @@
|
||||
goog.provide('ol.format.WMSGetFeatureInfo');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.NodeType');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.format.GML');
|
||||
goog.require('ol.format.GML2');
|
||||
goog.require('ol.format.XMLFeature');
|
||||
goog.require('ol.xml');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Format for reading WMSGetFeatureInfo format. It uses
|
||||
* {@link ol.format.GML2} to read features.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.format.XMLFeature}
|
||||
* @api
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo = function() {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string}
|
||||
*/
|
||||
this.featureNS_ = 'http://mapserver.gis.umn.edu/mapserver';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.format.GML2}
|
||||
*/
|
||||
this.gmlFormat_ = new ol.format.GML2();
|
||||
|
||||
goog.base(this);
|
||||
};
|
||||
goog.inherits(ol.format.WMSGetFeatureInfo, ol.format.XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.featureIdentifier_ = '_feature';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.readFeatures_ =
|
||||
function(node, objectStack) {
|
||||
|
||||
node.namespaceURI = this.featureNS_;
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
return features;
|
||||
}
|
||||
if (localName == 'msGMLOutput') {
|
||||
goog.array.forEach(node.childNodes, function(layer) {
|
||||
if (layer.nodeType !== goog.dom.NodeType.ELEMENT) {
|
||||
return;
|
||||
}
|
||||
var context = objectStack[0];
|
||||
goog.asserts.assert(goog.isObject(context));
|
||||
|
||||
goog.asserts.assert(layer.localName.indexOf(
|
||||
ol.format.WMSGetFeatureInfo.layerIdentifier_) >= 0);
|
||||
|
||||
var featureType = goog.string.remove(layer.localName,
|
||||
ol.format.WMSGetFeatureInfo.layerIdentifier_) +
|
||||
ol.format.WMSGetFeatureInfo.featureIdentifier_;
|
||||
|
||||
goog.object.set(context, 'featureType', featureType);
|
||||
goog.object.set(context, 'featureNS', this.featureNS_);
|
||||
|
||||
var parsers = {};
|
||||
parsers[featureType] = ol.xml.makeArrayPusher(
|
||||
this.gmlFormat_.readFeatureElement, this.gmlFormat_);
|
||||
var parsersNS = ol.xml.makeParsersNS(
|
||||
[goog.object.get(context, 'featureNS'), null], parsers);
|
||||
layer.namespaceURI = this.featureNS_;
|
||||
var layerFeatures = ol.xml.pushParseAndPop(
|
||||
[], parsersNS, layer, objectStack, this.gmlFormat_);
|
||||
if (goog.isDef(layerFeatures)) {
|
||||
goog.array.extend(features, layerFeatures);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
if (localName == 'FeatureCollection') {
|
||||
var gmlFeatures = ol.xml.pushParseAndPop([],
|
||||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node,
|
||||
[{}], this.gmlFormat_);
|
||||
if (goog.isDef(gmlFeatures)) {
|
||||
features = gmlFeatures;
|
||||
}
|
||||
}
|
||||
return features;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Read all features from a WMSGetFeatureInfo response.
|
||||
*
|
||||
* @function
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {olx.format.ReadOptions=} opt_options Options.
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode =
|
||||
function(node, opt_options) {
|
||||
var options = {
|
||||
'featureType': this.featureType,
|
||||
'featureNS': this.featureNS
|
||||
};
|
||||
if (goog.isDef(opt_options)) {
|
||||
goog.object.extend(options, this.getReadOptions(node, opt_options));
|
||||
}
|
||||
return this.readFeatures_(node, [options]);
|
||||
};
|
||||
@@ -265,6 +265,7 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
|
||||
var geometries = this.geometries_;
|
||||
|
||||
@@ -245,6 +245,7 @@ ol.geom.SimpleGeometry.prototype.setLayout =
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
|
||||
if (!goog.isNull(this.flatCoordinates)) {
|
||||
|
||||
@@ -154,7 +154,7 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
||||
}
|
||||
} else {
|
||||
// Modify the currently selected feature(s).
|
||||
var /** @type {Array.<number>} */ deselected = [];
|
||||
var /** @type {Array.<ol.Feature>} */ deselected = [];
|
||||
var /** @type {Array.<ol.Feature>} */ selected = [];
|
||||
map.forEachFeatureAtPixel(mapBrowserEvent.pixel,
|
||||
/**
|
||||
@@ -169,17 +169,17 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
||||
}
|
||||
} else {
|
||||
if (remove || toggle) {
|
||||
deselected.push(index);
|
||||
deselected.push(feature);
|
||||
}
|
||||
}
|
||||
}, undefined, this.layerFilter_);
|
||||
var i;
|
||||
for (i = deselected.length - 1; i >= 0; --i) {
|
||||
features.removeAt(deselected[i]);
|
||||
features.remove(deselected[i]);
|
||||
}
|
||||
features.extend(selected);
|
||||
}
|
||||
return false;
|
||||
return this.condition_ == ol.events.condition.mouseMove;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -214,9 +214,13 @@ ol.layer.Group.prototype.getLayerStatesArray = function(opt_states) {
|
||||
layerState.maxResolution, ownLayerState.maxResolution);
|
||||
layerState.minResolution = Math.max(
|
||||
layerState.minResolution, ownLayerState.minResolution);
|
||||
if (goog.isDef(ownLayerState.extent) && goog.isDef(layerState.extent)) {
|
||||
layerState.extent = ol.extent.getIntersection(
|
||||
layerState.extent, ownLayerState.extent);
|
||||
if (goog.isDef(ownLayerState.extent)) {
|
||||
if (goog.isDef(layerState.extent)) {
|
||||
layerState.extent = ol.extent.getIntersection(
|
||||
layerState.extent, ownLayerState.extent);
|
||||
} else {
|
||||
layerState.extent = ownLayerState.extent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ ol.Map = function(options) {
|
||||
goog.events.EventType.TOUCHSTART,
|
||||
goog.events.EventType.MSPOINTERDOWN,
|
||||
ol.MapBrowserEvent.EventType.POINTERDOWN,
|
||||
goog.events.EventType.MOUSEWHEEL
|
||||
goog.userAgent.GECKO ? 'DOMMouseScroll' : 'mousewheel'
|
||||
], goog.events.Event.stopPropagation);
|
||||
goog.dom.appendChild(this.viewport_, this.overlayContainerStopEvent_);
|
||||
|
||||
@@ -592,18 +592,25 @@ ol.Map.prototype.getEventCoordinate = function(event) {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the map pixel position for a browser event.
|
||||
* Returns the map pixel position for a browser event relative to the viewport.
|
||||
* @param {Event} event Event.
|
||||
* @return {ol.Pixel} Pixel.
|
||||
* @api stable
|
||||
*/
|
||||
ol.Map.prototype.getEventPixel = function(event) {
|
||||
// goog.style.getRelativePosition is based on event.targetTouches,
|
||||
// but touchend and touchcancel events have no targetTouches when
|
||||
// the last finger is removed from the screen.
|
||||
// So we ourselves compute the position of touch events.
|
||||
// See https://github.com/google/closure-library/pull/323
|
||||
if (goog.isDef(event.changedTouches)) {
|
||||
// Use the offsetX and offsetY values if available.
|
||||
// See http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsetx and
|
||||
// http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsety
|
||||
if (goog.isDef(event.offsetX) && goog.isDef(event.offsetY)) {
|
||||
return [event.offsetX, event.offsetY];
|
||||
} else if (goog.isDef(event.changedTouches)) {
|
||||
// offsetX and offsetY are not defined for Touch Event
|
||||
//
|
||||
// goog.style.getRelativePosition is based on event.targetTouches,
|
||||
// but touchend and touchcancel events have no targetTouches when
|
||||
// the last finger is removed from the screen.
|
||||
// So we ourselves compute the position of touch events.
|
||||
// See https://github.com/google/closure-library/pull/323
|
||||
var touch = event.changedTouches[0];
|
||||
var viewportPosition = goog.style.getClientPosition(this.viewport_);
|
||||
return [
|
||||
@@ -611,6 +618,8 @@ ol.Map.prototype.getEventPixel = function(event) {
|
||||
touch.clientY - viewportPosition.y
|
||||
];
|
||||
} else {
|
||||
// Compute offsetX and offsetY values for browsers that don't implement
|
||||
// cssom-view specification
|
||||
var eventPosition = goog.style.getRelativePosition(event, this.viewport_);
|
||||
return [eventPosition.x, eventPosition.y];
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ ol.proj.EPSG3857.CODES = [
|
||||
'EPSG:102113',
|
||||
'EPSG:900913',
|
||||
'urn:ogc:def:crs:EPSG:6.18:3:3857',
|
||||
'urn:ogc:def:crs:EPSG::3857',
|
||||
'http://www.opengis.net/gml/srs/epsg.xml#3857'
|
||||
];
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ ol.proj.EPSG4326.EXTENT = [-180, -90, 180, 90];
|
||||
ol.proj.EPSG4326.PROJECTIONS = [
|
||||
new ol.proj.EPSG4326_('CRS:84'),
|
||||
new ol.proj.EPSG4326_('EPSG:4326', 'neu'),
|
||||
new ol.proj.EPSG4326_('urn:ogc:def:crs:EPSG::4326', 'neu'),
|
||||
new ol.proj.EPSG4326_('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'),
|
||||
new ol.proj.EPSG4326_('urn:ogc:def:crs:OGC:1.3:CRS84'),
|
||||
new ol.proj.EPSG4326_('urn:ogc:def:crs:OGC:2:84'),
|
||||
|
||||
@@ -9,6 +9,7 @@ goog.require('ol.ImageState');
|
||||
goog.require('ol.ViewHint');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.renderer.Map');
|
||||
goog.require('ol.renderer.canvas.Layer');
|
||||
goog.require('ol.vec.Mat4');
|
||||
@@ -108,8 +109,14 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
|
||||
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||
!ol.extent.isEmpty(renderedExtent)) {
|
||||
var projection = viewState.projection;
|
||||
var sourceProjection = imageSource.getProjection();
|
||||
if (!goog.isNull(sourceProjection)) {
|
||||
goog.asserts.assert(ol.proj.equivalent(projection, sourceProjection));
|
||||
projection = sourceProjection;
|
||||
}
|
||||
image = imageSource.getImage(
|
||||
renderedExtent, viewResolution, pixelRatio, viewState.projection);
|
||||
renderedExtent, viewResolution, pixelRatio, projection);
|
||||
if (!goog.isNull(image)) {
|
||||
var imageState = image.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
goog.provide('ol.renderer.canvas.Layer');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.render.Event');
|
||||
goog.require('ol.render.EventType');
|
||||
@@ -44,6 +46,35 @@ ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
|
||||
var image = this.getImage();
|
||||
if (!goog.isNull(image)) {
|
||||
|
||||
// clipped rendering if layer extent is set
|
||||
var extent = layerState.extent;
|
||||
var clipped = goog.isDef(extent);
|
||||
if (clipped) {
|
||||
goog.asserts.assert(goog.isDef(extent));
|
||||
var topLeft = ol.extent.getTopLeft(extent);
|
||||
var topRight = ol.extent.getTopRight(extent);
|
||||
var bottomRight = ol.extent.getBottomRight(extent);
|
||||
var bottomLeft = ol.extent.getBottomLeft(extent);
|
||||
|
||||
ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix,
|
||||
topLeft, topLeft);
|
||||
ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix,
|
||||
topRight, topRight);
|
||||
ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix,
|
||||
bottomRight, bottomRight);
|
||||
ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix,
|
||||
bottomLeft, bottomLeft);
|
||||
|
||||
context.save();
|
||||
context.beginPath();
|
||||
context.moveTo(topLeft[0], topLeft[1]);
|
||||
context.lineTo(topRight[0], topRight[1]);
|
||||
context.lineTo(bottomRight[0], bottomRight[1]);
|
||||
context.lineTo(bottomLeft[0], bottomLeft[1]);
|
||||
context.clip();
|
||||
}
|
||||
|
||||
var imageTransform = this.getImageTransform();
|
||||
// for performance reasons, context.save / context.restore is not used
|
||||
// to save and restore the transformation matrix and the opacity.
|
||||
@@ -72,6 +103,10 @@ ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
context.setTransform(1, 0, 0, 1, 0, 0);
|
||||
}
|
||||
context.globalAlpha = alpha;
|
||||
|
||||
if (clipped) {
|
||||
context.restore();
|
||||
}
|
||||
}
|
||||
|
||||
this.dispatchPostComposeEvent(context, frameState);
|
||||
|
||||
@@ -5,16 +5,13 @@ goog.provide('ol.renderer.canvas.TileLayer');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.TileRange');
|
||||
goog.require('ol.TileState');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.LayerProperty');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.renderer.Map');
|
||||
goog.require('ol.renderer.canvas.Layer');
|
||||
@@ -81,32 +78,10 @@ ol.renderer.canvas.TileLayer = function(mapRenderer, tileLayer) {
|
||||
*/
|
||||
this.renderedTiles_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<goog.events.Key>}
|
||||
*/
|
||||
this.eventKeys_ = [
|
||||
goog.events.listen(
|
||||
tileLayer, ol.Object.getChangeEventType(ol.layer.LayerProperty.EXTENT),
|
||||
this.handleLayerExtentChanged_, false, this)
|
||||
];
|
||||
|
||||
};
|
||||
goog.inherits(ol.renderer.canvas.TileLayer, ol.renderer.canvas.Layer);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.disposeInternal = function() {
|
||||
for (var i = 0, ii = this.eventKeys_.length; i < ii; ++i) {
|
||||
goog.events.unlistenByKey(this.eventKeys_[i]);
|
||||
}
|
||||
this.eventKeys_.length = 0;
|
||||
goog.base(this, 'disposeInternal');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -123,19 +98,6 @@ ol.renderer.canvas.TileLayer.prototype.getImageTransform = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handle layer extent changes. We clear the canvas any time the layer extent
|
||||
* changes.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.handleLayerExtentChanged_ = function() {
|
||||
if (!goog.isNull(this.context_)) {
|
||||
this.context_.clearRect(0, 0, this.canvasSize_[0], this.canvasSize_[1]);
|
||||
this.renderedCanvasZ_ = NaN;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -278,11 +240,6 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame =
|
||||
if (z != this.renderedCanvasZ_ ||
|
||||
!this.renderedCanvasTileRange_.containsTileRange(tileRange)) {
|
||||
this.renderedCanvasTileRange_ = null;
|
||||
// Due to limited layer extent, we may be rendering tiles on a small
|
||||
// portion of the canvas.
|
||||
if (z < this.renderedCanvasZ_) {
|
||||
this.context_.clearRect(0, 0, canvasWidth, canvasHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ goog.require('ol.ViewHint');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.renderer.dom.Layer');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
@@ -104,8 +105,14 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame =
|
||||
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||
!ol.extent.isEmpty(renderedExtent)) {
|
||||
var projection = viewState.projection;
|
||||
var sourceProjection = imageSource.getProjection();
|
||||
if (!goog.isNull(sourceProjection)) {
|
||||
goog.asserts.assert(ol.proj.equivalent(projection, sourceProjection));
|
||||
projection = sourceProjection;
|
||||
}
|
||||
var image_ = imageSource.getImage(renderedExtent, viewResolution,
|
||||
frameState.pixelRatio, viewState.projection);
|
||||
frameState.pixelRatio, projection);
|
||||
if (!goog.isNull(image_)) {
|
||||
var imageState = image_.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -12,6 +12,7 @@ goog.require('ol.ImageState');
|
||||
goog.require('ol.ViewHint');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.renderer.webgl.Layer');
|
||||
|
||||
|
||||
@@ -124,8 +125,14 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame =
|
||||
}
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] &&
|
||||
!ol.extent.isEmpty(renderedExtent)) {
|
||||
var projection = viewState.projection;
|
||||
var sourceProjection = imageSource.getProjection();
|
||||
if (!goog.isNull(sourceProjection)) {
|
||||
goog.asserts.assert(ol.proj.equivalent(projection, sourceProjection));
|
||||
projection = sourceProjection;
|
||||
}
|
||||
var image_ = imageSource.getImage(renderedExtent, viewResolution,
|
||||
frameState.pixelRatio, viewState.projection);
|
||||
frameState.pixelRatio, projection);
|
||||
if (!goog.isNull(image_)) {
|
||||
var imageState = image_.getState();
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
|
||||
@@ -48,12 +48,14 @@ goog.inherits(ol.source.FormatVector, ol.source.Vector);
|
||||
|
||||
/**
|
||||
* @param {goog.Uri|string} url URL.
|
||||
* @param {function(this: T, Array.<ol.Feature>)} callback Callback.
|
||||
* @param {T} thisArg Value to use as `this` when executing `callback`.
|
||||
* @param {function(this: T, Array.<ol.Feature>)} success Success Callback.
|
||||
* @param {function(this: T)} error Error callback.
|
||||
* @param {T} thisArg Value to use as `this` when executing `success` or
|
||||
* `error`.
|
||||
* @template T
|
||||
*/
|
||||
ol.source.FormatVector.prototype.loadFeaturesFromURL =
|
||||
function(url, callback, thisArg) {
|
||||
function(url, success, error, thisArg) {
|
||||
var xhrIo = new goog.net.XhrIo();
|
||||
var type = this.format.getType();
|
||||
var responseType;
|
||||
@@ -97,13 +99,13 @@ ol.source.FormatVector.prototype.loadFeaturesFromURL =
|
||||
goog.asserts.fail();
|
||||
}
|
||||
if (goog.isDefAndNotNull(source)) {
|
||||
callback.call(thisArg, this.readFeatures(source));
|
||||
success.call(thisArg, this.readFeatures(source));
|
||||
} else {
|
||||
this.setState(ol.source.State.ERROR);
|
||||
goog.asserts.fail();
|
||||
}
|
||||
} else {
|
||||
this.setState(ol.source.State.ERROR);
|
||||
error.call(thisArg);
|
||||
}
|
||||
goog.dispose(xhrIo);
|
||||
}, false, this);
|
||||
|
||||
@@ -10,8 +10,7 @@ goog.require('ol.source.Image');
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* An image source for 'static', that is, non-georeferenced, images.
|
||||
* See examples/static-image for example.
|
||||
* A layer source for displaying a single, static image.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.source.Image}
|
||||
|
||||
@@ -56,7 +56,7 @@ ol.source.MapQuest.TILE_ATTRIBUTION = new ol.Attribution({
|
||||
*/
|
||||
ol.source.MapQuestConfig = {
|
||||
'osm': {
|
||||
maxZoom: 28,
|
||||
maxZoom: 19,
|
||||
attributions: [
|
||||
ol.source.MapQuest.TILE_ATTRIBUTION,
|
||||
ol.source.OSM.ATTRIBUTION
|
||||
|
||||
@@ -48,13 +48,15 @@ ol.source.StaticVector = function(options) {
|
||||
if (goog.isDef(options.url) || goog.isDef(options.urls)) {
|
||||
this.setState(ol.source.State.LOADING);
|
||||
if (goog.isDef(options.url)) {
|
||||
this.loadFeaturesFromURL(options.url, this.onFeaturesLoaded_, this);
|
||||
this.loadFeaturesFromURL(options.url,
|
||||
this.onFeaturesLoadedSuccess_, this.onFeaturesLoadedError_, this);
|
||||
}
|
||||
if (goog.isDef(options.urls)) {
|
||||
var urls = options.urls;
|
||||
var i, ii;
|
||||
for (i = 0, ii = urls.length; i < ii; ++i) {
|
||||
this.loadFeaturesFromURL(urls[i], this.onFeaturesLoaded_, this);
|
||||
this.loadFeaturesFromURL(urls[i],
|
||||
this.onFeaturesLoadedSuccess_, this.onFeaturesLoadedError_, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,11 +65,19 @@ ol.source.StaticVector = function(options) {
|
||||
goog.inherits(ol.source.StaticVector, ol.source.FormatVector);
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ol.source.StaticVector.prototype.onFeaturesLoadedError_ = function() {
|
||||
this.setState(ol.source.State.ERROR);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
* @private
|
||||
*/
|
||||
ol.source.StaticVector.prototype.onFeaturesLoaded_ = function(features) {
|
||||
ol.source.StaticVector.prototype.onFeaturesLoadedSuccess_ = function(features) {
|
||||
this.addFeaturesInternal(features);
|
||||
this.setState(ol.source.State.READY);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.source.TileVector');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
@@ -91,6 +92,48 @@ ol.source.TileVector.prototype.clear = function() {
|
||||
ol.source.TileVector.prototype.forEachFeature = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* Iterate through all features whose geometries contain the provided
|
||||
* coordinate at the provided resolution, calling the callback with each
|
||||
* feature. If the callback returns a "truthy" value, iteration will stop and
|
||||
* the function will return the same value.
|
||||
*
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {function(this: T, ol.Feature): S} callback Called with each feature
|
||||
* whose goemetry contains the provided coordinate.
|
||||
* @param {T=} opt_this The object to use as `this` in the callback.
|
||||
* @return {S|undefined} The return value from the last call to the callback.
|
||||
* @template T,S
|
||||
*/
|
||||
ol.source.TileVector.prototype.forEachFeatureAtCoordinateAndResolution =
|
||||
function(coordinate, resolution, callback, opt_this) {
|
||||
|
||||
var tileGrid = this.tileGrid_;
|
||||
var tiles = this.tiles_;
|
||||
var tileCoord = tileGrid.getTileCoordForCoordAndResolution(coordinate,
|
||||
resolution);
|
||||
|
||||
var tileKey = this.getTileKeyZXY_(tileCoord[0], tileCoord[1], tileCoord[2]);
|
||||
var features = tiles[tileKey];
|
||||
if (goog.isDef(features)) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = features.length; i < ii; ++i) {
|
||||
var feature = features[i];
|
||||
var geometry = feature.getGeometry();
|
||||
goog.asserts.assert(goog.isDefAndNotNull(geometry));
|
||||
if (geometry.containsCoordinate(coordinate)) {
|
||||
var result = callback.call(opt_this, feature);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -141,6 +184,7 @@ ol.source.TileVector.prototype.getExtent = goog.abstractMethod;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
ol.source.TileVector.prototype.getFeatures = function() {
|
||||
var tiles = this.tiles_;
|
||||
@@ -153,6 +197,28 @@ ol.source.TileVector.prototype.getFeatures = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get all features whose geometry intersects the provided coordinate for the
|
||||
* provided resolution.
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
ol.source.TileVector.prototype.getFeaturesAtCoordinateAndResolution =
|
||||
function(coordinate, resolution) {
|
||||
var features = [];
|
||||
this.forEachFeatureAtCoordinateAndResolution(coordinate, resolution,
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
*/
|
||||
function(feature) {
|
||||
features.push(feature);
|
||||
});
|
||||
return features;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -184,6 +250,15 @@ ol.source.TileVector.prototype.loadFeatures =
|
||||
var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
|
||||
var tileCoord = [z, 0, 0];
|
||||
var x, y;
|
||||
/**
|
||||
* @param {string} tileKey Tile key.
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
* @this {ol.source.TileVector}
|
||||
*/
|
||||
function success(tileKey, features) {
|
||||
tiles[tileKey] = features;
|
||||
this.setState(ol.source.State.READY);
|
||||
}
|
||||
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
||||
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
||||
var tileKey = this.getTileKeyZXY_(z, x, y);
|
||||
@@ -195,16 +270,8 @@ ol.source.TileVector.prototype.loadFeatures =
|
||||
var url = tileUrlFunction(tileCoord, 1, projection);
|
||||
if (goog.isDef(url)) {
|
||||
tiles[tileKey] = [];
|
||||
this.loadFeaturesFromURL(url, goog.partial(
|
||||
/**
|
||||
* @param {string} tileKey Tile key.
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
* @this {ol.source.TileVector}
|
||||
*/
|
||||
function(tileKey, features) {
|
||||
tiles[tileKey] = features;
|
||||
this.setState(ol.source.State.READY);
|
||||
}, tileKey), this);
|
||||
this.loadFeaturesFromURL(url, goog.partial(success, tileKey),
|
||||
goog.nullFunction, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ ol.source.WMTS = function(options) {
|
||||
|
||||
var context = {
|
||||
'Layer': options.layer,
|
||||
'style': options.style,
|
||||
'Style': options.style,
|
||||
'TileMatrixSet': options.matrixSet
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('ol.color');
|
||||
goog.require('ol.has');
|
||||
goog.require('ol.render.canvas');
|
||||
goog.require('ol.structs.IHasChecksum');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -243,7 +244,7 @@ ol.style.Circle.prototype.unlistenImageChange = goog.nullFunction;
|
||||
|
||||
/**
|
||||
* @typedef {{strokeStyle: (string|undefined), strokeWidth: number,
|
||||
* size: number}}
|
||||
* size: number, lineDash: Array.<number>}}
|
||||
*/
|
||||
ol.style.Circle.RenderOptions;
|
||||
|
||||
@@ -253,7 +254,10 @@ ol.style.Circle.RenderOptions;
|
||||
* @param {ol.style.AtlasManager|undefined} atlasManager
|
||||
*/
|
||||
ol.style.Circle.prototype.render_ = function(atlasManager) {
|
||||
var strokeStyle, strokeWidth = 0, imageSize;
|
||||
var imageSize;
|
||||
var lineDash = null;
|
||||
var strokeStyle;
|
||||
var strokeWidth = 0;
|
||||
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
strokeStyle = ol.color.asString(this.stroke_.getColor());
|
||||
@@ -261,15 +265,21 @@ ol.style.Circle.prototype.render_ = function(atlasManager) {
|
||||
if (!goog.isDef(strokeWidth)) {
|
||||
strokeWidth = ol.render.canvas.defaultLineWidth;
|
||||
}
|
||||
lineDash = this.stroke_.getLineDash();
|
||||
if (!ol.has.CANVAS_LINE_DASH) {
|
||||
lineDash = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var size = 2 * (this.radius_ + strokeWidth) + 1;
|
||||
|
||||
/** @type {ol.style.Circle.RenderOptions} */
|
||||
var renderOptions = {
|
||||
strokeStyle: strokeStyle,
|
||||
strokeWidth: strokeWidth,
|
||||
size: size
|
||||
size: size,
|
||||
lineDash: lineDash
|
||||
};
|
||||
|
||||
if (!goog.isDef(atlasManager)) {
|
||||
@@ -355,6 +365,9 @@ ol.style.Circle.prototype.draw_ = function(renderOptions, context, x, y) {
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
context.strokeStyle = renderOptions.strokeStyle;
|
||||
context.lineWidth = renderOptions.strokeWidth;
|
||||
if (!goog.isNull(renderOptions.lineDash)) {
|
||||
context.setLineDash(renderOptions.lineDash);
|
||||
}
|
||||
context.stroke();
|
||||
}
|
||||
context.closePath();
|
||||
@@ -412,6 +425,9 @@ ol.style.Circle.prototype.drawHitDetectionCanvas_ =
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
context.strokeStyle = renderOptions.strokeStyle;
|
||||
context.lineWidth = renderOptions.strokeWidth;
|
||||
if (!goog.isNull(renderOptions.lineDash)) {
|
||||
context.setLineDash(renderOptions.lineDash);
|
||||
}
|
||||
context.stroke();
|
||||
}
|
||||
context.closePath();
|
||||
|
||||
@@ -4,6 +4,7 @@ goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('ol.color');
|
||||
goog.require('ol.has');
|
||||
goog.require('ol.render.canvas');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Image');
|
||||
@@ -14,7 +15,9 @@ goog.require('ol.style.Stroke');
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Set regular shape style for vector features.
|
||||
* Set regular shape style for vector features. The resulting shape will be
|
||||
* a regular polygon when `radius` is provided, or a star when `radius1` and
|
||||
* `radius2` are provided.
|
||||
*
|
||||
* @constructor
|
||||
* @param {olx.style.RegularShapeOptions=} opt_options Options.
|
||||
@@ -68,18 +71,22 @@ ol.style.RegularShape = function(opt_options) {
|
||||
*/
|
||||
this.points_ = options.points;
|
||||
|
||||
goog.asserts.assert(goog.isDef(options.radius) ||
|
||||
goog.isDef(options.radius1));
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.radius_ = options.radius;
|
||||
this.radius_ = /** @type {number} */ (goog.isDef(options.radius) ?
|
||||
options.radius : options.radius1);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.radius2_ =
|
||||
goog.isDef(options.radius2) ? options.radius2 : options.radius;
|
||||
goog.isDef(options.radius2) ? options.radius2 : this.radius_;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -222,6 +229,15 @@ ol.style.RegularShape.prototype.getRadius = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Radius2.
|
||||
* @api
|
||||
*/
|
||||
ol.style.RegularShape.prototype.getRadius2 = function() {
|
||||
return this.radius2_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
@@ -260,7 +276,7 @@ ol.style.RegularShape.prototype.unlistenImageChange = goog.nullFunction;
|
||||
|
||||
/**
|
||||
* @typedef {{strokeStyle: (string|undefined), strokeWidth: number,
|
||||
* size: number}}
|
||||
* size: number, lineDash: Array.<number>}}
|
||||
*/
|
||||
ol.style.RegularShape.RenderOptions;
|
||||
|
||||
@@ -270,7 +286,10 @@ ol.style.RegularShape.RenderOptions;
|
||||
* @param {ol.style.AtlasManager|undefined} atlasManager
|
||||
*/
|
||||
ol.style.RegularShape.prototype.render_ = function(atlasManager) {
|
||||
var strokeStyle, strokeWidth = 0, imageSize;
|
||||
var imageSize;
|
||||
var lineDash = null;
|
||||
var strokeStyle;
|
||||
var strokeWidth = 0;
|
||||
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
strokeStyle = ol.color.asString(this.stroke_.getColor());
|
||||
@@ -278,6 +297,10 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
|
||||
if (!goog.isDef(strokeWidth)) {
|
||||
strokeWidth = ol.render.canvas.defaultLineWidth;
|
||||
}
|
||||
lineDash = this.stroke_.getLineDash();
|
||||
if (!ol.has.CANVAS_LINE_DASH) {
|
||||
lineDash = null;
|
||||
}
|
||||
}
|
||||
|
||||
var size = 2 * (this.radius_ + strokeWidth) + 1;
|
||||
@@ -286,7 +309,8 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
|
||||
var renderOptions = {
|
||||
strokeStyle: strokeStyle,
|
||||
strokeWidth: strokeWidth,
|
||||
size: size
|
||||
size: size,
|
||||
lineDash: lineDash
|
||||
};
|
||||
|
||||
if (!goog.isDef(atlasManager)) {
|
||||
@@ -379,6 +403,9 @@ ol.style.RegularShape.prototype.draw_ = function(renderOptions, context, x, y) {
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
context.strokeStyle = renderOptions.strokeStyle;
|
||||
context.lineWidth = renderOptions.strokeWidth;
|
||||
if (!goog.isNull(renderOptions.lineDash)) {
|
||||
context.setLineDash(renderOptions.lineDash);
|
||||
}
|
||||
context.stroke();
|
||||
}
|
||||
context.closePath();
|
||||
@@ -444,6 +471,9 @@ ol.style.RegularShape.prototype.drawHitDetectionCanvas_ =
|
||||
if (!goog.isNull(this.stroke_)) {
|
||||
context.strokeStyle = renderOptions.strokeStyle;
|
||||
context.lineWidth = renderOptions.strokeWidth;
|
||||
if (!goog.isNull(renderOptions.lineDash)) {
|
||||
context.setLineDash(renderOptions.lineDash);
|
||||
}
|
||||
context.stroke();
|
||||
}
|
||||
context.closePath();
|
||||
|
||||
@@ -2,6 +2,7 @@ goog.provide('ol.tilegrid.TileGrid');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.TileCoord');
|
||||
@@ -101,12 +102,16 @@ ol.tilegrid.TileGrid.tmpTileCoord_ = [0, 0, 0];
|
||||
|
||||
|
||||
/**
|
||||
* Returns the identity function. May be overridden in subclasses.
|
||||
* @param {{extent: (ol.Extent|undefined),
|
||||
* wrapX: (boolean|undefined)}=} opt_options Options.
|
||||
* @return {function(ol.TileCoord, ol.proj.Projection, ol.TileCoord=):
|
||||
* ol.TileCoord} Tile coordinate transform.
|
||||
*/
|
||||
ol.tilegrid.TileGrid.prototype.createTileCoordTransform = goog.abstractMethod;
|
||||
ol.tilegrid.TileGrid.prototype.createTileCoordTransform =
|
||||
function(opt_options) {
|
||||
return goog.functions.identity;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -300,6 +305,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordExtent =
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {ol.TileCoord=} opt_tileCoord Destination ol.TileCoord object.
|
||||
* @return {ol.TileCoord} Tile coordinate.
|
||||
* @api
|
||||
*/
|
||||
ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndResolution = function(
|
||||
coordinate, resolution, opt_tileCoord) {
|
||||
@@ -346,6 +352,7 @@ ol.tilegrid.TileGrid.prototype.getTileCoordForXYAndResolution_ = function(
|
||||
* @param {number} z Z.
|
||||
* @param {ol.TileCoord=} opt_tileCoord Destination ol.TileCoord object.
|
||||
* @return {ol.TileCoord} Tile coordinate.
|
||||
* @api
|
||||
*/
|
||||
ol.tilegrid.TileGrid.prototype.getTileCoordForCoordAndZ =
|
||||
function(coordinate, z, opt_tileCoord) {
|
||||
|
||||
Reference in New Issue
Block a user