Closed mroswell closed 3 months ago
I've figured out a work-around (which is to bypass the datasette-geojson-map plugin, and use the datasette-cluster-map plugin, as follows):
SELECT *,
JSON_EXTRACT(geometry, '$.coordinates[1]') AS latitude,
JSON_EXTRACT(geometry, '$.coordinates[0]') AS longitude
FROM vacant_bldg_rehabs;
It looks like leaflet-simplestyle's "Maki markers" depend on Mapbox icons Mapbox no longer serves 😅 . Here's a link to upstream source [1]. To address the issue, I cloned this plugin repo, made the change below to turn off Maki markers, then setup.py install
ed my local copy of the plugin. Here's the change:
diff --git a/datasette_geojson_map/static/map.js b/datasette_geojson_map/static/map.js
index aef544d..07137ea 100644
--- a/datasette_geojson_map/static/map.js
+++ b/datasette_geojson_map/static/map.js
@@ -22,7 +22,7 @@ async function render() {
parent.insertBefore(container, parent.firstElementChild);
const map = createMap(L, container);
- const layer = L.geoJSON(geojson, { useSimpleStyle: true, useMakiMarkers: true })
+ const layer = L.geoJSON(geojson, { useSimpleStyle: true })
.addTo(map)
.bindPopup(popup);
const bounds = layer.getBounds();
After this, markers display as expected.
I don't know why I'm getting broken marker images. For some reason they point to mapbox. Which is weird, because I don't see mapbox in the code. The file it's trying to access is: https://a.tiles.mapbox.com/v3/marker/pin-m+7e7e7e@2x.png
visiting that yields:
I'm guessing there is some issue with leaflet.
../-/databases
../-/metadata
../-/settings
../-/plugins
[ { "name": "datasette-cluster-map", "static": true, "templates": false, "version": "0.17.2", "hooks": [ "extra_body_script", "extra_js_urls" ] }, { "name": "datasette-enrichments", "static": false, "templates": true, "version": "0.2", "hooks": [ "actor_from_request", "permission_allowed", "register_routes", "table_actions" ] }, { "name": "datasette-enrichments-gpt", "static": false, "templates": true, "version": "0.3", "hooks": [ "register_enrichments" ] }, { "name": "datasette-enrichments-jinja", "static": false, "templates": false, "version": "0.1", "hooks": [ "register_enrichments" ] }, { "name": "datasette-enrichments-opencage", "static": false, "templates": false, "version": "0.1", "hooks": [ "register_enrichments" ] }, { "name": "datasette-geojson", "static": false, "templates": false, "version": "0.4.0", "hooks": [ "prepare_connection", "register_output_renderer" ] }, { "name": "datasette-geojson-map", "static": true, "templates": false, "version": "0.4.0", "hooks": [ "extra_body_script", "extra_css_urls", "extra_js_urls" ] }, { "name": "datasette-leaflet", "static": true, "templates": false, "version": "0.2.2", "hooks": [ "extra_body_script", "extra_template_vars" ] }, { "name": "datasette-upload-csvs", "static": false, "templates": true, "version": "0.8.3", "hooks": [ "menu_links", "permission_allowed", "register_routes" ] }, { "name": "datasette-vega", "static": true, "templates": false, "version": "0.6.2", "hooks": [ "extra_css_urls", "extra_js_urls" ] } ]