File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1376,17 +1376,16 @@ export class LeafletRenderer extends MarkdownRenderChild {
1376
1376
}
1377
1377
1378
1378
let err : boolean = false ;
1379
+ const convertedLatitude = Number ( `${ latitude } ` ?. split ( "%" ) . shift ( ) ) ;
1380
+ const convertedLongitude = Number ( `${ longitude } ` ?. split ( "%" ) . shift ( ) ) ;
1379
1381
try {
1380
- coords = [
1381
- Number ( `${ latitude } ` ?. split ( "%" ) . shift ( ) ) ,
1382
- Number ( `${ longitude } ` ?. split ( "%" ) . shift ( ) )
1383
- ] ;
1382
+ coords = [ convertedLatitude , convertedLongitude ] ;
1384
1383
} catch ( e ) {
1385
1384
err = true ;
1386
1385
}
1387
1386
1388
1387
if (
1389
- ( latitude || longitude ) &&
1388
+ ( ! isNaN ( convertedLatitude ) || ! isNaN ( convertedLongitude ) ) &&
1390
1389
( err || isNaN ( coords [ 0 ] ) || isNaN ( coords [ 1 ] ) )
1391
1390
) {
1392
1391
new Notice (
@@ -1396,17 +1395,17 @@ export class LeafletRenderer extends MarkdownRenderChild {
1396
1395
) ;
1397
1396
}
1398
1397
if ( map . type != "real" ) {
1399
- if ( ! latitude || isNaN ( coords [ 0 ] ) ) {
1398
+ if ( ! isNaN ( convertedLatitude ) || isNaN ( coords [ 0 ] ) ) {
1400
1399
coords [ 0 ] = 50 ;
1401
1400
}
1402
- if ( ! longitude || isNaN ( coords [ 1 ] ) ) {
1401
+ if ( ! isNaN ( convertedLongitude ) || isNaN ( coords [ 1 ] ) ) {
1403
1402
coords [ 1 ] = 50 ;
1404
1403
}
1405
1404
} else {
1406
- if ( ! latitude || isNaN ( coords [ 0 ] ) ) {
1405
+ if ( ! isNaN ( convertedLatitude ) || isNaN ( coords [ 0 ] ) ) {
1407
1406
coords [ 0 ] = this . plugin . data . lat ;
1408
1407
}
1409
- if ( ! longitude || isNaN ( coords [ 1 ] ) ) {
1408
+ if ( ! isNaN ( convertedLongitude ) || isNaN ( coords [ 1 ] ) ) {
1410
1409
coords [ 1 ] = this . plugin . data . long ;
1411
1410
}
1412
1411
}
You can’t perform that action at this time.
0 commit comments