Skip to content

Commit

Permalink
chore: map theme style
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed May 27, 2024
1 parent 52f6a1d commit dd043c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/component/src/control/mapTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export default class MapTheme extends SelectControl<ISelectControlOption> {
}

public getStyleOptions(): ControlOptionItem[] {
const mapStyleConfig =
this.mapsService.type === 'Mapbox' ? MapboxMapStyleConfig : GaodeMapStyleConfig;
const mapStyleConfig = ['Mapbox', 'Maplibre'].includes(this.mapsService.type)
? MapboxMapStyleConfig
: GaodeMapStyleConfig;
return Object.entries(this.mapsService.getMapStyleConfig())
.filter(([key, value]) => typeof value === 'string' && key !== 'blank')
.map(([key, value]) => {
Expand Down
1 change: 0 additions & 1 deletion packages/extension-maps/src/mapbox/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export default class MapboxService extends BaseMapService<Map> {

public getMapStyle(): string {
try {
// @ts-ignore
const styleUrl = this.map.getStyle().sprite ?? '';
// 将 Mapbox 返回的样式字符串转成传入 style 保持一致
if (/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(styleUrl)) {
Expand Down

0 comments on commit dd043c4

Please sign in to comment.