Create ol.Coordinate around goog.math.Coordinate

This commit is contained in:
Tom Payne
2012-07-19 10:34:12 +02:00
parent d62ba69458
commit c547404615
22 changed files with 155 additions and 131 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
goog.provide('ol.dom.LayerRenderer');
goog.require('ol.Coordinate');
goog.require('ol.LayerRenderer');
@@ -23,7 +24,7 @@ ol.dom.LayerRenderer = function(map, layer, target) {
/**
* Top left corner of the target in map coords.
*
* @type {goog.math.Coordinate}
* @type {ol.Coordinate}
* @protected
*/
this.origin = null;
@@ -44,7 +45,7 @@ ol.dom.LayerRenderer.prototype.getMap = function() {
/**
* Set the location of the top left corner of the target.
*
* @param {goog.math.Coordinate} origin Origin.
* @param {ol.Coordinate} origin Origin.
*/
ol.dom.LayerRenderer.prototype.setOrigin = function(origin) {
this.origin = origin;
+5 -5
View File
@@ -3,8 +3,8 @@ goog.provide('ol.dom.Map');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.math.Coordinate');
goog.require('goog.style');
goog.require('ol.Coordinate');
goog.require('ol.Map');
goog.require('ol.TileLayer');
goog.require('ol.dom.TileLayerRenderer');
@@ -48,7 +48,7 @@ ol.dom.Map = function(target, opt_values) {
this.layerPanes_ = {};
/**
* @type {goog.math.Coordinate|undefined}
* @type {ol.Coordinate|undefined}
* @private
*/
this.renderedCenter_ = undefined;
@@ -56,7 +56,7 @@ ol.dom.Map = function(target, opt_values) {
/**
* The pixel offset of the layers pane with respect to its container.
*
* @type {goog.math.Coordinate}
* @type {ol.Coordinate}
* @private
*/
this.layersPaneOffset_ = null;
@@ -77,7 +77,7 @@ goog.inherits(ol.dom.Map, ol.Map);
* @private
*/
ol.dom.Map.prototype.resetLayersPane_ = function() {
var offset = new goog.math.Coordinate(0, 0);
var offset = new ol.Coordinate(0, 0);
goog.style.setPosition(this.layersPane_, offset);
this.layersPaneOffset_ = offset;
@@ -97,7 +97,7 @@ ol.dom.Map.prototype.setOrigin_ = function() {
var targetSize = this.getSize();
var targetWidth = targetSize.width;
var targetHeight = targetSize.height;
var origin = new goog.math.Coordinate(
var origin = new ol.Coordinate(
center.x - resolution * targetWidth / 2,
center.y + resolution * targetHeight / 2);
goog.object.forEach(this.layerRenderers, function(layerRenderer) {
+3 -2
View File
@@ -1,5 +1,6 @@
goog.provide('ol.dom.TileLayerRenderer');
goog.require('ol.Coordinate');
goog.require('ol.dom.LayerRenderer');
@@ -91,7 +92,7 @@ ol.dom.TileLayerRenderer.prototype.redraw = function() {
* @param {ol.Extent} extent Map extent.
* @param {ol.TileBounds} tileBounds Tile bounds.
* @param {number} resolution Resolution.
* @return {goog.math.Coordinate} Offset.
* @return {ol.Coordinate} Offset.
*/
ol.dom.TileLayerRenderer.prototype.getTilesMapOffset_ = function(
extent, tileBounds, resolution) {
@@ -103,7 +104,7 @@ ol.dom.TileLayerRenderer.prototype.getTilesMapOffset_ = function(
var tileCoord = new ol.TileCoord(z, tileBounds.minX, tileBounds.maxY);
var tileCoordExtent = tileGrid.getTileCoordExtent(tileCoord);
var offset = new goog.math.Coordinate(
var offset = new ol.Coordinate(
Math.round((this.origin.x - tileCoordExtent.minX) / resolution),
Math.round((tileCoordExtent.maxY - this.origin.y) / resolution));