| | |
| | | effectCircle.position.set(selectedSprite.x, selectedSprite.y); |
| | | }; |
| | | |
| | | export const showRoutes = (curZone, setShowRoutes) => { |
| | | setShowRoutes(true); |
| | | getRouteList(curZone, (routeList) => { |
| | | routeList.forEach(route => { |
| | | const startPoint = querySprite(DEVICE_TYPE.POINT, route.startCodeStr); |
| | | const endPoint = querySprite(DEVICE_TYPE.POINT, route.endCodeStr); |
| | | const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]); |
| | | pointRoute.setPoint(startPoint, endPoint); |
| | | pointRoute.clear(); |
| | | pointRoute.lineStyle(Math.max(7, 2 * (1 / mapContainer.scale.x)), themeMode === 'light' ? '#ced6e0' : '#535c68'); |
| | | pointRoute.moveTo(startPoint.position.x, startPoint.position.y); |
| | | pointRoute.lineTo(endPoint.position.x, endPoint.position.y); |
| | | pointRoute.alpha = 1; |
| | | mapContainer.addChild(pointRoute); |
| | | }) |
| | | }) |
| | | export const showRoutes = (curZone, setShowRoutes, setLoading) => { |
| | | setLoading(true); |
| | | getRouteList( |
| | | curZone, |
| | | (routeList) => { |
| | | routeList.forEach(route => { |
| | | const startPoint = querySprite(DEVICE_TYPE.POINT, route.startCodeStr); |
| | | const endPoint = querySprite(DEVICE_TYPE.POINT, route.endCodeStr); |
| | | const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]); |
| | | pointRoute.setPoint(startPoint, endPoint); |
| | | pointRoute.clear(); |
| | | pointRoute.lineStyle(Math.max(7, 2 * (1 / mapContainer.scale.x)), themeMode === 'light' ? '#ced6e0' : '#535c68'); |
| | | pointRoute.moveTo(startPoint.position.x, startPoint.position.y); |
| | | pointRoute.lineTo(endPoint.position.x, endPoint.position.y); |
| | | pointRoute.alpha = 1; |
| | | mapContainer.addChild(pointRoute); |
| | | }) |
| | | setLoading(false); |
| | | setShowRoutes(true); |
| | | }, |
| | | () => { |
| | | setLoading(false); |
| | | }, |
| | | ) |
| | | }; |
| | | |
| | | export const hideRoutes = (curZone, setShowRoutes) => { |