Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions static/js/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,43 @@ function _createClusterIcon(cluster) {
}

function createStreetTiles() {
return L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: `&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> et contributeurs`,
});
return L.tileLayer(
"https://wmts.geopf.fr/rok4/wmts?" +
"&REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0" +
"&STYLE=normal" +
"&TILEMATRIXSET=PM" +
"&FORMAT=image/png" +
"&LAYER=PLAN-IGN_PNG" +
"&TILEMATRIX={z}" +
"&TILEROW={y}" +
"&TILECOL={x}",
{
minZoom: 0,
maxZoom: 18,
attribution: "IGN-F/Geoportail",
tileSize: 256
}
)
}

function createCustomTiles(styleId) {
function createCustomTiles() {
return L.tileLayer(
"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",
"https://wmts.geopf.fr/rok4/wmts?" +
"&REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0" +
"&STYLE=normal" +
"&TILEMATRIXSET=PM" +
"&FORMAT=image/jpeg" +
"&LAYER=321715_BDORTHO_PYR-JPG_PM_D069_2020"+
"&TILEMATRIX={z}" +
"&TILEROW={y}" +
"&TILECOL={x}",
{
id: styleId,
attribution: `
&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a>
<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>
Imagerie © <a href="https://www.mapbox.com/">Mapbox</a>`,
minZoom: 0,
maxZoom: 18,
tileSize: 512,
zoomOffset: -1,
accessToken:
"pk.eyJ1IjoiYWNjZXNsaWJyZSIsImEiOiJjbGVyN2p0cW8wNzBoM3duMThhaGY4cTRtIn0.jEdq_xNlv-oBu_q_UAmkxw",
attribution: "IGN-F/Geoportail",
tileSize: 256
}
);
)
}

function getStreetTiles() {
Expand All @@ -121,7 +137,7 @@ function getStreetTiles() {

function getSatelliteTiles() {
if (!satelliteTiles) {
satelliteTiles = createCustomTiles("acceslibre/cliiv23h1005i01qv6365088q");
satelliteTiles = createCustomTiles();
}
return satelliteTiles;
}
Expand Down