Skip to content

Commit

Permalink
Bundle maplibre assets (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristineguadelupe authored Jan 16, 2024
1 parent ffb5b83 commit 10c5e19
Show file tree
Hide file tree
Showing 7 changed files with 2,424 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ kino_maplibre-*.tar

# Temporary files, for example, from tests.
/tmp/

# Node modules.
assets/*/node_modules/
17 changes: 6 additions & 11 deletions lib/assets/maplibre/main.js → assets/maplibre/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import "https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.min.js";
// TODO: point to npm when released
import "https://cdn.jsdelivr.net/gh/jimmyrocks/maplibre-gl-vector-text-protocol@main/dist/maplibre-gl-vector-text-protocol.min.js";
import "https://cdn.jsdelivr.net/npm/@maplibre/[email protected]/dist/maplibre-gl-geocoder.min.js";
import * as maplibregl from "maplibre-gl";
import VectorTextProtocol from "maplibre-gl-vector-text-protocol";
import MaplibreGeocoder from "@maplibre/maplibre-gl-geocoder";
import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
import "maplibre-gl/dist/maplibre-gl.css";

export function init(ctx, data) {
ctx.importCSS(
"https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.min.css"
);

ctx.importCSS(
"https://cdn.jsdelivr.net/npm/@maplibre/[email protected]/lib/maplibre-gl-geocoder.min.css"
);
ctx.importCSS("main.css");

ctx.root.innerHTML = `
<div id='map' style='width: 896px; height: 400px;'></div>
Expand Down
Loading

0 comments on commit 10c5e19

Please sign in to comment.