@@ -88,6 +88,9 @@ var App = (function ($, publ) {
88
88
) ;
89
89
}
90
90
91
+ // Fix FireFox unloaded font issue
92
+ publ . reloadFontSymbol ( ) ;
93
+
91
94
// TODO: this is only necessary because setting the initial form value
92
95
// through the template causes encoding problems
93
96
publ . updateForm ( features ) ;
@@ -183,6 +186,10 @@ var App = (function ($, publ) {
183
186
} )
184
187
} )
185
188
} ) ;
189
+ // Fix empty map issue
190
+ map . once ( 'postrender' , function ( event ) {
191
+ publ . zoomToExtent ( true ) ;
192
+ } ) ;
186
193
187
194
// Add Toolbar
188
195
toolbar = new ol . control . Bar ( ) ;
@@ -1005,6 +1012,38 @@ var App = (function ($, publ) {
1005
1012
return url ;
1006
1013
} ;
1007
1014
1015
+ publ . reloadFontSymbol = function ( ) {
1016
+ if ( 'fonts' in document ) {
1017
+ document . fonts . addEventListener ( 'loadingdone' , function ( e ) {
1018
+ var loaded = false ;
1019
+ e . fontfaces . forEach ( function ( f ) {
1020
+ if ( f . family === '"mcr-icons"' || f . family === '"fontmaki"' ) {
1021
+ loaded = true ;
1022
+ }
1023
+ } ) ;
1024
+ if ( loaded ) {
1025
+ maps . forEach ( function ( m ) {
1026
+ var layers = m . getLayers ( ) ;
1027
+ layers . forEach ( function ( layer ) {
1028
+ if ( layer . type === "VECTOR" &&
1029
+ layer . getKeys ( ) . indexOf ( "title" ) >= 0 &&
1030
+ layer . get ( "title" ) === "Features" ) {
1031
+ var features = layer . getSource ( ) . getFeatures ( ) ;
1032
+ if ( features . length >= 0 ) {
1033
+ var geom = features [ 0 ] . getGeometry ( ) ;
1034
+ if ( geom . getType ( ) == "Point" ) {
1035
+ console . log ( "Reloading Features layer" ) ;
1036
+ layer . changed ( ) ;
1037
+ }
1038
+ }
1039
+ }
1040
+ } ) ;
1041
+ } ) ;
1042
+ }
1043
+ } ) ;
1044
+ }
1045
+ } ;
1046
+
1008
1047
function getCookie ( cname ) {
1009
1048
var name = cname + "=" ;
1010
1049
var ca = document . cookie . split ( ';' ) ;
0 commit comments