Create ol.Coordinate around goog.math.Coordinate
This commit is contained in:
@@ -6,6 +6,7 @@ goog.provide('ol.control.Drag');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol.Control');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
|
||||
|
||||
@@ -45,12 +46,12 @@ ol.control.Drag = function() {
|
||||
this.offsetY = 0;
|
||||
|
||||
/**
|
||||
* @type {goog.math.Coordinate}
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
this.startCenter = null;
|
||||
|
||||
/**
|
||||
* @type {goog.math.Coordinate}
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
this.startCoordinate = null;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
goog.provide('ol.control.DragPan');
|
||||
|
||||
goog.require('goog.math.Coordinate');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
goog.require('ol.control.Drag');
|
||||
|
||||
@@ -22,7 +22,7 @@ goog.inherits(ol.control.DragPan, ol.control.Drag);
|
||||
ol.control.DragPan.prototype.handleDrag = function(mapBrowserEvent) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var resolution = map.getResolution();
|
||||
var center = new goog.math.Coordinate(
|
||||
var center = new ol.Coordinate(
|
||||
this.startCenter.x - resolution * this.deltaX,
|
||||
this.startCenter.y + resolution * this.deltaY);
|
||||
map.setCenter(center);
|
||||
|
||||
Reference in New Issue
Block a user