@@ -149,22 +149,22 @@ var handleData = function(data) {
149149 if ( data ?. command ) { doCommand ( data . command ) ; delete data . command ; }
150150
151151 // handle raw geojson type msg
152- if ( data . hasOwnProperty ( " type" ) && data . type . indexOf ( "Feature" ) === 0 ) {
152+ if ( data ?. type && data . type . indexOf ( "Feature" ) === 0 ) {
153153 if ( data ?. properties ?. title ) {
154154 doGeojson ( data . properties . title , data , data ?. layer , data ?. options , data ?. icon ) // name, geojson, layer, options, icon
155155 }
156156 else { doGeojson ( "geojson" , data , data ?. layer , data ?. options , data ?. icon ) ; }
157157 }
158158 // handle TAK json (from tak-ingest node or fastxml node)
159- else if ( data . hasOwnProperty ( " event" ) && data . event . hasOwnProperty ( " point" ) ) {
159+ else if ( data ?. event ?. point ) {
160160 doTAKjson ( data . event ) ;
161161 }
162162 // handle TAK json (from multicast Protobuf via tak-ingest node)
163- else if ( data . hasOwnProperty ( " cotEvent" ) && data . cotEvent . hasOwnProperty ( "lat" ) && data . cotEvent . hasOwnProperty ( "lon" ) ) {
163+ else if ( data ?. cotEvent && data . cotEvent . hasOwnProperty ( "lat" ) && data . cotEvent . hasOwnProperty ( "lon" ) ) {
164164 doTAKMCjson ( data . cotEvent ) ;
165165 }
166166 // handle default worldmap json msg
167- else if ( data . hasOwnProperty ( " name" ) ) { setMarker ( data ) ; }
167+ else if ( data ?. name ) { setMarker ( data ) ; }
168168 else {
169169 if ( JSON . stringify ( data ) !== '{}' ) {
170170 console . log ( "SKIP" , data ) ;
@@ -1676,7 +1676,7 @@ function setMarker(data) {
16761676 } ) ;
16771677 data = Object . assign ( { } , allData [ data [ "name" ] ] ) ;
16781678 }
1679- if ( data . action ) { delete data . action ; }
1679+ delete data . action ;
16801680
16811681 if ( typeof markers [ data [ "name" ] ] != "undefined" ) {
16821682 if ( markers [ data [ "name" ] ] . lay !== lay ) {
0 commit comments