importmaplibreglfrom'maplibre-gl';import'maplibre-gl/dist/maplibre-gl.css';import{Protocol}from'pmtiles';// PMTilesのプロトコルを設定constpmtilesProtocol=newProtocol();maplibregl.addProtocol('pmtiles',pmtilesProtocol.tile);// 地図の表示constmap=newmaplibregl.Map({container:'map',style:{projection:{type:'globe',},version:8,glyphs:'https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf',sources:{// USGSの衛星画像タイルUSGSImageryOnly:{type:'raster',tiles:['https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}'],// タイルのURLtileSize:256,maxzoom:10,attribution:'USGS',},// 雲レイヤーのPMTilescloud:{type:'raster',url:`pmtiles://./cloud.pmtiles`,attribution:'NASA/Goddard Space Flight Center, Image by Reto Stöckli',},},layers:[{id:'USGSImageryOnly_layer',source:'USGSImageryOnly',type:'raster',},{id:'cloud_layer',source:'cloud',type:'raster',paint:{'raster-opacity':1.0,},},],sky:{'sky-color':'#199EF3','sky-horizon-blend':0.5,'horizon-color':'#ffffff','horizon-fog-blend':0.5,'fog-color':'#0000ff','fog-ground-blend':0.5,'atmosphere-blend':['interpolate',['linear'],['zoom'],0,1,10,1,12,0],},},center:[139.477,35.681],zoom:2,});