File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1134,8 +1134,8 @@ export class GttClient {
1134
1134
if ( 'fonts' in document ) {
1135
1135
( document as any ) . fonts . addEventListener ( 'loadingdone' , ( ) => {
1136
1136
let loaded = false ;
1137
- ( document as any ) . fonts . forEach ( ( f : any ) => {
1138
- if ( f . family === 'mcr-icons' || f . family === 'fontmaki' ) {
1137
+ ( document as any ) . fonts . forEach ( ( font : any ) => {
1138
+ if ( font . family === 'mcr-icons' || font . family === 'fontmaki' ) {
1139
1139
loaded = true
1140
1140
}
1141
1141
} )
@@ -1147,12 +1147,12 @@ export class GttClient {
1147
1147
layer . getKeys ( ) . indexOf ( "title" ) >= 0 &&
1148
1148
layer . get ( "title" ) === "Features" ) {
1149
1149
const features = ( layer as any ) . getSource ( ) . getFeatures ( )
1150
- if ( features . length >= 0 ) {
1151
- const geom = features [ 0 ] . getGeometry ( )
1152
- if ( geom . getType ( ) == "Point" ) {
1153
- console . log ( "Reloading Features layer" )
1154
- layer . changed ( )
1155
- }
1150
+ const index = features . findIndex ( ( feature : any ) => {
1151
+ return feature . getGeometry ( ) . getType ( ) === "Point"
1152
+ } )
1153
+ if ( index >= 0 ) {
1154
+ console . log ( "Reloading Features layer" )
1155
+ layer . changed ( )
1156
1156
}
1157
1157
}
1158
1158
} )
You can’t perform that action at this time.
0 commit comments