Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixups for coverage info processing. #141

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 🗺️ View map layers from a specific [`mapget`](https://github.com/klebert-engineering/mapget) server.
* 🎨 Define visual styles for map layers through style-sheets, translating specific features into visual elements in both 2D and 3D.
* 🏔️ Experience 3D features and terrains with a flexible 3D camera powered by [CesiumJS](https://github.com/CesiumGS/cesium/).
* ✍️ Edit map layer style sheets in real-time directly from the front-end **(Planned)**.
* ✍️ Edit map layer style sheets in real-time directly from the front-end.
* 🔍 Select multiple features at once using filter or lasso selection tools **(Planned)**.
* 🖼️ Utilize split-screen panes for optional overlay or synchronized navigation with an adjustable splitter **(Planned)**.
* 🔎 View multiple map layer tile zoom levels all at once **(Planned)**.
Expand Down
Binary file modified docs/erdblick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions erdblick_app/app/map.panel.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, ViewChild} from "@angular/core";
import {InfoMessageService} from "./info.service";
import {MapInfoItem, MapService} from "./map.service";
import {CoverageRectItem, MapInfoItem, MapService} from "./map.service";
import {ErdblickStyle, StyleService} from "./style.service";
import {ParametersService} from "./parameters.service";
import {FileUpload} from "primeng/fileupload";
Expand Down Expand Up @@ -60,7 +60,7 @@ import {Menu} from "primeng/menu";
<span class="material-icons"
style="font-size: 1.2em; margin: 0 auto;">{{ mapLayer.value.tileBorders ? 'select_all' : 'deselect' }}</span>
</p-button>
<p-button *ngIf="mapLayer.value.coverage[0]"
<p-button *ngIf="mapLayer.value.coverage.length"
(click)="focus(mapLayer.value.coverage[0], $event)"
label="" pTooltip="Focus on layer" tooltipPosition="bottom"
[style]="{'padding-left': '0', 'padding-right': '0'}">
Expand Down Expand Up @@ -353,20 +353,19 @@ export class MapPanelComponent {
}
}

focus(coverage: bigint|{min: bigint, max: bigint}, event?: any) {
focus(coverage: number|CoverageRectItem, event?: any) {
event?.stopPropagation();
if (coverage.hasOwnProperty("min") && coverage.hasOwnProperty("max")) {
let coverageStruct = coverage as {min: bigint, max: bigint};
let coverageStruct = coverage as CoverageRectItem;
let minPos = coreLib.getTilePosition(BigInt(coverageStruct.min));
let maxPos = coreLib.getTilePosition(BigInt(coverageStruct.max));
this.mapService.moveToWgs84PositionTopic.next(
{x: (minPos.x + maxPos.x) * .5, y: (minPos.y + maxPos.y) * .5}
);
}
else {
let coverageTileId = BigInt(coverage as bigint);
this.mapService.moveToWgs84PositionTopic.next(
coreLib.getTilePosition(BigInt(coverageTileId))
coreLib.getTilePosition(BigInt(coverage as number))
);
}
}
Expand Down
13 changes: 7 additions & 6 deletions erdblick_app/app/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ import {ErdblickStyle, StyleService} from "./style.service";
import {FeatureLayerStyle, TileLayerParser, Feature} from '../../build/libs/core/erdblick-core';
import {ParametersService} from "./parameters.service";
import {SidePanelService, SidePanelState} from "./sidepanel.service";
import {InfoMessageService} from "./info.service";
import {InfoMessageService} from "./info.service"

export interface CoverageRectItem extends Object {
min: number,
max: number
}

export interface LayerInfoItem extends Object {
canRead: boolean;
canWrite: boolean;
coverage: Array<bigint>;
coverage: Array<number|CoverageRectItem>;
featureTypes: Array<{name: string, uniqueIdCompositions: Array<Object>}>;
layerId: string;
type: string;
Expand Down Expand Up @@ -257,11 +262,7 @@ export class MapService {
let mapLayerLevels = new Array<[string, number, boolean, boolean]>();
let maps = new Map<string, MapInfoItem>(result.filter(m => !m.addOn).map(mapInfo => {
let layers = new Map<string, LayerInfoItem>();
let defCoverage = [0n];
for (let [layerId, layerInfo] of Object.entries(mapInfo.layers)) {
if (layerInfo.coverage.length == 0) {
layerInfo.coverage = defCoverage;
}
[layerInfo.visible, layerInfo.level, layerInfo.tileBorders] = this.parameterService.mapLayerConfig(mapInfo.mapId, layerId, 13);
mapLayerLevels.push([
mapInfo.mapId + '/' + layerId,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading