Replies: 2 comments 1 reply
-
(moved to discussion) There are OL utility classes at https://github.com/protomaps/PMTiles/tree/main/openlayers , but those simply load tiles into the OL data model, the tickbox UI is something to be implemented within OL and is not specific to PMTiles. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. I understand this isn't a PMTiles thing. It seems to me most PMTiles functionality is better served/handled in Leaflet or MapLibre than in OL, which is totally fine. (I' far from an OL expert, you'll have sensed). FWIW I came up with this clumsy styling function which half works : function(feature) {
const geometryType = feature.getGeometry().getType();
const featureLayer = feature.properties_.layer;
const combinedCondition = `${geometryType}_${featureLayer}`;
switch (combinedCondition) {
case "LineString_boundaries":
return commonStyle;
break;
case "Polygon_earth":
return earthStyleModified;
break;
case "Polygon_water":
return water;
break;
default:
return null;
} It half works probably because of the computation involved in iterating over all features. Just to be sure : that tickbox in the viewer does not involve such computations ? Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to find my way to implementing the nice list of tickboxes one can see in the PMTiles viewer to allow selecting layers for display. All I find are references to the MapLibre implementation but we're using OpenLayers. Any hint or suggestion for a path forward?
Thanx for this very cool project.
Beta Was this translation helpful? Give feedback.
All reactions