我想要做的是从本地切换到基于云的样式。在这里,我遇到了地形图类型的样式问题。它曾经看起来像这样(并且有效):
<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}
>
有谁知道,如果有可能使它工作?