Skip to content

Commit

Permalink
Add ESI waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Sep 23, 2024
1 parent c6e38e5 commit 187b8ef
Show file tree
Hide file tree
Showing 2 changed files with 259 additions and 0 deletions.
243 changes: 243 additions & 0 deletions apps/fxc-front/src/app/components/2d/esi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
export const esi = {
kml: {
Document: {
name: 'Balises',
open: 1,
StyleMap: {
Pair: [
{
key: 'normal',
styleUrl: '#icon-1739-880E4F-normal',
},
{
key: 'highlight',
styleUrl: '#icon-1739-880E4F-highlight',
},
],
},
Style: [
{
IconStyle: {
color: 'ff4f0e88',
Icon: {
href: 'https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png',
},
},
},
{
IconStyle: {
color: 'ff4f0e88',
Icon: {
href: 'https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png',
},
},
LabelStyle: {
scale: 0,
},
},
],
Placemark: [
{
name: 'BV1 Château des chèvres',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.816977199999999,44.7628703,0',
},
},
{
name: 'BV2 Pilier nord Châtel',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.809899,44.821235,0',
},
},
{
name: 'BV3 Casse Varnage',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.799743600000001,44.7862175,0',
},
},
{
name: 'BV4 Pierre Aiguë',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.804542100000001,44.7936281,0',
},
},
{
name: 'BV5 Australie',
description: 'vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.8044905,44.7781589,0',
},
},
{
name: 'BV6 Petit Chatel',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7896321,44.8243438,0',
},
},
{
name: 'BV7 Pipet',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7647963,44.7786285,0',
},
},
{
name: 'BV8 Les moulins',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7239996,44.7655719,0',
},
},
{
name: 'BV9 Antenne de Lalley',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.6972417,44.7535807,0',
},
},
{
name: 'BV10 Mangelle',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7090363,44.7614134,0',
},
},
{
name: 'BV11 Jocou bas',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.6651448,44.7403212,0',
},
},
{
name: 'BV12 Jocou haut',
description: 'vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.6468629,44.7336145,0',
},
},
{
name: 'BV13 Grand Ferrand',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.8121731,44.7238622,0',
},
},
{
name: 'BV14 L'Aupet',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.8273837,44.7427524,0',
},
},
{
name: 'BV15 Lauzon',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.8012199,44.7078255,0',
},
},
{
name: 'BV16 La Rama',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7986942,44.6744128,0',
},
},
{
name: 'BV17 Longueville',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.80539,44.8031719,0',
},
},
{
name: 'BV18 Ratier',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.830747599999999,44.7807371,0',
},
},
{
name: 'BV19 Tête de la Cavalle',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.8278076,44.7674748,0',
},
},
{
name: 'BV20 Menil',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7566238,44.7598244,0',
},
},
{
name: 'BV21 Garnesier',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.791449599999999,44.6532817,0',
},
},
{
name: 'BV22 Chauvet',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.889327400000001,44.8512365,0',
},
},
{
name: 'BV23 Jas d'Oris',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.888070599999999,44.9292803,0',
},
},
{
name: 'BV24 Pointe Feuillette',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7440979,44.6995214,0',
},
},
{
name: 'BV25 Durbonas',
description: 'Vol',
styleUrl: '#icon-1739-880E4F',
Point: {
coordinates: '5.7582753,44.6117576,0',
},
},
],
},
},
};
16 changes: 16 additions & 0 deletions apps/fxc-front/src/app/components/2d/map-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { RootState } from '../../redux/store';
import { store } from '../../redux/store';
import { setCurrentTrackId } from '../../redux/track-slice';
import { ControlsElement } from './controls-element';
import { esi } from './esi';
import { LineElement } from './line-element';
import { MarkerElement } from './marker-element';
import { PlannerElement } from './planner-element';
Expand Down Expand Up @@ -177,6 +178,21 @@ export class MapElement extends connect(store)(LitElement) {

this.map = new google.maps.Map(this.querySelector('#map') as HTMLElement, options);

// esi
for (const placemark of esi.kml.Document.Placemark) {
const [lng, lat] = placemark.Point.coordinates.split(',').map((s) => Number(s));
new google.maps.Circle({
center: { lat, lng },
radius: 200,
strokeColor: 'black',
strokeWeight: 1,
fillColor: 'gray',
fillOpacity: 0.3,
map: this.map,
clickable: false,
});
}

const controls = document.createElement('controls-element') as ControlsElement;
controls.map = this.map;
this.map.controls[google.maps.ControlPosition.TOP_LEFT].push(controls);
Expand Down

0 comments on commit 187b8ef

Please sign in to comment.