s/ol3/ol/

This commit is contained in:
Tom Payne
2012-09-24 14:21:41 +02:00
parent 6737220b83
commit f8c31ba45c
112 changed files with 3755 additions and 3755 deletions
+53
View File
@@ -0,0 +1,53 @@
goog.provide('ol.MapBrowserEvent');
goog.require('goog.events.BrowserEvent');
goog.require('goog.style');
goog.require('ol.Coordinate');
goog.require('ol.MapEvent');
goog.require('ol.Pixel');
/**
* @constructor
* @extends {ol.MapEvent}
* @param {string} type Event type.
* @param {ol.Map} map Map.
* @param {goog.events.BrowserEvent} browserEvent Browser event.
*/
ol.MapBrowserEvent = function(type, map, browserEvent) {
goog.base(this, type, map);
/**
* @type {goog.events.BrowserEvent}
*/
this.browserEvent = browserEvent;
/**
* @private
* @type {ol.Coordinate|undefined}
*/
this.coordinate_ = undefined;
};
goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
/**
* @return {ol.Coordinate|undefined} Coordinate.
*/
ol.MapBrowserEvent.prototype.getCoordinate = function() {
if (goog.isDef(this.coordinate_)) {
return this.coordinate_;
} else {
var map = this.map;
var browserEvent = this.browserEvent;
var eventPosition = goog.style.getRelativePosition(
browserEvent, map.getViewport());
var pixel = new ol.Pixel(eventPosition.x, eventPosition.y);
var coordinate = map.getCoordinateFromPixel(pixel);
this.coordinate_ = coordinate;
return coordinate;
}
};