小程序
小游戏
企业微信
微信支付
扫描小程序码分享
小程序地图上写上view标签后 点击view 会透传到map上 cover-view不会有这个问题 如果用view标签写 如何解决这个问题呢
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
catchTap不行吗?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
我的解决办法,在Map有操作的时候,再把 enableScroll 打开....
const onMapTouchMove = () => { !enableScroll && setEnableScroll(true) } const onMapTouchStart = () => { !enableScroll && setEnableScroll(true) } const onMapTouchEnd = () => { if (timeoutRef.current) { clearTimeout(timeoutRef.current); } timeoutRef.current = setTimeout(() => { enableScroll && setEnableScroll(false); timeoutRef.current = null; }, 1000); } <Map enableScroll={enableScroll} // enableZoom={false} className="main-map" showLocation latitude={userCurrentLocation.latitude} longitude={userCurrentLocation.longitude} // markers={markers} onClick={onMapClick} onTap={onMapTap} onTouchMove={onMapTouchMove} onTouchStart={onMapTouchStart} onTouchEnd={onMapTouchEnd} onError={onMapError} />
我写的文章,看看能不能解决你们的问题
https://blog.csdn.net/weixin_55109830/article/details/127387467
用cover-view
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
catchTap不行吗?
我的解决办法,在Map有操作的时候,再把 enableScroll 打开....
const onMapTouchMove = () => { !enableScroll && setEnableScroll(true) } const onMapTouchStart = () => { !enableScroll && setEnableScroll(true) } const onMapTouchEnd = () => { if (timeoutRef.current) { clearTimeout(timeoutRef.current); } timeoutRef.current = setTimeout(() => { enableScroll && setEnableScroll(false); timeoutRef.current = null; }, 1000); } <Map enableScroll={enableScroll} // enableZoom={false} className="main-map" showLocation latitude={userCurrentLocation.latitude} longitude={userCurrentLocation.longitude} // markers={markers} onClick={onMapClick} onTap={onMapTap} onTouchMove={onMapTouchMove} onTouchStart={onMapTouchStart} onTouchEnd={onMapTouchEnd} onError={onMapError} />
我写的文章,看看能不能解决你们的问题
https://blog.csdn.net/weixin_55109830/article/details/127387467
用cover-view