@@ -19,18 +19,12 @@ exports = module.exports = MapnikSource;
19
19
require ( 'util' ) . inherits ( MapnikSource , require ( 'events' ) . EventEmitter ) ;
20
20
function MapnikSource ( uri , callback ) {
21
21
uri = this . _normalizeURI ( uri ) ;
22
- var key = JSON . stringify ( uri ) ;
23
22
24
23
if ( uri . protocol && uri . protocol !== 'mapnik:' ) {
25
24
throw new Error ( 'Only the mapnik protocol is supported' ) ;
26
25
}
27
26
28
- // This deafults to true. To disable font auto-loading
29
- // Set ?autoLoadFonts=false in the mapnik URL to disable
30
- if ( uri . query . autoLoadFonts ) {
31
- if ( mapnik . register_default_fonts ) mapnik . register_default_fonts ( ) ;
32
- if ( mapnik . register_system_fonts ) mapnik . register_system_fonts ( ) ;
33
- }
27
+ var key = JSON . stringify ( uri ) ;
34
28
35
29
// by default we use an internal self-caching mechanism but
36
30
// calling applications can pass `internal_cache:false` to disable
@@ -150,6 +144,13 @@ MapnikSource.prototype._open = function(uri) {
150
144
this . metatile = uri . query . metatile ;
151
145
this . bufferSize = uri . query . bufferSize ;
152
146
147
+ // This defaults to true. To disable font auto-loading
148
+ // Set ?autoLoadFonts=false in the mapnik URL to disable
149
+ if ( this . _autoLoadFonts ) {
150
+ if ( mapnik . register_default_fonts ) mapnik . register_default_fonts ( ) ;
151
+ if ( mapnik . register_system_fonts ) mapnik . register_system_fonts ( ) ;
152
+ }
153
+
153
154
// Initialize this map. This wraps `localize()` and calls `create()`
154
155
// afterwards to actually create a new Mapnik map object.
155
156
Step ( function ( ) {
0 commit comments