maps - 无法从我的 map 中删除用户位置图标?

标签 maps react-native react-native-maps

我正在使用来自 react-native-maps 库的 React Native Maps,我对 userLocation 的一个图标有问题,我不希望它显示,但是它在那里,问题是当我将属性 showsUserLocation 设置为 false 以使其消失时,我正在失去一项功能。

我会用代码和图片来解释更多,这是我的代码:

<MapWrapper
        ref={this.mapRef}
        followUserLocation
        zoomEnabled
        showsUserLocation
        mapType={isSatMode ? 'satellite' : 'standard'}
        rotateEnabled={false}
      >
        {!isNilOrEmpty(markers) && !isNilOrEmpty(selectedMenuItem) && markers.map(marker => this.renderMarker(marker, handleOnClickMark))}
        {!isNilOrEmpty(polylines) && polylines.map(this.renderPolyline)}
      </MapWrapper>

showsUserLocation 现在是 true,这意味着我的 map 上有两个图标:

  • 蓝色图标指向我的位置
  • 我可以点击移动到我的位置的图标(我想摆脱它)

有图片:

enter image description here

当我将 showsUserLocation 更改为 false 时,它们中的两个不再存在,但我的 View 上需要蓝色图标。

如有任何帮助,我们将不胜感激。

最佳答案

showsMyLocationButton 设置为 false 即可。

关于maps - 无法从我的 map 中删除用户位置图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65003718/

相关文章:

java - 如何在同一个 Activity 中切换 View ?

windows-phone-8 - 随着位置的变化在 Windows Phone 8 map 上绘制路线?

react-native - react 原生 map 获得可见标记

ios - React Native map 标注按下在 IOS 上不触发

react-native - 使用未锚定坐标的图像对 native map 标记使用react

javascript - Google map gpx 导出 - 在 JavaScript 中保存对话框

java - getIntent() 返回空指针异常

javascript - 如何查看苹果收据的有效期?

react-native - 语法错误 : Unexpected identifier - Nonsensical error in React Enzyme testing

react-native - 如何在React Native TextInput占位符中添加红色星号?