Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hfu authored Sep 29, 2024
1 parent c3017f1 commit 7584b42
Showing 5 changed files with 1,146 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docs/addLayers_003.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//レイヤ設定

function addLayers() {
// ########## OSM(ラスター) ##########
map.addLayer({
'id': 'OSM_Raster',
'type': 'raster',
'source': 'OSM_Raster',
'minzoom': 0,
'maxzoom': 24,
});
// ########## OSM(ラスター) ##########

// ########## OSM(ベクトル) ##########
// POI(ポイント)
map.addLayer({
'id': 'OSM_POI',
'type': 'circle',
'source': 'OSM_Vector',
'source-layer': 'poi',
'filter': ['has', 'name'], // nameプロパティが存在するフィーチャーのみを表示
'layout': {
'visibility': 'visible',
},
'paint': {
'circle-radius': 3.5, //半径
'circle-color': '#00ffff',
'circle-opacity': 1.0,
},
'minzoom': 17,
'maxzoom': 24,
});


// Places(テキスト)
map.addLayer({
'id': 'OSM_POI_Label',
'type': 'symbol',
'source': 'OSM_Vector',
'source-layer': 'poi',
'filter': ['has', 'name'], // nameプロパティが存在するフィーチャーのみを表示
'layout': {
'text-field': ['get', 'name'],
// 'text-font': ['Open Sans Semibold'],
'text-font': ['Noto Sans CJK JP Bold'],
// 'text-font': ['Open Sans Semibold'],
'text-anchor': 'left',
'text-offset': [0.5, 0],
'visibility': 'visible',
},
'paint': {
'text-color': 'rgba(255, 255, 255, 0.7)',
'text-halo-color': 'rgba(0,0,0,0.7)', // ラベルの外枠の色を黒に設定
'text-halo-width': 1.0, // ラベルの外枠の幅を1.0に設定
},
'minzoom': 17,
'maxzoom': 24,
});
// ########## OSM(ベクトル) ##########

};
22 changes: 22 additions & 0 deletions docs/addSources_003.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ソース設定
function addSources() {
// OSM(ラスター)
map.addSource("OSM_Raster", {
type: "raster",
tiles: ['https://tile.openstreetmap.jp/{z}/{x}/{y}.png'],
// minzoom: 0,
// maxzoom: 18,
tileSize: 256,
attribution:"<a href='https://www.openstreetmap.org/copyright'>&copy; OpenStreetMap contributors</a>"
});

// OSM(ベクトル)
map.addSource("OSM_Vector", {
type: "vector",
tiles: ['https://tile.openstreetmap.jp/data/planet/{z}/{x}/{y}.pbf'],
minzoom: 14,
maxzoom: 14,
attribution:"<a href='https://www.openstreetmap.org/copyright'>&copy; OpenStreetMap contributors</a>"
});

};
Loading

0 comments on commit 7584b42

Please sign in to comment.