Skip to content

Commit

Permalink
fix(Scheduler): replace url subdomains alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
mgermerie authored and gchoqueux committed Sep 14, 2022
1 parent e1fea9f commit 91fd9ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Core/Scheduler/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DataSourceProvider from 'Provider/DataSourceProvider';
import TileProvider from 'Provider/TileProvider';
import $3dTilesProvider from 'Provider/3dTilesProvider';
import PointCloudProvider from 'Provider/PointCloudProvider';
import URLBuilder from 'Provider/URLBuilder';
import CancelledCommandException from './CancelledCommandException';

function queueOrdering(a, b) {
Expand Down Expand Up @@ -153,7 +154,8 @@ Scheduler.prototype.execute = function execute(command) {

// parse host
const layer = command.layer;
const host = layer.source && layer.source.url ? new URL(layer.source.url, document.location).host : undefined;
const host = layer.source && layer.source.url ?
new URL(URLBuilder.subDomains(layer.source.url), document.location).host : undefined;

command.promise = new Promise((resolve, reject) => {
command.resolve = resolve;
Expand Down
2 changes: 2 additions & 0 deletions src/Provider/URLBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function subDomains(url) {
* @module URLBuilder
*/
export default {
subDomains,

/**
* Builds an URL knowing the coordinates and the source to query.
* <br><br>
Expand Down

0 comments on commit 91fd9ec

Please sign in to comment.