Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release_3_8] Google maptile add Terrain layer #5514

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading