Skip to content

Commit 6fb7f94

Browse files
durrankangas
authored andcommitted
INT-1778: Use mapbox proxy (#459)
* INT-1778: Use mapbox proxy * INT-1778: Ensure onload sets api url
1 parent 313eb1c commit 6fb7f94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/internal-packages/schema/lib/d3/coordinates.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const UNSELECTED_COLOR = '#43B1E5';
1717
const CONTROL_COLOR = '#ed271c';
1818
const TOKEN = 'pk.eyJ1IjoibW9uZ29kYi1jb21wYXNzIiwiYSI6ImNpbWUxZjNudjAwZTZ0emtrczByanZ4MzIifQ.6Mha4zoflraopcZKOLSpYQ';
1919

20+
const MAPBOX_API_URL = 'https://compass-maps.mongodb.com/api.mapbox.com';
21+
const MAPBOX_CLIENT_URL = MAPBOX_API_URL + '/mapbox-gl-js/v0.15.0/mapbox-gl.js';
22+
2023
const minicharts_d3fns_geo = function() {
2124
// --- beginning chart setup ---
2225
let width = 400;
@@ -280,11 +283,12 @@ const minicharts_d3fns_geo = function() {
280283
function loadMapBoxScript(done) {
281284
const script = document.createElement('script');
282285
script.setAttribute('type', 'text/javascript');
283-
script.src = 'https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.js';
286+
script.src = MAPBOX_CLIENT_URL;
284287
script.onerror = function() {
285288
done('Error ocurred while loading MapBox script.');
286289
};
287290
script.onload = function() {
291+
window.mapboxgl.config.API_URL = MAPBOX_API_URL;
288292
done(null, window.mapboxgl);
289293
};
290294
document.getElementsByTagName('head')[0].appendChild(script);

0 commit comments

Comments
 (0)