这是相当长一段时间以来第一个新的 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 形状和经纬度点:
