Skip to content

Commit

Permalink
Merge pull request #92 from Disfactory/vector-map-extent
Browse files Browse the repository at this point in the history
switch to disfactory.tw PBF tiles [#86]
  • Loading branch information
Yukaii authored May 19, 2021
2 parents f895949 + 48f8801 commit 6619894
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
VUE_APP_BASE_URL=https://staging.disfactory.tw/api
VUE_APP_PROTOMAP_API_KEY=
3 changes: 1 addition & 2 deletions src/lib/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,12 @@ const getWMTSTileGrid = () => {

const getBaseLayer = (type: BASE_MAP, wmtsTileGrid: WMTSTileGrid) => {
if (type === BASE_MAP.PROTOMAP) {
const key = process.env.VUE_APP_PROTOMAP_API_KEY
const taiwanExtent = transformExtent([119.90423060095736, 21.83090666506977, 122.2876172488333, 25.33409668479448], 'EPSG:4326', 'EPSG:3857')
const layer = new VectorTileLayer({
source: new VectorTileSource({
attributions: '<a href="https://protomaps.com" target="_blank">Protomaps</a> © <a href="https://www.openstreetmap.org" target="_blank"> OpenStreetMap</a>',
format: new MVT(),
url: `https://api.protomaps.com/tiles/v1/{z}/{x}/{y}.pbf?key=${key}`,
url: 'https://staging.disfactory.tw/tiles/{z}/{x}/{y}.pbf',
maxZoom: 14
}),
opacity: 1,
Expand Down

0 comments on commit 6619894

Please sign in to comment.