Commit 9aa33eda authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

bbox

parent f9f43b9b
......@@ -105,9 +105,9 @@
"sAreaMultiPolygon": "MultiPolygon",
"tArea": "Select outlet type",
"tLatitude": "Latitude",
"tLatituderange": "range [-90 to 90]",
"tLatituderange": "range",
"tLongitude": "Longitude",
"tLongituderange": "range [-180 to 180]",
"tLongituderange": "range",
"rDDM": "Degrees Decimal Minutes ",
"rDD": "Decimal Degrees",
......@@ -126,10 +126,17 @@
};
// NEMO bbox
var bbox = {};
bbox['s'] = 48.4917;
bbox['n'] = 65.89142;
bbox['w'] = -4.15278;
bbox['e'] = 30.18021;
var oilspill = new L.Control.OilSpill({
"lang" : language,
"langdata" : langData
"langdata" : langData,
"bbox" : bbox
});
containerControl.addComponent("Continuous Oil spill", oilspill);
......
......@@ -72,7 +72,7 @@ var OilSpillCard = (function () {
}());
var OSLocation = (function (_super) {
__extends(OSLocation, _super);
function OSLocation(id, parentDiv, lang, langData, map) {
function OSLocation(id, parentDiv, lang, langData, map, bbox) {
var _this = this;
var locationDiv = L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
_this = _super.call(this, id, 'Specify time and location', parentDiv, locationDiv) || this;
......@@ -157,6 +157,7 @@ var OSLocation = (function (_super) {
"langdata": langData.coordinates,
"id": id,
"inline": true,
"bbox": bbox,
"table": true,
"type": false,
"buttons": false,
......@@ -917,6 +918,14 @@ var L;
if (options.langdata) {
_this.langData = options.langdata;
}
_this.bbox = {};
_this.bbox['s'] = -90;
_this.bbox['n'] = 90;
_this.bbox['w'] = -180;
_this.bbox['e'] = 180;
if (options.bbox) {
_this.bbox = options.bbox;
}
return _this;
}
OilSpill.prototype.onAdd = function (map) {
......@@ -1015,7 +1024,7 @@ var L;
this.container = L.DomUtil.create('div', 'oilspill-control');
var accordionDiv = L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = 'oslocationCard';
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map);
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map, self.bbox);
self.cardMap[locationid].show();
var periodid = 'osperiodCard';
self.cardMap[periodid] = new OSPeriod(periodid, accordionDiv, self.lang, self.map);
......
......@@ -72,7 +72,7 @@ var OilSpillCard = (function () {
}());
var OSLocation = (function (_super) {
__extends(OSLocation, _super);
function OSLocation(id, parentDiv, lang, langData, map) {
function OSLocation(id, parentDiv, lang, langData, map, bbox) {
var _this = this;
var locationDiv = L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
_this = _super.call(this, id, 'Specify time and location', parentDiv, locationDiv) || this;
......@@ -157,6 +157,7 @@ var OSLocation = (function (_super) {
"langdata": langData.coordinates,
"id": id,
"inline": true,
"bbox": bbox,
"table": true,
"type": false,
"buttons": false,
......
This diff is collapsed.
......@@ -96,7 +96,7 @@ class OSLocation extends OilSpillCard {
constructor(id, parentDiv, lang, langData, map) {
constructor(id, parentDiv, lang, langData, map, bbox) {
var locationDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
super(id, 'Specify time and location', parentDiv ,locationDiv);
var self = this;
......@@ -181,7 +181,8 @@ class OSLocation extends OilSpillCard {
"lang": lang,
"langdata": langData.coordinates,
"id": id,
"inline" : true,
"inline" : true,
"bbox": bbox,
"table" : true,
"type" : false,
"buttons" : false,
......
......@@ -31,6 +31,14 @@ var L;
if (options.langdata) {
_this.langData = options.langdata;
}
_this.bbox = {};
_this.bbox['s'] = -90;
_this.bbox['n'] = 90;
_this.bbox['w'] = -180;
_this.bbox['e'] = 180;
if (options.bbox) {
_this.bbox = options.bbox;
}
return _this;
}
OilSpill.prototype.onAdd = function (map) {
......@@ -129,7 +137,7 @@ var L;
this.container = L.DomUtil.create('div', 'oilspill-control');
var accordionDiv = L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = 'oslocationCard';
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map);
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map, self.bbox);
self.cardMap[locationid].show();
var periodid = 'osperiodCard';
self.cardMap[periodid] = new OSPeriod(periodid, accordionDiv, self.lang, self.map);
......
This diff is collapsed.
......@@ -21,6 +21,7 @@ module L.Control {
private selectCalculationMode: HTMLSelectElement;
private uncertaintyInput: HTMLInputElement;
private startButton: HTMLButtonElement;
private bbox: any;
constructor(options) {
super(options);
......@@ -35,6 +36,15 @@ module L.Control {
this.langData = options.langdata;
}
this.bbox = {};
this.bbox['s'] = -90;
this.bbox['n'] = 90;
this.bbox['w'] = -180;
this.bbox['e'] = 180;
if (options.bbox) {
this.bbox = options.bbox;
}
}
public onAdd(map) {
......@@ -136,7 +146,7 @@ module L.Control {
this.container = L.DomUtil.create('div', 'oilspill-control');
var accordionDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = 'oslocationCard';
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map);
self.cardMap[locationid] = new OSLocation(locationid, accordionDiv, self.lang, self.langData, self.map, self.bbox);
self.cardMap[locationid].show();
var periodid = 'osperiodCard';
self.cardMap[periodid] = new OSPeriod(periodid, accordionDiv, self.lang, self.map);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment