发布 datasette-maplibre 0.1a0 — 使用 MapLibre GL 和 OpenFreeMap 在 Datasette 中可视化地理空间数据
这是相当长一段时间以来第一个新的 Datasette 地理空间插件!这个插件将出色的 MapLibre GL 库与 OpenFreeMap 结合起来,后者是由 Zsolt Ero 运营的免费矢量地图服务器(你应该在 GitHub 上赞助 Zsolt。)
我大部分内容都是通过向 Claude Fable 5.2 输入一条提示词构建的:
Look at datasette-cluster-map and datasette-leaflet-geojson plugins, then look at ~/dev/tools/openfreemap-demo.html - then build a brand new Datasette plugin that uses maplibreGL and openfreemap and combines the features of those other two plugins - but be creative and think outside the box for other useful features the plugin might have
“发挥创意,跳出框框思考”带来了几个巧妙的想法——我最喜欢的是它会显示 GeoJSON 形状的 SVG 预览,然后仅当它们滚动进入视野时才加载 WebGL 预览。
我还让 Claude 构建了一个全面的演示,它可以在最新的 Datasette Lite 中运行,因此你可以访问此链接,通过 Pyodide 和 WebAssembly 在浏览器中加载该插件和一个演示数据库。
我喜欢这个演示页面,它在同一张地图上同时显示了 GeoJSON 形状和经纬度点:

