Compare commits

..

No commits in common. "b17bce1cd247f3a7859c9a00e2047dafea9a173a" and "d3c28847ec4413cd402fc033fe5464c5338a9d93" have entirely different histories.

3 changed files with 86 additions and 84 deletions

View File

@ -116,6 +116,8 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
if (!this.stylesCache[key]) { if (!this.stylesCache[key]) {
if (this.itemTypeService.itemTypes[key]) { if (this.itemTypeService.itemTypes[key]) {
let itemType = this.itemTypeService.itemTypes[key]; let itemType = this.itemTypeService.itemTypes[key];
let fillColor = color.asArray(itemType.iconColor);
fillColor[3] = this.selectedItem?0:0.5;
this.stylesCache[key] = new style.Style({ this.stylesCache[key] = new style.Style({
image: itemType.icon ? new style.Icon({ image: itemType.icon ? new style.Icon({
anchor: [0.5, 1], anchor: [0.5, 1],
@ -126,6 +128,9 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
color: 'red', color: 'red',
width: 1 width: 1
}), }),
fill: new style.Fill({
color: fillColor
}),
geometry:(feature) => this.geometry(feature) geometry:(feature) => this.geometry(feature)
}); });
} else { } else {

View File

@ -64,6 +64,9 @@ export class MapEffects {
stroke: new style.Stroke({ stroke: new style.Stroke({
color: 'red', color: 'red',
width: 1 width: 1
}),
fill: new style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
}) })
}))); })));
actions.push(new mapActions.SetStyle('selected',new style.Style({ actions.push(new mapActions.SetStyle('selected',new style.Style({
@ -75,6 +78,9 @@ export class MapEffects {
stroke: new style.Stroke({ stroke: new style.Stroke({
color: 'red', color: 'red',
width: 3 width: 3
}),
fill: new style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
}) })
}))); })));

View File

@ -64,21 +64,12 @@ export class TimespanService {
return this.getStartEndCaption(new Date(endDate.getTime() - (this.unitScales[unitScale] / 2)), startDate, unitScale, suffix); return this.getStartEndCaption(new Date(endDate.getTime() - (this.unitScales[unitScale] / 2)), startDate, unitScale, suffix);
} }
getCaption(startDate: Date, endDate: Date, unitScale?: number): string { getCaption(startDate: Date, endDate: Date, unitScale: number): string {
let scale = unitScale; let startCaption = this.getStartCaption(startDate, endDate, unitScale);
if(unitScale==null) { let endCaption = this.getEndCaption(startDate,endDate, unitScale);
scale=4; if ((endDate.getTime() - startDate.getTime()) < (1.5 * this.unitScales[unitScale]))
if(startDate.getUTCMonth() == 0 && startDate.getUTCDate() == 1 && startDate.getUTCHours() == 0 && startDate.getUTCMinutes() ==0 && startDate.getUTCSeconds() ==0 &&
endDate.getUTCMonth() == 0 && endDate.getUTCDate() == 1 && endDate.getUTCHours() == 0 && endDate.getUTCMinutes() ==0 && endDate.getUTCSeconds() ==0) {
scale=8;
} else if (startDate.getUTCHours() > 0 && startDate.getUTCMinutes() >0) {
scale =3
}
}
let startCaption = this.getStartCaption(startDate, endDate, scale);
let endCaption = this.getEndCaption(startDate,endDate, scale);
if ((endDate.getTime() - startDate.getTime()) < (1.5 * this.unitScales[scale]))
return endCaption; return endCaption;
return `${startCaption}-${endCaption}`; return `${startCaption}-${endCaption}`;
} }
} }