Skip to content

Commit

Permalink
Add Google Terrain to available layers with Tile API Key
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed Feb 11, 2025
1 parent 9be895b commit 3665a0a
Show file tree
Hide file tree
Showing 6 changed files with 1,040 additions and 456 deletions.
13 changes: 12 additions & 1 deletion assets/src/modules/config/BaseLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,13 @@ const QMSExternalLayer = {
"title": "Google Satellite",
"mapType": "satellite",
"key":""
},
"google-terrain": {
"type" :"google",
"title": "Google Terrain",
"mapType": "terrain",
"key":""

}
}

Expand Down Expand Up @@ -903,9 +910,13 @@ export class BaseLayersConfig {
// roads
extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-streets"])
} else if (externalUrl.includes('lyrs=s')){
// fallback on satellite map
// satellite map
extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-satellite"])
} else if (externalUrl.includes('lyrs=p') || externalUrl.includes('lyrs=t')){
// terrain
extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-terrain"])
} else {
// Fallback to google-streets
extendedCfg[layerTreeItem.name] = structuredClone(QMSExternalLayer["google-streets"])
}
// add the apikey to the configuration
Expand Down
5 changes: 3 additions & 2 deletions tests/end2end/playwright/google-basemap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ test.describe('Google Maps Baselayers', () => {
await gotoMap(url, page);

// there are three Google base layers in the project, so the expected number of failing requests is three
expect(initGoogleRequestsCount).toBe(3);
expect(initGoogleRequestsCount).toBe(4);
// baselayers group should be visible...
await expect(page.locator('#switcher-baselayer')).toBeVisible();

//.. and should contain the three Google base layers (not loaded)
let options = page.locator('#switcher-baselayer').getByRole('combobox').locator('option');
await expect(options).toHaveCount(3);
await expect(options).toHaveCount(4);
expect(await options.nth(0).getAttribute('value')).toBe('Google Streets');
expect(await options.nth(1).getAttribute('value')).toBe('Google Satellite');
expect(await options.nth(2).getAttribute('value')).toBe('Google Hybrid');
expect(await options.nth(3).getAttribute('value')).toBe('Google Terrain');
});
});
Loading

0 comments on commit 3665a0a

Please sign in to comment.