What I am trying to do:

Have a 3D interactive map, embedded on a website, that allows viewers to click on buildings which opens up a 'more info' HTML overlay with links/text/images about that specific buildings history.

Eventually we will have a custom post type in WordPress for various buildings in our area which we'll populate with our genealogy research of the building clicked on. I'll then pull that info into the overlay, referenced by it's OSM ID which will be a custom field populated manually, but allows a custom WP_Query based on the OSM data clicked on.

The website is on cPanel hosting. I would like the OSM data updated frequently (daily or weekly perhaps, not monthly). The area of interest isn't particularly large.

What's the problem?:

I can't seem to find anything that fulfills the above scenario for a 3D interactive map. The problem(s) seems to be getting the OSM ID of a building or file size. Both approaches I have tried fall short. My knowledge & understanding of file formats, tiles & layers also falls short and there seems to be lots of approaches to mapping which confuses things further.

What I have tried:

BlenderGIS embedded with BabylonJS. BlenderGIS pulls data from OSM. I coded the HTML overlay myself listening for onClick events. Problems are that the map would only get updated when I regenerate the Blender file (making me the gatekeeper) and the resulting blender export varies from 4MB to 30MB (depending on resolution) which is no good for bandwidth or mobile users on data connections.

BlenderGIS & BablyonJS

Maplibre using tiles generated from an MBTiles file of my interest area and served using tileserver-php. I think the problem with this approach is that tileserver-php wasn't including all of the OSM data, like the ID, so I cant reference back to WordPress, or names of buildings/houses etc. Perhaps this was an issue with the MBTiles file I generated from the map.osm file?

I prefer this method to the BlenderGIS method. I don't necessarily need to run my own tileserver. I need to be able to reference OSM ID's for features, buildings etc and add onclick events for HTML overlays.

Maplibre & tileserver-php

OSMBuildings, api.maptiler.com - tried but they don't appear to update their OSM map very often (once a month?).

Edit: I've settled on using maplibre and a custom MBTile file using a GeoFabrik extract. There is a useful tutorial that explains the process using various tools like:

  • GeoFabrik Calc
  • Osmium-tool
  • OSMConvert
  • Tilemaker
  • Tileserver-php


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.