ThinkGeo.com    |     Documentation    |     Premium Support

Map Cache - slow?

An odd one this -
We’re finding on some of our customer sites that mapping loads/renders very slowly when un-cached (the cached mapping loads pretty much as expected). Imagine a full map display, pan a short distance, the newly revealed area contains blank space to start with, then wait… Typically you would expect the map to fill the space after a second or so but in the case of some customers it’s often over 30 seconds, sometimes more than a minute, sometimes more then two! It looks like the map has frozen / is not going to render, but wait long enough and it usually eventually arrives.
We can’t recreate this on our own setup but it’s consistent on the sites where it happens. It seems to affect shape file base maps more than others, but we’re not 100% certain on that.

Sure, the cached mapping performs better, but the un-cached is very bad - and our customers quite frequently update their base mapping and need to clear the cache.

We’re not expecting a magic instant-fix for this, but any thoughts of things we can try or areas we can look into? We’re asking customers to check things like disk performance, antivirus interference etc. but so far these seem to be a dead end.
We’re using TG 14.4.0-beta037 currently (Desktop/WPF)

For clarity, it’s all local mapping data, mostly in shapefile (as MultipleShapeFileFeatureLayer) or MBTiles format (as VectorMBTilesAsyncLayer) (MBTiles performs much better)

Hi Jason,

Not 100% sure this is your case, but my gut says the shapefile might just be too complex. I’ve seen files where there were only a couple of multipolygons, but each had tons of sub-polygons and holes. In those cases the map ends up loading the whole thing for every tile it renders, and the spatial index doesn’t help at all as it only has 2 features.

If that’s your case, two things can help:

  • creating multi polygon features instead of creating one multi-polygon feature when generating the shapefile
  • split large shapes into smaller grids so the map doesn’t have to load one giant feature at once.

Here’s an old post with the gridding idea (sample code may be outdated, but you’ll get the concept): ThinkGeo Performance Guide. You can implement the similar thing using the current api.

MVT, on the other hand, is built for speed — it does both gridding and per-zoom simplification automatically, which is why it feels so much snappier.

Cheers,
Ben