Skip to content

Commit

Permalink
Update to Maplibre v4 (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristineguadelupe authored Apr 9, 2024
1 parent 64eb03b commit bb2385d
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 165 deletions.
8 changes: 3 additions & 5 deletions assets/maplibre/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ export function init(ctx, data) {
map.addControl(export_map);
}

function loadImage({ name, url, options }) {
map.loadImage(url, (error, image) => {
if (error) throw error;
map.addImage(name, image, options);
});
async function loadImage({ name, url, options }) {
const image = await map.loadImage(url);
map.addImage(name, image.data, options);
}

function centerOnClick(symbols) {
Expand Down
51 changes: 30 additions & 21 deletions assets/maplibre/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/maplibre/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"dependencies": {
"@maplibre/maplibre-gl-geocoder": "^1.5.0",
"@watergis/maplibre-gl-export": "^3.1.0",
"maplibre-gl": "^3.6.2",
"@watergis/maplibre-gl-export": "^3.2.2",
"maplibre-gl": "^4.1.2",
"maplibre-gl-vector-text-protocol": "github:jimmyrocks/maplibre-gl-vector-text-protocol"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion lib/assets/maplibre/build/main.css

Large diffs are not rendered by default.

273 changes: 137 additions & 136 deletions lib/assets/maplibre/build/main.js

Large diffs are not rendered by default.

0 comments on commit bb2385d

Please sign in to comment.