【发布时间】:2022-01-10 10:12:11
【问题描述】:
我想做的是从本地样式切换到基于云的样式。在这里,我遇到了地形图类型的样式问题。 它曾经看起来像这样(并且有效):
<GoogleMap
key="GoogleMap"
mapContainerStyle={mapConfig.containerStyle}
zoom={mapConfig.zoom}
center={mapConfig.center}
options={{
styles: options,
disableDefaultUI: true,
fullscreenControl: true,
mapTypeId: 'terrain',
}}
onClick={closeActiveTooltip}
>
现在我已将样式移至 API,它看起来像这样(不工作 - 地形正在覆盖样式,默认替换它们):
<GoogleMap
key="GoogleMap"
mapContainerStyle={mapConfig.containerStyle}
zoom={mapConfig.zoom}
center={mapConfig.center}
options={{
// styles: options,
// disableDefaultUI: true,
// fullscreenControl: true,
mapId: ['{myId}', 'terrain'],
// mapTypeId: 'terrain',
}}
onClick={closeActiveTooltip}
>
有人知道,是否有可能让它工作?
【问题讨论】:
标签: javascript html typescript google-maps google-maps-styled