Skip to content

Commit

Permalink
Merge pull request #6 from ThomasG77/pmtiles
Browse files Browse the repository at this point in the history
Support Pmtiles
  • Loading branch information
geoffreyaldebert authored Dec 5, 2024
2 parents 7923578 + 6dfc622 commit 5700d66
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lucide-vue-next": "^0.462.0",
"maplibre-gl": "^4.7.1",
"pinia": "^2.2.8",
"pmtiles": "^4.0.1",
"radix-vue": "^1.9.10",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/assets/json/vector.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"cadastre": {
"type": "vector",
"url": "https://openmaptiles.geo.data.gouv.fr/data/cadastre-dvf.json"
"url": "pmtiles://https://files.data.gouv.fr/pmtiles/cadastre-dvf-agri.pmtiles"
}
},
"sprite": "https://openmaptiles.github.io/osm-bright-gl-style/sprite",
Expand Down Expand Up @@ -2379,4 +2379,4 @@
],
"id": "bright"
}


6 changes: 5 additions & 1 deletion frontend/src/components/MapComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ import { getColorsForNatureCulture } from "@/types/NatureCulture";
import * as d3 from "d3-scale";
import maplibregl, { type Map as MapLibreMap } from "maplibre-gl";
import type { LngLatLike, StyleSpecification } from "maplibre-gl";
import { Protocol } from "pmtiles";
import { type Ref, defineComponent, onMounted, ref, watch } from "vue";
let protocol = new Protocol();
maplibregl.addProtocol("pmtiles",protocol.tile);
export default defineComponent({
name: "MapComponent",
components: {
Expand Down Expand Up @@ -122,7 +126,7 @@ export default defineComponent({
id: "parcelles_fill",
type: "fill",
source: "cadastre",
filter: ["has", "dvf"],
filter: ["has", "dvf_agri"],
"source-layer": "parcelles",
minzoom: 13,
maxzoom: 18,
Expand Down

0 comments on commit 5700d66

Please sign in to comment.