Page MenuHomePhabricator

Load map file in non-strict mode
Closed, ResolvedPublic

Description

We shouldn't be loading the map file in strict mode, because this causes errors with fonts. The cause is the same as https://github.com/gravitystorm/openstreetmap-carto/issues/3086 and the fix is https://github.com/gravitystorm/openstreetmap-carto/pull/3089

We should be calling [Map.fromString](http://mapnik.org/documentation/node-mapnik/3.6/#Map.fromString) somewhere from within the bowels of our code, and need to pass strict : false as part of the options.

Searching through node_modules, this is called by one of mapnik-pool, tilelive-vector, or tilelive-bridge

Event Timeline

I'm going to trim down the brighmed font list to match what we have. We should still be in non-strict mode, but this is a quicker way to get to working.

Strict mode is on by default in tilelive-vector as of 0.4.0. Rather than being configurable as a query parameter, it's intended to be toggled module-wide as a mutable export: https://github.com/mapbox/tilelive-vector/blob/1e6a7487b5f4938d7e307b70f1b8d1935aefda0a/index.js#L30

To force it via [tilelive-modules](https://github.com/mojodna/tilelive-modules):

diff --git i/loader.js w/loader.js
index 2920730..013bb1f 100644
--- i/loader.js
+++ w/loader.js
@@ -19,6 +19,9 @@ module.exports = function(tilelive, options) {
     }
 
     try {
+      if (name === "tilelive-vector") {
+        mod.strict = false;
+      }
       if (typeof(mod.registerProtocols) === "function") {
         mod.registerProtocols(tilelive);
       } else {
CommunityTechBot renamed this task from eccaaaaaaa to Load map file in non-strict mode.Jul 2 2018, 3:50 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Pnorman triaged this task as Medium priority.Jul 3 2018, 4:14 PM
Mholloway reopened this task as Open.

I suppose I should keep this open until we can deploy to prod.

Mentioned in SAL (#wikimedia-releng) [2018-09-27T07:38:16Z] <mdholloway> deployment-maps04 updated tilerator and kartotherian node modules (T195513, T200594)