Skip to content

Commit

Permalink
Add Google 3D tiles to arcgis
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Mar 19, 2024
1 parent ba2c56a commit 8c460b2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/fxc-front/src/app/components/3d/map3d-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import VirtualLighting from '@arcgis/core/views/3d/environment/VirtualLighting';
import SceneView from '@arcgis/core/views/SceneView';
import NavigationToggle from '@arcgis/core/widgets/NavigationToggle';
import Popup from '@arcgis/core/widgets/Popup';
import IntegratedMesh3DTilesLayer from '@arcgis/core/layers/IntegratedMesh3DTilesLayer.js';
import { LatLon, LatLonAlt, RuntimeTrack } from '@flyxc/common';
import { alertController } from '@ionic/core/components';
import { LitElement, PropertyValues, TemplateResult, html } from 'lit';
Expand All @@ -35,6 +36,7 @@ import { RootState, store } from '../../redux/store';
import { setCurrentTrackId } from '../../redux/track-slice';
import { Airspace3dElement } from './airspace3d-element';
import { Skyways3dElement } from './skyways3d-element';
import { getApiKey } from '../../apikey';

@customElement('map3d-element')
export class Map3dElement extends connect(store)(LitElement) {
Expand All @@ -61,6 +63,7 @@ export class Map3dElement extends connect(store)(LitElement) {
private airspace?: Airspace3dElement;
private basemaps: Record<string, string | Basemap | null> = {
Satellite: 'satellite',
Google: null,
OpenTopoMap: null,
Topo: 'topo-vector',
};
Expand Down Expand Up @@ -313,6 +316,18 @@ export class Map3dElement extends connect(store)(LitElement) {
title: 'otm',
id: 'otm',
});

this.basemaps.Google = new Basemap({
baseLayers: [
new IntegratedMesh3DTilesLayer({
url: 'https://tile.googleapis.com/v1/3dtiles/root.json',
title: 'Google tiles',
customParameters: { key: getApiKey('gmaps') },
}),
],
title: 'google',
id: 'google',
});
}

private createLighting() {
Expand Down

0 comments on commit 8c460b2

Please sign in to comment.