-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(ベクトル) ########## | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'>© 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'>© OpenStreetMap contributors</a>" | ||
}); | ||
|
||
}; |
Oops, something went wrong.