-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate offline basemaps provided by protomap
- Loading branch information
1 parent
c671dc6
commit 4fa3602
Showing
19 changed files
with
747 additions
and
156 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 20 additions & 9 deletions
29
projects/arlas-components/src/lib/components/mapgl-basemap/mapgl-basemap.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
<div *ngIf="basemapStyles && basemapStyles.length > 1" class="basemap-container"> | ||
|
||
<div *ngFor="let style of basemapStyles" class="basemap" [class.selected]="style.name === selectedBasemap?.name" (click)="onChangeBasemapStyle(style)"> | ||
<div class="image"> | ||
<img *ngIf="!!style?.image && style?.image !== ''" src="{{style?.image}}" (error)="style.image = null" /> | ||
<div *ngIf="!style?.image || (!!style?.image && style?.image === '')" class="no-image"> | ||
<mat-icon>wallpaper</mat-icon> | ||
<div *ngIf="showList" class="basemap-container"> | ||
<ng-container *ngIf="isOnline; else offline"> | ||
<div *ngFor="let style of onlineBasemaps?._styles" class="basemap" [class.selected]="style.name === onlineBasemaps?._selectedStyle?.name" (click)="onChangeOnlineBasemap(style)"> | ||
<div class="image"> | ||
<img *ngIf="!!style?.image && style?.image !== ''" src="{{style?.image}}" (error)="style.image = null" /> | ||
<div *ngIf="!style?.image || (!!style?.image && style?.image === '')" class="no-image"> | ||
<mat-icon>wallpaper</mat-icon> | ||
</div> | ||
<div class="name">{{style.name | translate}}</div> | ||
</div> | ||
<div class="name">{{style.name | translate}}</div> | ||
</div> | ||
</div> | ||
</ng-container> | ||
<ng-template #offline> | ||
<div *ngFor="let theme of offlineBasemaps?._themes" class="basemap" [class.selected]="theme.name === offlineBasemaps?._selectedTheme?.name" (click)="onChangeOfflineBasemap(theme)"> | ||
<div class="image"> | ||
<div class="no-image"> | ||
<mat-icon>wallpaper</mat-icon> | ||
</div> | ||
<div class="name">{{theme.name | translate}}</div> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</div> |
17 changes: 15 additions & 2 deletions
17
projects/arlas-components/src/lib/components/mapgl-basemap/mapgl-basemap.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
projects/arlas-components/src/lib/components/mapgl/basemaps/basemap.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Licensed to Gisaïa under one or more contributor | ||
* license agreements. See the NOTICE.txt file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Gisaïa licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
|
||
// DISCLAIMER | ||
// -- The word 'Style' is reserved to online basemaps. | ||
// -- The word 'Theme' is reserved to offline basemaps. | ||
|
||
export interface BasemapsConfig { | ||
isOnline: boolean; | ||
onlineConfig?: OnlineBasemapConfig; | ||
offlineConfig?: OfflineBasemapsConfig; | ||
} | ||
|
||
export interface OnlineBasemapConfig { | ||
styles: BasemapStyle[]; | ||
defaultStyle: BasemapStyle; | ||
} | ||
|
||
export interface OfflineBasemapsConfig { | ||
/** Path to pmtiles file */ | ||
url: string; | ||
glyphsUrl: string; | ||
themes: OfflineBasemapTheme[]; | ||
defaultTheme: OfflineBasemapTheme; | ||
} | ||
|
||
|
||
export interface OfflineBasemapTheme { | ||
layers: mapboxgl.Layer[]; | ||
name: string; | ||
} | ||
|
||
export interface BasemapStyle { | ||
name: string; | ||
styleFile: string | mapboxgl.Style; | ||
image?: string; | ||
} | ||
|
Oops, something went wrong.