Rename _ol_Geolocation_ to Geolocation

This commit is contained in:
Frederic Junod
2017-12-16 08:15:59 +01:00
parent bf6a18dfc4
commit e3bf72f90e
5 changed files with 30 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import _ol_Geolocation_ from '../src/ol/Geolocation.js'; import Geolocation from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js'; import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js'; import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js'; import _ol_View_ from '../src/ol/View.js';
@@ -46,7 +46,7 @@ var positions = new LineString([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM')); /** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control // Geolocation Control
var geolocation = new _ol_Geolocation_({ var geolocation = new Geolocation({
projection: view.getProjection(), projection: view.getProjection(),
trackingOptions: { trackingOptions: {
maximumAge: 10000, maximumAge: 10000,

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../src/ol/Feature.js'; import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Geolocation_ from '../src/ol/Geolocation.js'; import Geolocation from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js'; import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js'; import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js'; import _ol_control_ from '../src/ol/control.js';
@@ -33,7 +33,7 @@ var map = new _ol_Map_({
view: view view: view
}); });
var geolocation = new _ol_Geolocation_({ var geolocation = new Geolocation({
projection: view.getProjection() projection: view.getProjection()
}); });

View File

@@ -1,4 +1,4 @@
import _ol_Geolocation_ from '../src/ol/Geolocation.js'; import Geolocation from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js'; import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js'; import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
@@ -23,7 +23,7 @@ var map = new _ol_Map_({
view: view view: view
}); });
var geolocation = new _ol_Geolocation_({ var geolocation = new Geolocation({
projection: view.getProjection(), projection: view.getProjection(),
tracking: true tracking: true
}); });

View File

@@ -55,7 +55,7 @@ export var GeolocationOptions;
* is reported in. * is reported in.
* @api * @api
*/ */
var _ol_Geolocation_ = function(opt_options) { var Geolocation = function(opt_options) {
_ol_Object_.call(this); _ol_Object_.call(this);
@@ -104,13 +104,13 @@ var _ol_Geolocation_ = function(opt_options) {
}; };
inherits(_ol_Geolocation_, _ol_Object_); inherits(Geolocation, _ol_Object_);
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_Geolocation_.prototype.disposeInternal = function() { Geolocation.prototype.disposeInternal = function() {
this.setTracking(false); this.setTracking(false);
_ol_Object_.prototype.disposeInternal.call(this); _ol_Object_.prototype.disposeInternal.call(this);
}; };
@@ -119,7 +119,7 @@ _ol_Geolocation_.prototype.disposeInternal = function() {
/** /**
* @private * @private
*/ */
_ol_Geolocation_.prototype.handleProjectionChanged_ = function() { Geolocation.prototype.handleProjectionChanged_ = function() {
var projection = this.getProjection(); var projection = this.getProjection();
if (projection) { if (projection) {
this.transform_ = getTransformFromProjections( this.transform_ = getTransformFromProjections(
@@ -135,7 +135,7 @@ _ol_Geolocation_.prototype.handleProjectionChanged_ = function() {
/** /**
* @private * @private
*/ */
_ol_Geolocation_.prototype.handleTrackingChanged_ = function() { Geolocation.prototype.handleTrackingChanged_ = function() {
if (_ol_has_.GEOLOCATION) { if (_ol_has_.GEOLOCATION) {
var tracking = this.getTracking(); var tracking = this.getTracking();
if (tracking && this.watchId_ === undefined) { if (tracking && this.watchId_ === undefined) {
@@ -155,7 +155,7 @@ _ol_Geolocation_.prototype.handleTrackingChanged_ = function() {
* @private * @private
* @param {GeolocationPosition} position position event. * @param {GeolocationPosition} position position event.
*/ */
_ol_Geolocation_.prototype.positionChange_ = function(position) { Geolocation.prototype.positionChange_ = function(position) {
var coords = position.coords; var coords = position.coords;
this.set(_ol_GeolocationProperty_.ACCURACY, coords.accuracy); this.set(_ol_GeolocationProperty_.ACCURACY, coords.accuracy);
this.set(_ol_GeolocationProperty_.ALTITUDE, this.set(_ol_GeolocationProperty_.ALTITUDE,
@@ -192,7 +192,7 @@ _ol_Geolocation_.prototype.positionChange_ = function(position) {
* @private * @private
* @param {GeolocationPositionError} error error object. * @param {GeolocationPositionError} error error object.
*/ */
_ol_Geolocation_.prototype.positionError_ = function(error) { Geolocation.prototype.positionError_ = function(error) {
error.type = EventType.ERROR; error.type = EventType.ERROR;
this.setTracking(false); this.setTracking(false);
this.dispatchEvent(/** @type {{type: string, target: undefined}} */ (error)); this.dispatchEvent(/** @type {{type: string, target: undefined}} */ (error));
@@ -206,7 +206,7 @@ _ol_Geolocation_.prototype.positionError_ = function(error) {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getAccuracy = function() { Geolocation.prototype.getAccuracy = function() {
return ( return (
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ACCURACY) /** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ACCURACY)
); );
@@ -219,7 +219,7 @@ _ol_Geolocation_.prototype.getAccuracy = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getAccuracyGeometry = function() { Geolocation.prototype.getAccuracyGeometry = function() {
return ( return (
/** @type {?ol.geom.Polygon} */ this.get(_ol_GeolocationProperty_.ACCURACY_GEOMETRY) || null /** @type {?ol.geom.Polygon} */ this.get(_ol_GeolocationProperty_.ACCURACY_GEOMETRY) || null
); );
@@ -233,7 +233,7 @@ _ol_Geolocation_.prototype.getAccuracyGeometry = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getAltitude = function() { Geolocation.prototype.getAltitude = function() {
return ( return (
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE) /** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE)
); );
@@ -247,7 +247,7 @@ _ol_Geolocation_.prototype.getAltitude = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getAltitudeAccuracy = function() { Geolocation.prototype.getAltitudeAccuracy = function() {
return ( return (
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE_ACCURACY) /** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE_ACCURACY)
); );
@@ -260,7 +260,7 @@ _ol_Geolocation_.prototype.getAltitudeAccuracy = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getHeading = function() { Geolocation.prototype.getHeading = function() {
return ( return (
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.HEADING) /** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.HEADING)
); );
@@ -274,7 +274,7 @@ _ol_Geolocation_.prototype.getHeading = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getPosition = function() { Geolocation.prototype.getPosition = function() {
return ( return (
/** @type {ol.Coordinate|undefined} */ this.get(_ol_GeolocationProperty_.POSITION) /** @type {ol.Coordinate|undefined} */ this.get(_ol_GeolocationProperty_.POSITION)
); );
@@ -288,7 +288,7 @@ _ol_Geolocation_.prototype.getPosition = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getProjection = function() { Geolocation.prototype.getProjection = function() {
return ( return (
/** @type {ol.proj.Projection|undefined} */ this.get(_ol_GeolocationProperty_.PROJECTION) /** @type {ol.proj.Projection|undefined} */ this.get(_ol_GeolocationProperty_.PROJECTION)
); );
@@ -302,7 +302,7 @@ _ol_Geolocation_.prototype.getProjection = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getSpeed = function() { Geolocation.prototype.getSpeed = function() {
return ( return (
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.SPEED) /** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.SPEED)
); );
@@ -315,7 +315,7 @@ _ol_Geolocation_.prototype.getSpeed = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getTracking = function() { Geolocation.prototype.getTracking = function() {
return ( return (
/** @type {boolean} */ this.get(_ol_GeolocationProperty_.TRACKING) /** @type {boolean} */ this.get(_ol_GeolocationProperty_.TRACKING)
); );
@@ -331,7 +331,7 @@ _ol_Geolocation_.prototype.getTracking = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.getTrackingOptions = function() { Geolocation.prototype.getTrackingOptions = function() {
return ( return (
/** @type {GeolocationPositionOptions|undefined} */ this.get(_ol_GeolocationProperty_.TRACKING_OPTIONS) /** @type {GeolocationPositionOptions|undefined} */ this.get(_ol_GeolocationProperty_.TRACKING_OPTIONS)
); );
@@ -345,7 +345,7 @@ _ol_Geolocation_.prototype.getTrackingOptions = function() {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.setProjection = function(projection) { Geolocation.prototype.setProjection = function(projection) {
this.set(_ol_GeolocationProperty_.PROJECTION, getProjection(projection)); this.set(_ol_GeolocationProperty_.PROJECTION, getProjection(projection));
}; };
@@ -356,7 +356,7 @@ _ol_Geolocation_.prototype.setProjection = function(projection) {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.setTracking = function(tracking) { Geolocation.prototype.setTracking = function(tracking) {
this.set(_ol_GeolocationProperty_.TRACKING, tracking); this.set(_ol_GeolocationProperty_.TRACKING, tracking);
}; };
@@ -370,7 +370,7 @@ _ol_Geolocation_.prototype.setTracking = function(tracking) {
* @observable * @observable
* @api * @api
*/ */
_ol_Geolocation_.prototype.setTrackingOptions = function(options) { Geolocation.prototype.setTrackingOptions = function(options) {
this.set(_ol_GeolocationProperty_.TRACKING_OPTIONS, options); this.set(_ol_GeolocationProperty_.TRACKING_OPTIONS, options);
}; };
export default _ol_Geolocation_; export default Geolocation;

View File

@@ -1,4 +1,4 @@
import _ol_Geolocation_ from '../../../src/ol/Geolocation.js'; import Geolocation from '../../../src/ol/Geolocation.js';
describe('ol.Geolocation', function() { describe('ol.Geolocation', function() {
@@ -6,8 +6,8 @@ describe('ol.Geolocation', function() {
describe('constructor', function() { describe('constructor', function() {
it('can be constructed without arguments', function() { it('can be constructed without arguments', function() {
var instance = new _ol_Geolocation_(); var instance = new Geolocation();
expect(instance).to.be.an(_ol_Geolocation_); expect(instance).to.be.an(Geolocation);
}); });
}); });