Skip to content

Commit

Permalink
☀ projected laravel-site-github from 46491da
Browse files Browse the repository at this point in the history
Source-holobranch: laravel-site-github
Source-commit: 46491da
Source: 46491da
  • Loading branch information
themightychris committed Aug 20, 2021
2 parents 027a7f9 + 46491da commit 95ad72d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions resources/js/Shared/MapboxMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export default {
},
initMap() {
const parcelsTileUrl = process.env.MIX_MBTILE_URL ? process.env.MIX_MBTILE_URL : `${window.location.origin}/urban/{z}/{x}/{y}.pbf`;
const parcelsTileHostname = new URL(parcelsTileUrl).hostname;
const parcelsTileUrlRegex = new RegExp(`^https?://${parcelsTileHostname}`, 'i');
const emptyPolygonFeature = {
type: 'Feature',
geometry: {
Expand All @@ -123,6 +127,11 @@ export default {
style: 'mapbox://styles/mapbox/dark-v10?optimize=true',
center: [-75.207138, 39.950872],
zoom: 14,
transformRequest: (url) => ({
url,
// allow cross-origin credentials for parcels tiles:
credentials: parcelsTileUrlRegex.test(url) ? 'include' : 'same-origin',
}),
});
this.map
Expand All @@ -149,8 +158,7 @@ export default {
type: 'vector',
generateId: true,
promoteId: 'parcel_id',
/* eslint-disable prefer-template */
tiles: [process.env.MIX_MBTILE_URL ? process.env.MIX_MBTILE_URL : window.location.origin + '/urban/{z}/{x}/{y}.pbf'],
tiles: [parcelsTileUrl],
maxzoom: 14, // max zoom compiled into the mbtiles file
});
Expand Down

0 comments on commit 95ad72d

Please sign in to comment.