| | |
| | | * 返回当前位置并重新吸附最近站点。 |
| | | */ |
| | | const toOrigin = () => { |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | | mapCtx.moveToLocation({ |
| | | success: () => { |
| | | handleRegionChange({ type: 'end', causedBy: 'gesture' }); |
| | |
| | | Taro.showToast({ title: '暂无可选运营区域', icon: 'none' }); |
| | | return; |
| | | } |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | | mapCtx.includePoints({ |
| | | points, |
| | | padding: INCLUDE_POINTS_PADDING |
| | |
| | | if (type !== 'end') return; |
| | | state.setBounce(true); |
| | | |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | | // 获取真实的缩放等级并通过回调传递出去,彻底阻断与 mapScale 状态的绑定,避免触发原生组件抖动 |
| | | mapCtx.getScale({ |
| | | success: (res) => { |
| | |
| | | state.setLatitude(site.latitude); |
| | | state.setLongitude(site.longitude); |
| | | syncPinLocation(site.latitude, site.longitude); |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | | mapCtx.moveToLocation({ |
| | | latitude: site.latitude, |
| | | longitude: site.longitude, |
| | |
| | | updateMapData(lat, lng).then(({ isInside, electronicAreaId }) => { |
| | | state.setRangeStatus(getRangeStatus(isInside, {}, electronicAreaId)); |
| | | }); |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | | const points = extractPointsFromPolygons(newPolygons); |
| | | mapCtx.includePoints({ |
| | | points, |