Skip to content

Commit

Permalink
兼容矢量瓦片非restjsr 不需要后缀 review by luox
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Jan 13, 2025
1 parent c0fe11b commit 057274f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/_utils/WebMapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ export default class WebMapService extends Events {
});
}

public getMapBoxStyle(styleURL) {
public getMapBoxStyle(styleURL, withoutFormatSuffix = false) {
return new Promise((resolve, reject) => {
SuperMap.FetchRequest.get(styleURL)
SuperMap.FetchRequest.get(styleURL, {}, { withoutFormatSuffix })
.then(response => {
return response.json();
})
Expand Down
3 changes: 2 additions & 1 deletion src/mapboxgl/web-map/WebMapViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,10 @@ export default class WebMapViewModel extends WebMapBase {
if (url.indexOf('/restjsr/') > -1 && !/\/style\.json$/.test(url)) {
url += '/style.json';
}
const withoutFormatSuffix = url.indexOf('/restjsr/') === -1;
this.webMapService
// @ts-ignore
.getMapBoxStyle(url)
.getMapBoxStyle(url, withoutFormatSuffix)
.then(
(style: any) => {
const sourceIds = Object.keys(style.sources);
Expand Down

0 comments on commit 057274f

Please sign in to comment.