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 7, 2025
1 parent 991c476 commit ba71a89
Show file tree
Hide file tree
Showing 6 changed files with 1,039 additions and 455 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
3 changes: 2 additions & 1 deletion tests/end2end/playwright/google-basemap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ test.describe('Google Maps Baselayers', () => {

//.. 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 ba71a89

Please sign in to comment.