Skip to content

Commit

Permalink
fix(ol-map): make map instance public
Browse files Browse the repository at this point in the history
  • Loading branch information
mroseboom committed Dec 12, 2017
1 parent 60bd1f2 commit d419ed6
Show file tree
Hide file tree
Showing 40 changed files with 3,943 additions and 202 deletions.
5 changes: 4 additions & 1 deletion dist/amd/aurelia-openlayers.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { FrameworkConfiguration } from 'aurelia-framework';
import { AureliaOpenlayersConfiguration } from './ol-configuration';
import { OlMapService } from './services/ol-map-service';
import { OlMap } from './ol-map';
/**
* Configures the plugin.
*/
export declare function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: AureliaOpenlayersConfiguration) => void): void;
export { AureliaOpenlayersConfiguration, OlMapService };
export { AureliaOpenlayersConfiguration };
export { OlMapService };
export { OlMap };
3 changes: 2 additions & 1 deletion dist/amd/aurelia-openlayers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
define(["require", "exports", "./ol-configuration", "./services/ol-map-service"], function (require, exports, ol_configuration_1, ol_map_service_1) {
define(["require", "exports", "./ol-configuration", "./services/ol-map-service", "./ol-map"], function (require, exports, ol_configuration_1, ol_map_service_1, ol_map_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AureliaOpenlayersConfiguration = ol_configuration_1.AureliaOpenlayersConfiguration;
exports.OlMapService = ol_map_service_1.OlMapService;
exports.OlMap = ol_map_1.OlMap;
/**
* Configures the plugin.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/ol-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(["require", "exports", "./ol-map-defaults", "aurelia-pal"], function (req
/**
* A configuration builder for the openlayers plugin.
*/
var AureliaOpenlayersConfiguration = (function () {
var AureliaOpenlayersConfiguration = /** @class */ (function () {
function AureliaOpenlayersConfiguration(frameworkConfig, applySetter) {
var _this = this;
this.frameworkConfig = frameworkConfig;
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/ol-map-defaults.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(["require", "exports", "openlayers"], function (require, exports, ol) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DefaultMapSettings = (function () {
var DefaultMapSettings = /** @class */ (function () {
function DefaultMapSettings() {
this.layers = [
new ol.layer.Tile({
Expand Down
4 changes: 3 additions & 1 deletion dist/amd/ol-map.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/// <reference types="openlayers" />
import { DefaultMapSettings } from './ol-map-defaults';
import { OlMapService } from './services/ol-map-service';
import * as ol from 'openlayers';
export declare class OlMap {
private settings;
private olMapService;
map: ol.Map;
private mapReference;
private map;
constructor(settings: DefaultMapSettings, olMapService: OlMapService);
attached(): void;
}
3 changes: 2 additions & 1 deletion dist/amd/ol-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
define(["require", "exports", "aurelia-framework", "./ol-map-defaults", "./services/ol-map-service", "openlayers"], function (require, exports, aurelia_framework_1, ol_map_defaults_1, ol_map_service_1, ol) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var OlMap = (function () {
var OlMap = /** @class */ (function () {
function OlMap(settings, olMapService) {
this.settings = settings;
this.olMapService = olMapService;
Expand All @@ -27,6 +27,7 @@ define(["require", "exports", "aurelia-framework", "./ol-map-defaults", "./servi
aurelia_framework_1.inlineView("<template><div ref=\"mapReference\"></div></template>"),
aurelia_framework_1.customElement('ol-map'),
aurelia_framework_1.inject(ol_map_defaults_1.DefaultMapSettings, ol_map_service_1.OlMapService)
// @generateBindables()
], OlMap);
return OlMap;
}());
Expand Down
63 changes: 33 additions & 30 deletions dist/amd/services/ol-map-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define(["require", "exports"], function (require, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
// Keep track of the map instances
var maps = {};
var OlMapService = (function () {
var OlMapService = /** @class */ (function () {
function OlMapService() {
}
/**
Expand Down Expand Up @@ -105,33 +105,36 @@ define(["require", "exports"], function (require, exports) {
return OlMapService;
}());
exports.OlMapService = OlMapService;
function Deferred() {
/**
* A method to resolve the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} value : This value is used to resolve the promise
* If the value is a Promise then the associated promise assumes the state
* of Promise passed as value.
*/
this.resolve = null;
/**
* A method to reject the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} reason: The reason for the rejection of the Promise.
* Generally its an Error object. If however a Promise is passed, then the Promise
* itself will be the reason for rejection no matter the state of the Promise.
*/
this.reject = null;
/**
* A newly created Pomise object.
* Initially in pending state.
*/
this.promise = new Promise(function (resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
var Deferred = /** @class */ (function () {
function Deferred() {
var _this = this;
/**
* A method to resolve the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} value : This value is used to resolve the promise
* If the value is a Promise then the associated promise assumes the state
* of Promise passed as value.
*/
this.resolve = null;
/**
* A method to reject the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} reason: The reason for the rejection of the Promise.
* Generally its an Error object. If however a Promise is passed, then the Promise
* itself will be the reason for rejection no matter the state of the Promise.
*/
this.reject = null;
/**
* A newly created Pomise object.
* Initially in pending state.
*/
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
}
return Deferred;
}());
});
5 changes: 4 additions & 1 deletion dist/commonjs/aurelia-openlayers.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { FrameworkConfiguration } from 'aurelia-framework';
import { AureliaOpenlayersConfiguration } from './ol-configuration';
import { OlMapService } from './services/ol-map-service';
import { OlMap } from './ol-map';
/**
* Configures the plugin.
*/
export declare function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: AureliaOpenlayersConfiguration) => void): void;
export { AureliaOpenlayersConfiguration, OlMapService };
export { AureliaOpenlayersConfiguration };
export { OlMapService };
export { OlMap };
2 changes: 2 additions & 0 deletions dist/commonjs/aurelia-openlayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var ol_configuration_1 = require("./ol-configuration");
exports.AureliaOpenlayersConfiguration = ol_configuration_1.AureliaOpenlayersConfiguration;
var ol_map_service_1 = require("./services/ol-map-service");
exports.OlMapService = ol_map_service_1.OlMapService;
var ol_map_1 = require("./ol-map");
exports.OlMap = ol_map_1.OlMap;
/**
* Configures the plugin.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/ol-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var resources = {
/**
* A configuration builder for the openlayers plugin.
*/
var AureliaOpenlayersConfiguration = (function () {
var AureliaOpenlayersConfiguration = /** @class */ (function () {
function AureliaOpenlayersConfiguration(frameworkConfig, applySetter) {
var _this = this;
this.frameworkConfig = frameworkConfig;
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/ol-map-defaults.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ol = require("openlayers");
var DefaultMapSettings = (function () {
var DefaultMapSettings = /** @class */ (function () {
function DefaultMapSettings() {
this.layers = [
new ol.layer.Tile({
Expand Down
4 changes: 3 additions & 1 deletion dist/commonjs/ol-map.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/// <reference types="openlayers" />
import { DefaultMapSettings } from './ol-map-defaults';
import { OlMapService } from './services/ol-map-service';
import * as ol from 'openlayers';
export declare class OlMap {
private settings;
private olMapService;
map: ol.Map;
private mapReference;
private map;
constructor(settings: DefaultMapSettings, olMapService: OlMapService);
attached(): void;
}
3 changes: 2 additions & 1 deletion dist/commonjs/ol-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var aurelia_framework_1 = require("aurelia-framework");
var ol_map_defaults_1 = require("./ol-map-defaults");
var ol_map_service_1 = require("./services/ol-map-service");
var ol = require("openlayers");
var OlMap = (function () {
var OlMap = /** @class */ (function () {
function OlMap(settings, olMapService) {
this.settings = settings;
this.olMapService = olMapService;
Expand All @@ -30,6 +30,7 @@ var OlMap = (function () {
aurelia_framework_1.inlineView("<template><div ref=\"mapReference\"></div></template>"),
aurelia_framework_1.customElement('ol-map'),
aurelia_framework_1.inject(ol_map_defaults_1.DefaultMapSettings, ol_map_service_1.OlMapService)
// @generateBindables()
], OlMap);
return OlMap;
}());
Expand Down
63 changes: 33 additions & 30 deletions dist/commonjs/services/ol-map-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
// Keep track of the map instances
var maps = {};
var OlMapService = (function () {
var OlMapService = /** @class */ (function () {
function OlMapService() {
}
/**
Expand Down Expand Up @@ -104,32 +104,35 @@ var OlMapService = (function () {
return OlMapService;
}());
exports.OlMapService = OlMapService;
function Deferred() {
/**
* A method to resolve the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} value : This value is used to resolve the promise
* If the value is a Promise then the associated promise assumes the state
* of Promise passed as value.
*/
this.resolve = null;
/**
* A method to reject the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} reason: The reason for the rejection of the Promise.
* Generally its an Error object. If however a Promise is passed, then the Promise
* itself will be the reason for rejection no matter the state of the Promise.
*/
this.reject = null;
/**
* A newly created Pomise object.
* Initially in pending state.
*/
this.promise = new Promise(function (resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
var Deferred = /** @class */ (function () {
function Deferred() {
var _this = this;
/**
* A method to resolve the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} value : This value is used to resolve the promise
* If the value is a Promise then the associated promise assumes the state
* of Promise passed as value.
*/
this.resolve = null;
/**
* A method to reject the associated Promise with the value passed.
* If the promise is already settled it does nothing.
*
* @param {anything} reason: The reason for the rejection of the Promise.
* Generally its an Error object. If however a Promise is passed, then the Promise
* itself will be the reason for rejection no matter the state of the Promise.
*/
this.reject = null;
/**
* A newly created Pomise object.
* Initially in pending state.
*/
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
}
return Deferred;
}());
5 changes: 4 additions & 1 deletion dist/es2015/aurelia-openlayers.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { FrameworkConfiguration } from 'aurelia-framework';
import { AureliaOpenlayersConfiguration } from './ol-configuration';
import { OlMapService } from './services/ol-map-service';
import { OlMap } from './ol-map';
/**
* Configures the plugin.
*/
export declare function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: AureliaOpenlayersConfiguration) => void): void;
export { AureliaOpenlayersConfiguration, OlMapService };
export { AureliaOpenlayersConfiguration };
export { OlMapService };
export { OlMap };
5 changes: 4 additions & 1 deletion dist/es2015/aurelia-openlayers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AureliaOpenlayersConfiguration } from './ol-configuration';
import { OlMapService } from './services/ol-map-service';
import { OlMap } from './ol-map';
/**
* Configures the plugin.
*/
Expand All @@ -16,4 +17,6 @@ export function configure(frameworkConfig, callback) {
applyConfig();
}
// Exports
export { AureliaOpenlayersConfiguration, OlMapService };
export { AureliaOpenlayersConfiguration };
export { OlMapService };
export { OlMap };
2 changes: 1 addition & 1 deletion dist/es2015/ol-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var resources = {
/**
* A configuration builder for the openlayers plugin.
*/
var AureliaOpenlayersConfiguration = (function () {
var AureliaOpenlayersConfiguration = /** @class */ (function () {
function AureliaOpenlayersConfiguration(frameworkConfig, applySetter) {
var _this = this;
this.frameworkConfig = frameworkConfig;
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/ol-map-defaults.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as ol from 'openlayers';
var DefaultMapSettings = (function () {
var DefaultMapSettings = /** @class */ (function () {
function DefaultMapSettings() {
this.layers = [
new ol.layer.Tile({
Expand Down
4 changes: 3 additions & 1 deletion dist/es2015/ol-map.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/// <reference types="openlayers" />
import { DefaultMapSettings } from './ol-map-defaults';
import { OlMapService } from './services/ol-map-service';
import * as ol from 'openlayers';
export declare class OlMap {
private settings;
private olMapService;
map: ol.Map;
private mapReference;
private map;
constructor(settings: DefaultMapSettings, olMapService: OlMapService);
attached(): void;
}
3 changes: 2 additions & 1 deletion dist/es2015/ol-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { inject, customElement, inlineView } from 'aurelia-framework';
import { DefaultMapSettings } from './ol-map-defaults';
import { OlMapService } from './services/ol-map-service';
import * as ol from 'openlayers';
var OlMap = (function () {
var OlMap = /** @class */ (function () {
function OlMap(settings, olMapService) {
this.settings = settings;
this.olMapService = olMapService;
Expand All @@ -28,6 +28,7 @@ var OlMap = (function () {
inlineView("<template><div ref=\"mapReference\"></div></template>"),
customElement('ol-map'),
inject(DefaultMapSettings, OlMapService)
// @generateBindables()
], OlMap);
return OlMap;
}());
Expand Down
Loading

0 comments on commit d419ed6

Please sign in to comment.