@@ -481,7 +481,7 @@ export class GttClient {
481
481
const url = popup_contents . href . replace ( / \[ ( .+ ?) \] / g, feature . get ( 'id' ) )
482
482
content . push ( `<a href="${ url } ">Edit</a>` )
483
483
484
- popup . show ( feature . getGeometry ( ) . getFirstCoordinate ( ) , content as any )
484
+ popup . show ( feature . getGeometry ( ) . getFirstCoordinate ( ) , content . join ( ' ' ) as any )
485
485
} )
486
486
487
487
select . getFeatures ( ) . on ( [ 'remove' ] , _ => {
@@ -605,7 +605,7 @@ export class GttClient {
605
605
}
606
606
607
607
getColor ( feature : Feature < Geometry > ) : string {
608
- let color = '#FFD700 '
608
+ let color = '#000000 '
609
609
const plugin_settings = JSON . parse ( this . defaults . pluginSettings )
610
610
const status = document . querySelector ( '#issue_status_id' ) as HTMLInputElement
611
611
@@ -622,13 +622,12 @@ export class GttClient {
622
622
return color
623
623
}
624
624
625
- getFontColor ( _ : any ) : string {
625
+ getFontColor ( _ : unknown ) : string {
626
626
const color = "#FFFFFF"
627
627
return color
628
628
}
629
629
630
- // return string but set return any because upstream jsdoc is wrong
631
- getSymbol ( feature : Feature < Geometry > ) :any {
630
+ getSymbol ( feature : Feature < Geometry > ) {
632
631
let symbol = 'mcr-icon-write'
633
632
634
633
const plugin_settings = JSON . parse ( this . defaults . pluginSettings )
@@ -646,7 +645,7 @@ export class GttClient {
646
645
return symbol
647
646
}
648
647
649
- getStyle ( feature : Feature < Geometry > , _ : any ) :Style [ ] {
648
+ getStyle ( feature : Feature < Geometry > , _ : unknown ) :Style [ ] {
650
649
const styles : Style [ ] = [ ]
651
650
652
651
// Apply Shadow
@@ -664,24 +663,21 @@ export class GttClient {
664
663
} )
665
664
)
666
665
667
- // rotateWithView is boolean but upstream set number
668
- const rotateWithView : any = false
669
-
670
666
const self = this
671
667
672
668
// Apply Font Style
673
669
styles . push (
674
670
new Style ( {
675
671
image : new FontSymbol ( {
676
- form : 'mcr ' ,
672
+ form : 'blazon ' ,
677
673
gradient : false ,
678
674
glyph : self . getSymbol ( feature ) ,
679
675
fontSize : 0.7 ,
680
676
radius : 18 ,
681
- offsetY : - 9 , // can't set offset because upstream needs to fix jsdoc
677
+ offsetY : - 18 ,
682
678
rotation : 0 ,
683
- rotateWithView : rotateWithView ,
684
- color : self . getFontColor ( feature ) , // can't set color because upstream needs to fix jsdoc,
679
+ rotateWithView : false ,
680
+ color : self . getFontColor ( feature ) ,
685
681
fill : new Fill ( {
686
682
color : self . getColor ( feature )
687
683
} ) ,
@@ -894,7 +890,7 @@ export class GttClient {
894
890
features : [ accuracyFeature , positionFeature ]
895
891
} )
896
892
} )
897
- geolocationLayer . set ( 'diplayInLayerSwitcher ' , false )
893
+ geolocationLayer . set ( 'displayInLayerSwitcher ' , false )
898
894
this . map . addLayer ( geolocationLayer )
899
895
900
896
// Control button
@@ -1136,15 +1132,11 @@ export class GttClient {
1136
1132
1137
1133
reloadFontSymbol ( ) {
1138
1134
if ( 'fonts' in document ) {
1139
- ( document as any ) . fonts . ready . then ( ( ) => {
1135
+ ( document as any ) . fonts . addEventListener ( 'loadingdone' , ( ) => {
1140
1136
let loaded = false ;
1141
1137
( document as any ) . fonts . forEach ( ( f :any ) => {
1142
- if ( f . family === '"mcr-icons"' || f . family === '"fontmaki"' ) {
1143
- if ( f . status === 'unloaded' ) {
1144
- f . load ( ) . then ( ( ) => console . log ( 'loaded' ) )
1145
- } else {
1146
- loaded = true
1147
- }
1138
+ if ( f . family === 'mcr-icons' || f . family === 'fontmaki' ) {
1139
+ loaded = true
1148
1140
}
1149
1141
} )
1150
1142
if ( loaded ) {
@@ -1176,18 +1168,15 @@ export class GttClient {
1176
1168
el . classList . toggle ( 'icon-expended' )
1177
1169
el . classList . toggle ( 'icon-collapsed' )
1178
1170
const div = fieldset . querySelector ( 'div' )
1179
- if ( div . style . display !== 'block ') {
1171
+ if ( div . style . display === 'none ') {
1180
1172
div . style . display = 'block'
1181
1173
} else {
1182
1174
div . style . display = 'none'
1183
1175
}
1184
1176
this . maps . forEach ( function ( m ) {
1185
1177
m . updateSize ( )
1186
1178
} )
1187
- this . zoomToExtent ( )
1188
1179
}
1189
-
1190
-
1191
1180
}
1192
1181
1193
1182
const getTileSource = ( source : string , class_name : string ) : any => {
@@ -1360,4 +1349,4 @@ window.replaceIssueFormWith = (html) => {
1360
1349
if ( ol_maps ) {
1361
1350
new GttClient ( { target : ol_maps } )
1362
1351
}
1363
- }
1352
+ }
0 commit comments