Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/flyXCPublic

Commita8c612e

Browse files
authored
up (#348)
* Update deps* Drop sponsorThanks Niviuk for the last 2 years!* remove deprecated fns* minor tweaks
1 parent652a054 commita8c612e

File tree

6 files changed

+846
-316
lines changed

6 files changed

+846
-316
lines changed

‎apps/fxc-front/src/app/components/2d/map-element.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export class MapElement extends connect(store)(LitElement) {
9999
privatelockOnPilot=false;
100100
privatelockPanBefore=0;
101101
privatesubscriptions:UnsubscribeHandle[]=[];
102-
privatereadonlyadRatio=store.getState().browser.isSmallScreen ?0.7 :1;
103102

104103
stateChanged(state:RootState):void{
105104
this.tracks=sel.tracks(state);
@@ -182,16 +181,6 @@ export class MapElement extends connect(store)(LitElement) {
182181
controls.map=this.map;
183182
this.map.controls[google.maps.ControlPosition.TOP_LEFT].push(controls);
184183

185-
if(!store.getState().browser.isFromFfvl){
186-
constad=document.createElement('a');
187-
ad.setAttribute('href','https://www.niviuk.com/');
188-
ad.setAttribute('target','_blank');
189-
ad.innerHTML=`<img width="${Math.round(175*this.adRatio)}" height="${Math.round(
190-
32*this.adRatio,
191-
)}" src="/static/img/niviuk.svg">`;
192-
this.map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ad);
193-
}
194-
195184
this.map.addListener('click',(e:google.maps.MapMouseEvent)=>{
196185
constlatLng=e.latLngasgoogle.maps.LatLng;
197186
constfound=findClosestFix(this.tracks,latLng.lat(),latLng.lng());

‎apps/fxc-front/src/app/components/3d/airspace3d-element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Airspace3dElement extends connect(store)(LitElement) {
7171
this.showTypes,
7272
);
7373
if(html){
74-
view.popup.open({
74+
view.popup?.open({
7575
location:{
7676
latitude:latLon.lat,
7777
longitude:latLon.lon,

‎apps/fxc-front/src/app/components/3d/map3d-element.ts

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import './tracking3d-element';
77

88
importBasemapfrom'@arcgis/core/Basemap';
99
importesriConfigfrom'@arcgis/core/config';
10+
import{watch}from'@arcgis/core/core/reactiveUtils.js';
1011
importPointfrom'@arcgis/core/geometry/Point';
1112
importBaseElevationLayerfrom'@arcgis/core/layers/BaseElevationLayer';
1213
importElevationLayerfrom'@arcgis/core/layers/ElevationLayer';
@@ -77,7 +78,6 @@ export class Map3dElement extends connect(store)(LitElement) {
7778
privatesubscriptions:UnsubscribeHandle[]=[];
7879
privatepreviousLookAt?:LatLonAlt;
7980
privateupdateCamera=false;
80-
privatereadonlyadRatio=store.getState().browser.isSmallScreen ?0.7 :1;
8181

8282
stateChanged(state:RootState):void{
8383
this.tracks=sel.tracks(state);
@@ -99,9 +99,9 @@ export class Map3dElement extends connect(store)(LitElement) {
9999
constdLon=lookAt.lon-this.previousLookAt.lon;
100100
constdAlt=lookAt.alt-this.previousLookAt.alt;
101101
constcamera=this.view.camera.clone();
102-
camera.position.latitude+=dLat;
103-
camera.position.longitude+=dLon;
104-
camera.position.z+=dAlt*this.multiplier;
102+
camera.position.latitude=(camera.position.latitude??0)+dLat;
103+
camera.position.longitude=(camera.position.longitude??0)+dLon;
104+
camera.position.z=(camera.position.z??0)+dAlt*this.multiplier;
105105
this.view.camera=camera;
106106
}
107107
}
@@ -200,28 +200,22 @@ export class Map3dElement extends connect(store)(LitElement) {
200200
this.view=view;
201201
this.createLighting();
202202

203-
view.watch('popup.visible',(visible)=>{
204-
if(visible==false){
205-
store.dispatch(setCurrentLiveId(undefined));
206-
}
207-
});
208-
view.popup.viewModel.includeDefaultActions=false;
203+
watch(
204+
()=>view.popup?.visible,
205+
(visible)=>{
206+
if(visible==false){
207+
store.dispatch(setCurrentLiveId(undefined));
208+
}
209+
},
210+
);
211+
if(view.popup){
212+
view.popup.viewModel.includeDefaultActions=false;
213+
}
209214
view.ui.remove('zoom');
210215

211216
constcontrols=document.createElement('controls3d-element');
212217
view.ui.add(controls,'top-left');
213218

214-
if(!store.getState().browser.isFromFfvl){
215-
constad=document.createElement('a');
216-
ad.setAttribute('href','https://www.niviuk.com/');
217-
ad.setAttribute('target','_blank');
218-
ad.className='ad';
219-
ad.innerHTML=`<img width="${Math.round(175*this.adRatio)}" height="${Math.round(
220-
40*this.adRatio,
221-
)}" src="/static/img/niviuk.svg">`;
222-
view.ui.add(ad);
223-
}
224-
225219
constlayerSwitcher=this.renderRoot.querySelector('#layers')asHTMLSelectElement;
226220
view.ui.add(layerSwitcher,'top-right');
227221
view.ui.move([layerSwitcher,'compass','navigation-toggle'],'top-right');
@@ -254,7 +248,10 @@ export class Map3dElement extends connect(store)(LitElement) {
254248
this.center({ ...location,alt:0},zoom);
255249
}
256250

257-
view.watch('center',(point:Point)=>this.handleLocation({lat:point.latitude,lon:point.longitude}));
251+
watch(
252+
()=>view.center,
253+
(point:Point)=>this.handleLocation({lat:point.latitude??0,lon:point.longitude??0}),
254+
);
258255
})
259256
.catch(async(e)=>{
260257
store.dispatch(setApiLoading(false));
@@ -288,7 +285,7 @@ export class Map3dElement extends connect(store)(LitElement) {
288285
store.dispatch(setCurrentTrackId(trackId));
289286
}
290287
}else{
291-
this.airspace?.handleClick({lat:e.mapPoint.latitude,lon:e.mapPoint.longitude},view);
288+
this.airspace?.handleClick({lat:e.mapPoint.latitude??0,lon:e.mapPoint.longitude??0},view);
292289
}
293290
});
294291
});
@@ -418,12 +415,6 @@ export class Map3dElement extends connect(store)(LitElement) {
418415
#layers {
419416
font:18px Roboto, arial, sans-serif!important;
420417
}
421-
.ad {
422-
box-shadow: none;
423-
bottom:10px;
424-
left:50%;
425-
transform:translate(-50%,0);
426-
}
427418
</style>
428419
<divid="map3d"></div>
429420
<selectid="layers"@change=${(e:any)=>this.map?.set('basemap',this.basemaps[e.target.value])}>

‎apps/fxc-front/src/app/components/3d/tracking3d-element.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,18 @@ export class Tracking3DElement extends connect(store)(LitElement) {
298298
point=this.sampler.queryElevation(point)asPoint;
299299
}
300300
// The sampler sometimes return incorrect values (i.e. 3.40...e+37).
301-
if(point.z>20000){
301+
if((point.z??0)>20000){
302302
point.z=0;
303303
}
304-
point.z=Math.max(point.z,feature.geometry.coordinates[2]*this.multiplier);
304+
point.z=Math.max(point.z!,feature.geometry.coordinates[2]*this.multiplier);
305305
graphic.set('geometry',point);
306306
graphic.set('attributes',{liveTrackId:pilotId,liveTrackIndex:pointProperties.index});
307307
markers.push(graphic);
308308

309309
if(label){
310310
constgraphic=newGraphic();
311311
point=point.clone();
312-
point.z+=MSG_MARKER_HEIGHT;
312+
point.z!+=MSG_MARKER_HEIGHT;
313313
graphic.set('geometry',point);
314314
this.txtSymbol.symbolLayers[0].text=label;
315315
this.txtSymbol.symbolLayers[0].material.color=isActive ?'#BF1515' :'black';
@@ -339,7 +339,7 @@ export class Tracking3DElement extends connect(store)(LitElement) {
339339

340340
consttrack=liveTrackSelectors.selectById(store.getState(),attr.liveTrackId)asprotos.LiveTrack;
341341

342-
view.popup.open({
342+
view.popup?.open({
343343
location:newPoint({
344344
latitude:track.lat[index],
345345
longitude:track.lon[index],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp