我已经使用react native maps创建了一个自定义地图样式,但有时它会显示默认地图1-2秒,然后会更新新样式。有什么方法可以检查地图是否已加载?
<MapView
ref={mapRef}
provider={PROVIDER_GOOGLE}
customMapStyle={customMapStyle}
showsCompass={false}
showsScale={false}
showsBuildings={false}
showsTraffic={false}
showsIndoors={false}
showsUserLocation={false}
zoomEnabled={true}
pitchEnabled={true}
zoomTapEnabled={true}
{...props}
style={[styles.map, mapStyle as any]}
>
{props.children}
</MapView>