Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centerMarker的属性设置了没效果 #8

Open
lighthx opened this issue Feb 23, 2017 · 16 comments
Open

centerMarker的属性设置了没效果 #8

lighthx opened this issue Feb 23, 2017 · 16 comments

Comments

@lighthx
Copy link

lighthx commented Feb 23, 2017

安卓真机是我设置得不对吗?

<AMap
        style={{ flex:1}}
        options={{
          centerCoordinate: {
            latitude: 40.53835,
            longitude: 100.50336,
          },
          showsUserLocation: false,
          centerMarker:'poi_marker'
        }}
        ref={v => this.map = v}
      />
@AdamChrist
Copy link

我也有这个问题....

@lanjie233
Copy link

你们解决了吗

@AdamChrist
Copy link

@lanjie233 可以自己在react native中画一个.类似那个定位按钮.

@lanjie233
Copy link

用绝对定位一个图标在中间吗

@AdamChrist
Copy link

@lanjie233

@lanjie233
Copy link

@AdamChrist 谢谢

@zhulichao
Copy link

react-native-smart-amap/ios/RCTAMap/RCTAMap/RCTAMapManager.m文件中422、423、424行的NO改为YES可在ios显示位置标注,react-native-smart-amap/android/src/main/reactnativecomponent/amap/RCTAMapView.java 202行注释放开可在android显示标注。我只是看了源码随便试出来的,也是不明白原因。

@yourenA
Copy link

yourenA commented Apr 13, 2017

@AdamChrist @lanjie233 @zhulichao 请问android下显示Marker的问题解决了吗

@AdamChrist
Copy link

@yourenA 在RN里面用绝对定位画了一个..效果挺好的..样式还好看..

@yourenA
Copy link

yourenA commented Apr 13, 2017

@AdamChrist 移动地图,那个图标不会还是留在屏幕中间吗

@AdamChrist
Copy link

centerMarker 本来就是留在中间的..就像微信发送位置中的大头针...位置的Marker没有弄

@yourenA
Copy link

yourenA commented Apr 13, 2017

@AdamChrist 好的,谢谢

@yourenA
Copy link

yourenA commented Apr 13, 2017

@AdamChrist 我还想问一下我在Android下拖动地图为什么没有触发this._onPOISearchDone方法
componentDidMount() { AMapLocation.init({interval: 2000}) AMapLocation.getLocation(); NativeAppEventEmitter.addListener('amap.location.onLocationResult', this._onLocationResult) NativeAppEventEmitter.addListener('amap.onPOISearchDone', this._onPOISearchDone) //NativeAppEventEmitter.addListener('amap.onPOISearchFailed', this._onPOISearchFailed) }
还有除了setInterval还有上面方法可以设置每隔2秒获取一下当时的位置

@AdamChrist
Copy link

移动地图是触发onDidMoveByUser事件,你要自己调用searchPoiByCenterCoordinate来查询的.

这个组件没有获取当前位置的方法..只能通过别的组件(AMapLocation)来获取.

@DLlzw
Copy link

DLlzw commented Nov 9, 2017

关于中间地址那个Icon 没有的问题已经解决,解决办法在xcode 中添加那个图片就可以显示

@DLlzw
Copy link

DLlzw commented Nov 9, 2017

另外这个如果react native 版本超过0.49 就不能正常使用 因为属性变了引入方式 导致找不到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants