ThinkGeo.com    |     Documentation    |     Premium Support

VectorMBTilesAsyncLayer - style references

We are using MBTiles mapping data supplied by Ordnance Survey in the UK. There are two products, called ZoomStack and MasterMap. We’ve been using Zoomstack for a while and it works just fine. Originally there was an issue with the .JSON style file needing an http:// url to an external .JSON file - our systems run offline and an http:// reference was not possible. Shout out to ThinkGeo :kissing_heart: who created an update that enabled it to work with local files by allowing a reference to mbtiles:// instead of http://

Fast-forward a few months, we’re now trying to implement the MasterMap product, also MBTiles and this too feature style files with http urls referencing online .JSON files. We’ve made the changes to point these to the local files via the mbtiles:// domain as before, and this has suppressed the initial errors, however were are now getting errors relating to the references “sprite” and “glyphs” in the JSON style file. Once again, these appear to be expecting an online http:// url but as we are operating entirely offline, we can’t use this. Anything we attempt to substitute here throws an error that only http is accepted and if we remove those entries from the style file entirely, the error is that the entries are missing(!)

Anything we can do here, or do we need to beg ThinkGeo to work their magic again?
Thanks!

Hi @Jason_Graham,

I’m glad you like all the MBTiles changes we’ve been making. I’ll talk to the product team and see if they have time to make the mbtiles:// change for sprites and glyphs also.

I’ll get back to you later this week with a status update.

Thanks,
John

Wow, thanks John, appreciate it!
J.

Hi Jason,

We’ve added local file support in the latest beta, v14.5.0-beta001. Please pull the latest version and give it a try.

A couple of notes:

  1. You can now use a local sprite file like this:
    "sprite": "./sprite"
  2. Glyph files are handled differently. The glyph .pbf files are available for web clients, but not for desktop (WPF).
    To make it work on desktop, you can either use the default system fonts or map your custom fonts to local .ttf files.

We’ve created a new HowDoI sample (currently in the dev branch — it will be merged into master soon) that demonstrates how to use custom font files. Have a try and let us know if you have any questions.

Thanks,
Ben

That’s awesome, thanks Ben. Really quick turn-around too! We’ll give it a go.

Cheers,
Jason.

Sure, just let me know if you still see any issues.