@@ -521,14 +521,75 @@ class graphly extends EventEmitter {
521
521
this . tooltip . append ( 'div' )
522
522
. text ( key + ': ' + val )
523
523
}
524
- if ( self . currentData . hasOwnProperty ( 'Latitude' ) &&
525
- self . currentData . hasOwnProperty ( 'Longitude' ) &&
526
- self . currentData . hasOwnProperty ( 'Radius' ) ) {
524
+ // Check to see if data has set some aliases
525
+ if ( self . renderSettings . hasOwnProperty ( 'positionAlias' ) ) {
526
+ let posAlias = self . renderSettings . positionAlias ;
527
+ var lat , lon , alt ;
528
+ var cmobPar = self . renderSettings . combinedParameters ;
529
+
530
+ if ( cmobPar . hasOwnProperty ( posAlias . latitude ) ) {
531
+ var key = cmobPar [ posAlias . latitude ] ;
532
+ if ( self . currentData . hasOwnProperty ( key [ 0 ] ) &&
533
+ self . currentData . hasOwnProperty ( key [ 1 ] ) ) {
534
+ lat = [
535
+ self . currentData [ key [ 0 ] ] [ nodeId . index ] ,
536
+ self . currentData [ key [ 1 ] ] [ nodeId . index ]
537
+ ] ;
538
+ }
539
+
540
+ } else {
541
+ if ( self . currentData . hasOwnProperty ( posAlias . latitude ) ) {
542
+ lat = self . currentData [ [ posAlias . latitude ] ] [ nodeId . index ] ;
543
+ }
544
+ }
545
+
546
+ if ( cmobPar . hasOwnProperty ( posAlias . longitude ) ) {
547
+ var key = cmobPar [ posAlias . longitude ] ;
548
+ if ( self . currentData . hasOwnProperty ( key [ 0 ] ) &&
549
+ self . currentData . hasOwnProperty ( key [ 1 ] ) ) {
550
+ lon = [
551
+ self . currentData [ key [ 0 ] ] [ nodeId . index ] ,
552
+ self . currentData [ key [ 1 ] ] [ nodeId . index ]
553
+ ] ;
554
+ }
555
+
556
+ } else {
557
+ if ( self . currentData . hasOwnProperty ( posAlias . longitude ) ) {
558
+ lon = self . currentData [ [ posAlias . longitude ] ] [ nodeId . index ] ;
559
+ }
560
+ }
561
+
562
+ if ( cmobPar . hasOwnProperty ( posAlias . altitude ) ) {
563
+ var key = cmobPar [ posAlias . altitude ] ;
564
+ if ( self . currentData . hasOwnProperty ( key [ 0 ] ) &&
565
+ self . currentData . hasOwnProperty ( key [ 1 ] ) ) {
566
+ alt = [
567
+ self . currentData [ key [ 0 ] ] [ nodeId . index ] ,
568
+ self . currentData [ key [ 1 ] ] [ nodeId . index ]
569
+ ] ;
570
+ }
571
+
572
+ } else {
573
+ if ( self . currentData . hasOwnProperty ( posAlias . altitude ) ) {
574
+ alt = self . currentData [ [ posAlias . altitude ] ] [ nodeId . index ] ;
575
+ }
576
+ }
577
+
527
578
this . emit ( 'pointSelect' , {
528
- Latitude : self . currentData . Latitude [ nodeId . index ] ,
529
- Longitude : self . currentData . Longitude [ nodeId . index ] ,
530
- Radius : self . currentData . Radius [ nodeId . index ]
579
+ Latitude : lat ,
580
+ Longitude : lon ,
581
+ Radius : alt
531
582
} ) ;
583
+ } else {
584
+ if ( self . currentData . hasOwnProperty ( 'Latitude' ) &&
585
+ self . currentData . hasOwnProperty ( 'Longitude' ) &&
586
+ self . currentData . hasOwnProperty ( 'Radius' ) ) {
587
+ this . emit ( 'pointSelect' , {
588
+ Latitude : self . currentData . Latitude [ nodeId . index ] ,
589
+ Longitude : self . currentData . Longitude [ nodeId . index ] ,
590
+ Radius : self . currentData . Radius [ nodeId . index ]
591
+ } ) ;
592
+ }
532
593
}
533
594
} else {
534
595
for ( let key in nodeId ) {
0 commit comments