osmapp icon indicating copy to clipboard operation
osmapp copied to clipboard

layers: Proposal and discussion for adding an OpenStreetMap Carto vector layer

Open fywmjj opened this issue 4 months ago • 8 comments

Hello @zbycz and team,

I'd like to propose adding a new basemap layer to the application: the OpenStreetMap Carto style vector tiles provided by MapTiler.

🎯 Our Goal

The primary objective is to offer users the most iconic and recognizable OpenStreetMap vector map style. Compared to traditional raster tiles (tiles.openstreetmap.org), this vector tileset would deliver a significantly smoother, sharper, and higher-performance browsing experience. The benefits are particularly noticeable on high-resolution screens and mobile devices. This would also provide a more familiar experience for users accustomed to the OSM Carto style.

🛠️ Proposed Implementation

Since OsmAPP is built on the MapTiler JS SDK, the technical integration of this layer should be quite straightforward. The necessary API endpoints provided by MapTiler are as follows:

  • Style File (StyleJSON):
    https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key={OsmAPP_OFFICIAL_API_KEY}
    
  • Sprite:
    https://api.maptiler.com/maps/openstreetmap/[email protected]?key={OsmAPP_OFFICIAL_API_KEY}
    
    (Alternatively, to ensure a consistent style, we could use OsmAPP's own sprite assets.)
  • Tiles:
    https://api.maptiler.com/tiles/v3-openmaptiles/{z}/{x}/{y}.pbf?key={OsmAPP_OFFICIAL_API_KEY}
    

❗ The Crucial Issue: Lack of POI Interactivity (Missing osm_id)

However, after some research in documentation, I've discovered a critical limitation with this specific tile source: the vector tile data appears to be missing the osm_id and osm_type fields for its geographic features.

This directly conflicts with a core, high-value feature of OsmAPP. As @zbycz pointed out in a previous discussion regarding the "Shortbread" layer:

Adding the osm_id and encoded osm_type is rather standard in OpenMapTIles stack and also in the planetiler. It has benefit of maplibre-gl knowing it is the same feature when zooming in, and also it enables fast clickability of features/POIs etc. (This is currently used eg. on the OsmAPP.org for both Maptiler planet tiles and OpenFreeMap tiles)

This means that if we were to implement this layer as-is, users would be unable to click on POIs to retrieve detailed information. This would create a functional inconsistency with the other vector layers already available in OsmAPP.

🤔 Open Questions for Discussion

This leads us to a key product and technical decision:

Are we willing to accept a "view-only" Carto vector layer (with non-clickable POIs) in exchange for its visual and performance benefits?

Here are a few potential paths forward:

  1. Accept the limitation: Implement the layer and, similar to the Shortbread layer, use a toast notification to clearly inform users that its features are not interactive ("not clickable by design").
  2. Seek an alternative: Postpone the launch and continue searching for another Carto-style vector tile source that includes the osm_id.
  3. Advocate for change: Keep this issue open and, on behalf of the community, provide feedback to MapTiler and OpenMapTiles, encouraging them to add the osm_id/osm_type fields to this popular tileset in the future.

Personally, I believe the "clickable POIs" feature mentioned in the readme is a cornerstone of the OsmAPP user experience. Nevertheless, I wanted to present all the information I've gathered to facilitate a thorough discussion.

Thank you for creating such a fantastic map platform and for your consideration of this proposal

fywmjj avatar Oct 18 '25 09:10 fywmjj