| | |
| | | commitQueriedMarkers(newMarkers, true, adsorbed); |
| | | const finalLat = adsorbed && marker ? marker.latitude : lat; // 最终纬度 |
| | | const finalLng = adsorbed && marker ? marker.longitude : lng; // 最终经度 |
| | | mapState.setLatitude(finalLat); |
| | | mapState.setLongitude(finalLng); |
| | | settleRegionResult({ lat: finalLat, lon: finalLng, isInside: true }); |
| | | setTimeout(async () => { |
| | | siteState.setBounce(false); |
| | |
| | | toOrigin(); |
| | | }, 6000); |
| | | } |
| | | } else if (causedBy === 'gesture' || causedBy === 'scale') { |
| | | mapState.setMapScale(res.scale); |
| | | } |
| | | } |
| | | }); |
| | |
| | | siteState.setBounce(false); |
| | | return; |
| | | } |
| | | |
| | | if (causedBy === 'gesture' || causedBy === 'drag' || causedBy === 'scale') { |
| | | mapState.setLatitude(lat); |
| | | mapState.setLongitude(lng); |
| | | } |
| | | |
| | | try { |
| | | const { isInside, newMarkers, sites } = await mapState.updateMapData(lat, lng, undefined, { commitMarkers: false }); |
| | | if (!isInside) { |
| | |
| | | latitude: marker.latitude, |
| | | longitude: marker.longitude |
| | | }); |
| | | mapState.setLatitude(marker.latitude); |
| | | mapState.setLongitude(marker.longitude); |
| | | } |
| | | setTimeout(async () => { |
| | | siteState.setBounce(false); |