Published unlisted
Edited
Nov 15, 2021
1 fork
1 star
Insert cell
Insert cell
Insert cell
map2 = {
proj;
const container = html`<div style="height:800px;">`;
yield container;

const pixel_ratio = parseInt(window.devicePixelRatio) || 1;
const max_zoom = 20;
const tile_size = 512;

const extent = 12367396.2185; // To the Equator
const resolutions = Array(max_zoom + 1)
.fill()
.map((_, i) => extent / tile_size / Math.pow(2, i - 1));

//sopurce :https://tile.gbif.org/ui/3031/leaflet.html
const crs = new L.Proj.CRS(
"EPSG:3031",
"+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs",
{
origin: [-extent, extent],
projectedBounds: L.bounds(
L.point(-extent, extent),
L.point(extent, -extent)
),
resolutions: resolutions
}
);

const antarcticaMap = L.map(container, {
crs: crs
}).setView([-90, -65], 3);

L.tileLayer(
"https://tile.gbif.org/3031/omt/{z}/{x}/{y}@{r}x.png?style=gbif-geyser".replace(
"{r}",
pixel_ratio
),
{
tileSize: 512
}
).addTo(antarcticaMap);
}
Insert cell
Insert cell
map = {
const container = html`<div style="height:200px;">`;
yield container;
const map = L.map(container).setView(
[45.19366547898346, 5.757884970510944],
15
);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
"&copy; <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
}
Insert cell
Insert cell
proj = (L[
"Proj"
] = await require("https://cdnjs.cloudflare.com/ajax/libs/proj4leaflet/1.0.2/proj4leaflet.min.js"))
Insert cell
L = {
const L = await require("leaflet@1/dist/leaflet.js");
if (!L._style) {
const href = await require.resolve("leaflet@1/dist/leaflet.css");
document.head.appendChild(
(L._style = html`<link href=${href} rel=stylesheet>`)
);
}
return L;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more