Commit f0aeb34986d6eaaf2141babd0f6c1889ca71d70f
1 parent
bbed3599
线路编辑页面优化
Showing
32 changed files
with
2472 additions
and
2283 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
| @@ -37,14 +37,22 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | @@ -37,14 +37,22 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | ||
| 37 | SectionRouteService routeService; | 37 | SectionRouteService routeService; |
| 38 | 38 | ||
| 39 | /** | 39 | /** |
| 40 | - * @param String | 40 | + * @param map |
| 41 | * @throws | 41 | * @throws |
| 42 | * @Description: TODO(批量撤销路段) | 42 | * @Description: TODO(批量撤销路段) |
| 43 | */ | 43 | */ |
| 44 | - @RequestMapping(value = "/batchDestroy", method = RequestMethod.GET) | 44 | + @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST) |
| 45 | public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) { | 45 | public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) { |
| 46 | return routeService.updateSectionRouteInfoFormId(map); | 46 | return routeService.updateSectionRouteInfoFormId(map); |
| 47 | } | 47 | } |
| 48 | + /** | ||
| 49 | + * @param id //路段路由id | ||
| 50 | + * @Description: TODO(撤销路段) | ||
| 51 | + */ | ||
| 52 | + @RequestMapping(value = "/destroy", method = RequestMethod.POST) | ||
| 53 | + public Map<String, Object> destroy(@RequestParam Integer id) { | ||
| 54 | + return routeService.destroy(id); | ||
| 55 | + } | ||
| 48 | 56 | ||
| 49 | /** | 57 | /** |
| 50 | * @param @param map | 58 | * @param @param map |
src/main/java/com/bsth/controller/StationRouteController.java
| @@ -137,6 +137,18 @@ public class StationRouteController extends BaseController<StationRoute, Integer | @@ -137,6 +137,18 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 137 | public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) { | 137 | public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) { |
| 138 | return service.getStationRouteCenterPoints(map); | 138 | return service.getStationRouteCenterPoints(map); |
| 139 | } | 139 | } |
| 140 | + | ||
| 141 | + /** | ||
| 142 | + * @Description :TODO(查询线路某方向下所有站点) | ||
| 143 | + * | ||
| 144 | + * @param map <lineId:线路ID; direction:方向> | ||
| 145 | + * | ||
| 146 | + * @return List<Map<String, Object>> | ||
| 147 | + */ | ||
| 148 | + @RequestMapping(value = "/getStationRouteList" , method = RequestMethod.GET) | ||
| 149 | + public List<Map<String, Object>> getStationRouteList(@RequestParam Map<String, Object> map) { | ||
| 150 | + return service.getStationRouteList(map); | ||
| 151 | + } | ||
| 140 | 152 | ||
| 141 | /** | 153 | /** |
| 142 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) | 154 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
src/main/java/com/bsth/repository/StationRouteRepository.java
| @@ -301,7 +301,77 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | @@ -301,7 +301,77 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 301 | " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " + | 301 | " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " + |
| 302 | " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | 302 | " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) |
| 303 | List<Object[]> findStationRouteInfo(Integer id); | 303 | List<Object[]> findStationRouteInfo(Integer id); |
| 304 | - | 304 | + |
| 305 | + /** | ||
| 306 | + * @Description : TODO(根据站点路由Id查询详情) | ||
| 307 | + * | ||
| 308 | + * @param id:站点路由ID | ||
| 309 | + * | ||
| 310 | + * @return List<Object[]> | ||
| 311 | + */ | ||
| 312 | + @Query(value = "SELECT a.stationRouteLine," + | ||
| 313 | + " a.stationRouteStation," + | ||
| 314 | + " a.stationRouteCode," + | ||
| 315 | + " a.stationRouteLIneCode," + | ||
| 316 | + " a.stationRouteStationMark," + | ||
| 317 | + " a.stationOutStationNmber," + | ||
| 318 | + " a.stationRoutedirections," + | ||
| 319 | + " a.stationRouteDistances," + | ||
| 320 | + " a.stationRouteToTime," + | ||
| 321 | + " a.staitonRouteFirstTime," + | ||
| 322 | + " a.stationRouteEndTime," + | ||
| 323 | + " a.stationRouteDescriptions," + | ||
| 324 | + " a.stationRouteDestroy," + | ||
| 325 | + " a.stationRouteVersions," + | ||
| 326 | + " a.stationRouteCreateBy," + | ||
| 327 | + " a.stationRouteCreateDate," + | ||
| 328 | + " a.stationRouteUpdateBy," + | ||
| 329 | + " a.stationRouteUpdateDate," + | ||
| 330 | + " b.id AS stationId," + | ||
| 331 | + " b.station_cod AS stationCode," + | ||
| 332 | + " a.stationRouteName," + | ||
| 333 | + " b.road_coding AS stationRoadCoding," + | ||
| 334 | + " b.db_type AS stationDbType," + | ||
| 335 | + " b.b_jwpoints AS stationJwpoints," + | ||
| 336 | + " b.g_lonx AS stationGlonx," + | ||
| 337 | + " b.g_laty AS stationGlaty," + | ||
| 338 | + " b.x AS stationX," + | ||
| 339 | + " b.y AS stationY," + | ||
| 340 | + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | ||
| 341 | + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | ||
| 342 | + " b.destroy AS stationDestroy," + | ||
| 343 | + " b.radius AS stationRadius," + | ||
| 344 | + " b.shapes_type AS stationShapesType," + | ||
| 345 | + " b.versions AS stationVersions," + | ||
| 346 | + " b.descriptions AS sttationDescriptions," + | ||
| 347 | + " b.create_by AS stationCreateBy," + | ||
| 348 | + " b.create_date AS stationCreateDate," + | ||
| 349 | + " b.update_by AS stationUpdateBy," + | ||
| 350 | + " b.update_date AS stationUpdateDate," + | ||
| 351 | + " a.stationRouteId,b.station_name as zdmc "+ | ||
| 352 | + " FROM ( SELECT s.id AS stationRouteId," + | ||
| 353 | + " s.line AS stationRouteLine," + | ||
| 354 | + " s.station as stationRouteStation," + | ||
| 355 | + " s.station_name AS stationRouteName," + | ||
| 356 | + " s.station_route_code as stationRouteCode," + | ||
| 357 | + " s.line_code AS stationRouteLIneCode," + | ||
| 358 | + " s.station_mark AS stationRouteStationMark," + | ||
| 359 | + " s.out_station_nmber AS stationOutStationNmber," + | ||
| 360 | + " s.directions AS stationRoutedirections," + | ||
| 361 | + " s.distances AS stationRouteDistances," + | ||
| 362 | + " s.to_time AS stationRouteToTime," + | ||
| 363 | + " s.first_time AS staitonRouteFirstTime," + | ||
| 364 | + " s.end_time AS stationRouteEndTime," + | ||
| 365 | + " s.descriptions AS stationRouteDescriptions," + | ||
| 366 | + " s.destroy AS stationRouteDestroy," + | ||
| 367 | + " s.versions AS stationRouteVersions," + | ||
| 368 | + " s.create_by AS stationRouteCreateBy," + | ||
| 369 | + " s.create_date AS stationRouteCreateDate," + | ||
| 370 | + " s.update_by AS stationRouteUpdateBy," + | ||
| 371 | + " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " + | ||
| 372 | + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | ||
| 373 | + List<Object[]> getStationRouteList(Integer lineId, Integer dir); | ||
| 374 | + | ||
| 305 | List<StationRoute> findByLine(Line line); | 375 | List<StationRoute> findByLine(Line line); |
| 306 | 376 | ||
| 307 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | 377 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) |
src/main/java/com/bsth/service/SectionRouteService.java
| @@ -67,5 +67,5 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> | @@ -67,5 +67,5 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> | ||
| 67 | 67 | ||
| 68 | void batchUpdate(Integer lineId, String lineCode); | 68 | void batchUpdate(Integer lineId, String lineCode); |
| 69 | 69 | ||
| 70 | - | 70 | + Map<String,Object> destroy(Integer id); |
| 71 | } | 71 | } |
src/main/java/com/bsth/service/StationRouteService.java
| @@ -92,6 +92,15 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | @@ -92,6 +92,15 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | ||
| 92 | * @return List<Map<String, Object>> | 92 | * @return List<Map<String, Object>> |
| 93 | */ | 93 | */ |
| 94 | List<Map<String, Object>> getStationRouteCenterPoints(Map<String, Object> map); | 94 | List<Map<String, Object>> getStationRouteCenterPoints(Map<String, Object> map); |
| 95 | + | ||
| 96 | + /** | ||
| 97 | + * @Description :TODO(查询线路某方向下所有站点) | ||
| 98 | + * | ||
| 99 | + * @param map <lineId:线路ID; direction:方向> | ||
| 100 | + * | ||
| 101 | + * @return List<Map<String, Object>> | ||
| 102 | + */ | ||
| 103 | + List<Map<String, Object>> getStationRouteList(Map<String, Object> map); | ||
| 95 | 104 | ||
| 96 | /** | 105 | /** |
| 97 | * @Description :TODO(撤销站点) | 106 | * @Description :TODO(撤销站点) |
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
| @@ -122,7 +122,7 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -122,7 +122,7 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | /** | 124 | /** |
| 125 | - * @Description :TODO(查询路段信息) | 125 | + * @Description :TODO(查询缓存路段信息) |
| 126 | * | 126 | * |
| 127 | * @param map <line.id_eq:线路ID; directions_eq:方向> | 127 | * @param map <line.id_eq:线路ID; directions_eq:方向> |
| 128 | * | 128 | * |
| @@ -408,4 +408,25 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -408,4 +408,25 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 408 | public void batchUpdate(Integer lineId, String lineCode) { | 408 | public void batchUpdate(Integer lineId, String lineCode) { |
| 409 | repository.batchUpdate(lineId,lineCode); | 409 | repository.batchUpdate(lineId,lineCode); |
| 410 | } | 410 | } |
| 411 | + | ||
| 412 | + | ||
| 413 | + | ||
| 414 | + /** | ||
| 415 | + * @Description : TODO(根据路段路由Id批量撤销路段) | ||
| 416 | + * | ||
| 417 | + * @param id <id:路段路由ID> | ||
| 418 | + */ | ||
| 419 | + @Override | ||
| 420 | + @Transactional | ||
| 421 | + public Map<String, Object> destroy(Integer id) { | ||
| 422 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | ||
| 423 | + try { | ||
| 424 | + repository.sectionRouteIsDestroyUpdBatch(id); | ||
| 425 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 426 | + } catch (Exception e) { | ||
| 427 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 428 | + logger.error("save erro.", e); | ||
| 429 | + } | ||
| 430 | + return resultMap; | ||
| 431 | + } | ||
| 411 | } | 432 | } |
| 412 | \ No newline at end of file | 433 | \ No newline at end of file |
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| @@ -453,7 +453,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -453,7 +453,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 453 | if(!sectionsBpoints.equals("")) { | 453 | if(!sectionsBpoints.equals("")) { |
| 454 | bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")"; | 454 | bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")"; |
| 455 | } | 455 | } |
| 456 | - repository.systemSave(sectionCode, sectionName, "", "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId); | 456 | + repository.systemSave(sectionCode, sectionName, null, "", "", "", gsectionVector, bsectionVectorS, "", "", "", 0, 0, "", 0, "", 1, sectionId); |
| 457 | 457 | ||
| 458 | routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i); | 458 | routeRepository.sectionUpdSectionRouteCode(lineId, directions,routeCode+i); |
| 459 | SectionRoute route = new SectionRoute(); | 459 | SectionRoute route = new SectionRoute(); |
| @@ -636,7 +636,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -636,7 +636,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 636 | // 原坐标类型 | 636 | // 原坐标类型 |
| 637 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | 637 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 638 | // 说明 | 638 | // 说明 |
| 639 | - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | 639 | + String descriptions = ""; |
| 640 | // 是否撤销 | 640 | // 是否撤销 |
| 641 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | 641 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 642 | // 方向 | 642 | // 方向 |
| @@ -662,14 +662,19 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -662,14 +662,19 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 662 | // 路段路由 | 662 | // 路段路由 |
| 663 | Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); | 663 | Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); |
| 664 | SectionRoute resultS = routeRepository.findOne(sectionRouteId); | 664 | SectionRoute resultS = routeRepository.findOne(sectionRouteId); |
| 665 | -// int old_code = resultS.getSectionrouteCode(); | ||
| 666 | - // 如果为空,默认在第一个路段 | ||
| 667 | - if(sectionrouteCode!=null) { | ||
| 668 | - sectionrouteCode += 1; | ||
| 669 | - }else { | ||
| 670 | - sectionrouteCode = 1; | ||
| 671 | - } | ||
| 672 | - routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | 665 | + int old_code = resultS.getSectionrouteCode(); |
| 666 | + // 是否修改路段序号标记 | ||
| 667 | + boolean type = false; | ||
| 668 | + if(sectionrouteCode!=null) { | ||
| 669 | + if(++sectionrouteCode == old_code) { | ||
| 670 | + type = true; | ||
| 671 | + } | ||
| 672 | + // 默认是最前面路段 | ||
| 673 | + }else { | ||
| 674 | + sectionrouteCode = 1; | ||
| 675 | + } | ||
| 676 | + if(!type) | ||
| 677 | + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | ||
| 673 | // 限速 | 678 | // 限速 |
| 674 | Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); | 679 | Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); |
| 675 | // 版本 | 680 | // 版本 |
| @@ -709,7 +714,6 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -709,7 +714,6 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 709 | route.setDirections(directions); | 714 | route.setDirections(directions); |
| 710 | route.setVersions(version); | 715 | route.setVersions(version); |
| 711 | route.setDestroy(destroy); | 716 | route.setDestroy(destroy); |
| 712 | - route.setDescriptions(descriptions); | ||
| 713 | route.setCreateBy(createBy); | 717 | route.setCreateBy(createBy); |
| 714 | route.setUpdateBy(updateBy); | 718 | route.setUpdateBy(updateBy); |
| 715 | route.setLine(line); | 719 | route.setLine(line); |
| @@ -784,17 +788,24 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -784,17 +788,24 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 784 | // 路段时长 | 788 | // 路段时长 |
| 785 | Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString()); | 789 | Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString()); |
| 786 | // 路段路由 | 790 | // 路段路由 |
| 787 | -// Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); | ||
| 788 | - Integer sectionrouteCode = 1; | 791 | + Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString()); |
| 792 | +// Integer sectionrouteCode = 1; | ||
| 789 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); | 793 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); |
| 790 | int old_code = resultS.getSectionrouteCode(); | 794 | int old_code = resultS.getSectionrouteCode(); |
| 795 | + // 是否修改路段序号标记 | ||
| 796 | + boolean type = false; | ||
| 791 | if(sectionrouteCode!=null) { | 797 | if(sectionrouteCode!=null) { |
| 792 | - sectionrouteCode += 1; | 798 | + if(sectionrouteCode == old_code) { |
| 799 | + type = true; | ||
| 800 | + } else { | ||
| 801 | + sectionrouteCode += 1; | ||
| 802 | + } | ||
| 793 | // 默认是最前面路段 | 803 | // 默认是最前面路段 |
| 794 | }else { | 804 | }else { |
| 795 | sectionrouteCode = 1; | 805 | sectionrouteCode = 1; |
| 796 | } | 806 | } |
| 797 | - routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | 807 | + if(!type) |
| 808 | + routeRepository.sectionUpdSectionRouteCode(lineCode, directions,sectionrouteCode); | ||
| 798 | // 限速 | 809 | // 限速 |
| 799 | Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); | 810 | Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString()); |
| 800 | // 版本 | 811 | // 版本 |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| @@ -196,123 +196,80 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -196,123 +196,80 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 196 | List<Map<String, Object>> staitonChildren= new ArrayList<Map<String, Object>>(); | 196 | List<Map<String, Object>> staitonChildren= new ArrayList<Map<String, Object>>(); |
| 197 | 197 | ||
| 198 | if(stationList.size()>0) { | 198 | if(stationList.size()>0) { |
| 199 | - | ||
| 200 | for(int i = 0 ; i < stationList.size(); i++) { | 199 | for(int i = 0 ; i < stationList.size(); i++) { |
| 201 | - | ||
| 202 | Map<String, Object> tempM = new HashMap<String, Object>(); | 200 | Map<String, Object> tempM = new HashMap<String, Object>(); |
| 203 | - | ||
| 204 | // 站点路由ID | 201 | // 站点路由ID |
| 205 | tempM.put("stationRouteId", stationList.get(i)[0]); | 202 | tempM.put("stationRouteId", stationList.get(i)[0]); |
| 206 | - | ||
| 207 | // 站点路由线路ID | 203 | // 站点路由线路ID |
| 208 | tempM.put("stationRouteLine", stationList.get(i)[1]); | 204 | tempM.put("stationRouteLine", stationList.get(i)[1]); |
| 209 | - | ||
| 210 | // 站点路由站点ID | 205 | // 站点路由站点ID |
| 211 | tempM.put("stationRouteStation", stationList.get(i)[2]); | 206 | tempM.put("stationRouteStation", stationList.get(i)[2]); |
| 212 | - | ||
| 213 | // 站点路由名称 | 207 | // 站点路由名称 |
| 214 | - tempM.put("stationRouteStationName", stationList.get(i)[3]); | ||
| 215 | - | 208 | + tempM.put("stationRouteName", stationList.get(i)[3]); |
| 216 | // 站点路由站点序号 | 209 | // 站点路由站点序号 |
| 217 | - tempM.put("stationRouteStationRouteCode", stationList.get(i)[4]); | ||
| 218 | - | 210 | + tempM.put("stationRouteCode", stationList.get(i)[4]); |
| 219 | // 站点路由线路编码 | 211 | // 站点路由线路编码 |
| 220 | tempM.put("stationRouteLineCode", stationList.get(i)[5]); | 212 | tempM.put("stationRouteLineCode", stationList.get(i)[5]); |
| 221 | - | ||
| 222 | // 站点路由站点类型 | 213 | // 站点路由站点类型 |
| 223 | tempM.put("stationRouteStationMark", stationList.get(i)[6]); | 214 | tempM.put("stationRouteStationMark", stationList.get(i)[6]); |
| 224 | - | ||
| 225 | // 站点路由出站的序号 | 215 | // 站点路由出站的序号 |
| 226 | tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]); | 216 | tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]); |
| 227 | - | ||
| 228 | // 站点路由站点方向 | 217 | // 站点路由站点方向 |
| 229 | - tempM.put("stationRouteDirections", stationList.get(i)[8]); | ||
| 230 | - | 218 | + tempM.put("stationRoutedirections", stationList.get(i)[8]); |
| 231 | // 站点路由站点到站距离 | 219 | // 站点路由站点到站距离 |
| 232 | tempM.put("stationRouteDistances", stationList.get(i)[9]); | 220 | tempM.put("stationRouteDistances", stationList.get(i)[9]); |
| 233 | - | ||
| 234 | // 站点路由到站时间 | 221 | // 站点路由到站时间 |
| 235 | tempM.put("stationRouteToTime", stationList.get(i)[10]); | 222 | tempM.put("stationRouteToTime", stationList.get(i)[10]); |
| 236 | - | ||
| 237 | // 站点路由站点首班时间 | 223 | // 站点路由站点首班时间 |
| 238 | tempM.put("stationRouteFirstTime", stationList.get(i)[11]); | 224 | tempM.put("stationRouteFirstTime", stationList.get(i)[11]); |
| 239 | - | ||
| 240 | // 站点路由站点末班时间 | 225 | // 站点路由站点末班时间 |
| 241 | tempM.put("stationRouteEndTime", stationList.get(i)[12]); | 226 | tempM.put("stationRouteEndTime", stationList.get(i)[12]); |
| 242 | - | ||
| 243 | // 站点路由站点说明 | 227 | // 站点路由站点说明 |
| 244 | tempM.put("stationRouteDescriptions", stationList.get(i)[13]); | 228 | tempM.put("stationRouteDescriptions", stationList.get(i)[13]); |
| 245 | - | ||
| 246 | // 站点路由版本 | 229 | // 站点路由版本 |
| 247 | tempM.put("stationRouteVersions", stationList.get(i)[14]); | 230 | tempM.put("stationRouteVersions", stationList.get(i)[14]); |
| 248 | - | ||
| 249 | // 站点ID | 231 | // 站点ID |
| 250 | tempM.put("stationId", stationList.get(i)[15]); | 232 | tempM.put("stationId", stationList.get(i)[15]); |
| 251 | - | ||
| 252 | // 站点编码 | 233 | // 站点编码 |
| 253 | - tempM.put("stationStationCod", stationList.get(i)[16]); | ||
| 254 | - | 234 | + tempM.put("stationCode", stationList.get(i)[16]); |
| 255 | // 站点名称 | 235 | // 站点名称 |
| 256 | tempM.put("stationStationName", stationList.get(i)[17]); | 236 | tempM.put("stationStationName", stationList.get(i)[17]); |
| 257 | - | ||
| 258 | // 路段编码 | 237 | // 路段编码 |
| 259 | tempM.put("stationRoadCoding", stationList.get(i)[18]); | 238 | tempM.put("stationRoadCoding", stationList.get(i)[18]); |
| 260 | - | ||
| 261 | // 原坐标类型 | 239 | // 原坐标类型 |
| 262 | tempM.put("stationDbType", stationList.get(i)[19]); | 240 | tempM.put("stationDbType", stationList.get(i)[19]); |
| 263 | - | ||
| 264 | // 中心点(百度坐标) | 241 | // 中心点(百度坐标) |
| 265 | - tempM.put("stationBJwpoints", stationList.get(i)[20]); | ||
| 266 | - | 242 | + tempM.put("stationJwpoints", stationList.get(i)[20]); |
| 267 | // 中心点(WGS经度) | 243 | // 中心点(WGS经度) |
| 268 | tempM.put("stationGLonx", stationList.get(i)[21]); | 244 | tempM.put("stationGLonx", stationList.get(i)[21]); |
| 269 | - | ||
| 270 | // 中心点(WGS纬度) | 245 | // 中心点(WGS纬度) |
| 271 | tempM.put("stationGLaty", stationList.get(i)[22]); | 246 | tempM.put("stationGLaty", stationList.get(i)[22]); |
| 272 | - | ||
| 273 | // 城建坐标x | 247 | // 城建坐标x |
| 274 | tempM.put("stationx", stationList.get(i)[23]); | 248 | tempM.put("stationx", stationList.get(i)[23]); |
| 275 | - | ||
| 276 | // 城建坐标y | 249 | // 城建坐标y |
| 277 | tempM.put("stationy", stationList.get(i)[24]); | 250 | tempM.put("stationy", stationList.get(i)[24]); |
| 278 | - | ||
| 279 | // 站点图形类型 | 251 | // 站点图形类型 |
| 280 | tempM.put("stationShapesType", stationList.get(i)[25]); | 252 | tempM.put("stationShapesType", stationList.get(i)[25]); |
| 281 | - | ||
| 282 | // 站点圆半径 | 253 | // 站点圆半径 |
| 283 | tempM.put("stationRadius", stationList.get(i)[26]); | 254 | tempM.put("stationRadius", stationList.get(i)[26]); |
| 284 | - | ||
| 285 | // 站点图形WGS坐标 | 255 | // 站点图形WGS坐标 |
| 286 | tempM.put("stationGPolygonGrid", stationList.get(i)[27]); | 256 | tempM.put("stationGPolygonGrid", stationList.get(i)[27]); |
| 287 | - | ||
| 288 | // 站点图形百度坐标 | 257 | // 站点图形百度坐标 |
| 289 | tempM.put("stationBPolygonGrid", stationList.get(i)[28]); | 258 | tempM.put("stationBPolygonGrid", stationList.get(i)[28]); |
| 290 | - | ||
| 291 | // 是否撤销 | 259 | // 是否撤销 |
| 292 | tempM.put("stationDestroy", stationList.get(i)[29]); | 260 | tempM.put("stationDestroy", stationList.get(i)[29]); |
| 293 | - | ||
| 294 | // 站点版本 | 261 | // 站点版本 |
| 295 | tempM.put("stationVersions", stationList.get(i)[30]); | 262 | tempM.put("stationVersions", stationList.get(i)[30]); |
| 296 | - | ||
| 297 | // 站点说明 | 263 | // 站点说明 |
| 298 | tempM.put("stationDescriptions", stationList.get(i)[31]); | 264 | tempM.put("stationDescriptions", stationList.get(i)[31]); |
| 299 | - | ||
| 300 | - tempM.put("name", stationList.get(i)[3]); | ||
| 301 | - | 265 | + tempM.put("zdmc", stationList.get(i)[3]); |
| 302 | tempM.put("text", stationList.get(i)[3]); | 266 | tempM.put("text", stationList.get(i)[3]); |
| 303 | - | ||
| 304 | tempM.put("icon", "fa fa-bus"); | 267 | tempM.put("icon", "fa fa-bus"); |
| 305 | - | ||
| 306 | tempM.put("pId", 200); | 268 | tempM.put("pId", 200); |
| 307 | - | ||
| 308 | tempM.put("id", i+1); | 269 | tempM.put("id", i+1); |
| 309 | - | ||
| 310 | tempM.put("groupType", "3"); | 270 | tempM.put("groupType", "3"); |
| 311 | - | ||
| 312 | tempM.put("chaildredType", "station"); | 271 | tempM.put("chaildredType", "station"); |
| 313 | - | ||
| 314 | tempM.put("enable", true); | 272 | tempM.put("enable", true); |
| 315 | - | ||
| 316 | staitonChildren.add(tempM); | 273 | staitonChildren.add(tempM); |
| 317 | } | 274 | } |
| 318 | } | 275 | } |
| @@ -321,107 +278,87 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -321,107 +278,87 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 321 | List<Map<String, Object>> sectionChildren = new ArrayList<Map<String, Object>>(); | 278 | List<Map<String, Object>> sectionChildren = new ArrayList<Map<String, Object>>(); |
| 322 | 279 | ||
| 323 | if(sectionList.size()>0) { | 280 | if(sectionList.size()>0) { |
| 324 | - | ||
| 325 | for(int i = 0 ; i<sectionList.size() ; i++){ | 281 | for(int i = 0 ; i<sectionList.size() ; i++){ |
| 326 | - | ||
| 327 | Map<String, Object> tempM = new HashMap<String, Object>(); | 282 | Map<String, Object> tempM = new HashMap<String, Object>(); |
| 328 | - | ||
| 329 | // 路段路由ID | 283 | // 路段路由ID |
| 330 | tempM.put("sectionrouteId",sectionList.get(i)[0]); | 284 | tempM.put("sectionrouteId",sectionList.get(i)[0]); |
| 331 | - | ||
| 332 | // 路段路由线路ID | 285 | // 路段路由线路ID |
| 333 | tempM.put("sectionrouteLine",sectionList.get(i)[1]); | 286 | tempM.put("sectionrouteLine",sectionList.get(i)[1]); |
| 334 | - | ||
| 335 | // 路段路由线路编码 | 287 | // 路段路由线路编码 |
| 336 | tempM.put("sectionrouteLineCode",sectionList.get(i)[2]); | 288 | tempM.put("sectionrouteLineCode",sectionList.get(i)[2]); |
| 337 | - | ||
| 338 | // 路段路由路段ID | 289 | // 路段路由路段ID |
| 339 | tempM.put("sectionrouteSection",sectionList.get(i)[3]); | 290 | tempM.put("sectionrouteSection",sectionList.get(i)[3]); |
| 340 | - | ||
| 341 | // 路段路由路段编码 | 291 | // 路段路由路段编码 |
| 342 | tempM.put("sectionrouteSectionCode",sectionList.get(i)[4]); | 292 | tempM.put("sectionrouteSectionCode",sectionList.get(i)[4]); |
| 343 | - | ||
| 344 | tempM.put("sectionrouteCode",sectionList.get(i)[5]); | 293 | tempM.put("sectionrouteCode",sectionList.get(i)[5]); |
| 345 | - | ||
| 346 | tempM.put("sectionrouteDirections",sectionList.get(i)[6]); | 294 | tempM.put("sectionrouteDirections",sectionList.get(i)[6]); |
| 347 | - | ||
| 348 | // 路段ID | 295 | // 路段ID |
| 349 | tempM.put("sectionId",sectionList.get(i)[7]); | 296 | tempM.put("sectionId",sectionList.get(i)[7]); |
| 350 | - | ||
| 351 | // 路段编码 | 297 | // 路段编码 |
| 352 | tempM.put("sectionCode",sectionList.get(i)[8]); | 298 | tempM.put("sectionCode",sectionList.get(i)[8]); |
| 353 | - | ||
| 354 | // 路段名称 | 299 | // 路段名称 |
| 355 | tempM.put("sectionName",sectionList.get(i)[9]); | 300 | tempM.put("sectionName",sectionList.get(i)[9]); |
| 356 | - | ||
| 357 | // 道路编码 | 301 | // 道路编码 |
| 358 | tempM.put("sectionCrosesRoad",sectionList.get(i)[10]); | 302 | tempM.put("sectionCrosesRoad",sectionList.get(i)[10]); |
| 359 | - | ||
| 360 | // 终点站 | 303 | // 终点站 |
| 361 | tempM.put("sectionEndNode",sectionList.get(i)[11]); | 304 | tempM.put("sectionEndNode",sectionList.get(i)[11]); |
| 362 | - | ||
| 363 | // 起始节点 | 305 | // 起始节点 |
| 364 | tempM.put("sectionStartNode",sectionList.get(i)[12]); | 306 | tempM.put("sectionStartNode",sectionList.get(i)[12]); |
| 365 | - | ||
| 366 | // 中间节点 | 307 | // 中间节点 |
| 367 | tempM.put("sectionMiddleNode",sectionList.get(i)[13]); | 308 | tempM.put("sectionMiddleNode",sectionList.get(i)[13]); |
| 368 | - | ||
| 369 | // 路段类型 | 309 | // 路段类型 |
| 370 | tempM.put("sectionType",sectionList.get(i)[14]); | 310 | tempM.put("sectionType",sectionList.get(i)[14]); |
| 371 | - | ||
| 372 | // 路段折线图形城建坐标 | 311 | // 路段折线图形城建坐标 |
| 373 | tempM.put("sectionCsectionVector",sectionList.get(i)[15]); | 312 | tempM.put("sectionCsectionVector",sectionList.get(i)[15]); |
| 374 | - | ||
| 375 | // 路段折线图形百度坐标 | 313 | // 路段折线图形百度坐标 |
| 376 | tempM.put("sectionBsectionVector",sectionList.get(i)[16]); | 314 | tempM.put("sectionBsectionVector",sectionList.get(i)[16]); |
| 377 | - | ||
| 378 | // 路段折线图形WGS坐标 | 315 | // 路段折线图形WGS坐标 |
| 379 | tempM.put("sectionGsectionVector",sectionList.get(i)[17]); | 316 | tempM.put("sectionGsectionVector",sectionList.get(i)[17]); |
| 380 | - | ||
| 381 | // 道路编码 | 317 | // 道路编码 |
| 382 | tempM.put("sectionRoadCoding",sectionList.get(i)[18]); | 318 | tempM.put("sectionRoadCoding",sectionList.get(i)[18]); |
| 383 | - | ||
| 384 | // 路段距离 | 319 | // 路段距离 |
| 385 | tempM.put("sectionDistance",sectionList.get(i)[19]); | 320 | tempM.put("sectionDistance",sectionList.get(i)[19]); |
| 386 | - | ||
| 387 | // 路段时间 | 321 | // 路段时间 |
| 388 | tempM.put("sectionTime",sectionList.get(i)[20]); | 322 | tempM.put("sectionTime",sectionList.get(i)[20]); |
| 389 | - | ||
| 390 | // 路段原坐标类型 | 323 | // 路段原坐标类型 |
| 391 | tempM.put("sectiondbType",sectionList.get(i)[21]); | 324 | tempM.put("sectiondbType",sectionList.get(i)[21]); |
| 392 | - | ||
| 393 | // 限速 | 325 | // 限速 |
| 394 | tempM.put("sectionSpeedLimet",sectionList.get(i)[22]); | 326 | tempM.put("sectionSpeedLimet",sectionList.get(i)[22]); |
| 395 | - | ||
| 396 | // 是否撤销 | 327 | // 是否撤销 |
| 397 | tempM.put("destroy",sectionList.get(i)[23]); | 328 | tempM.put("destroy",sectionList.get(i)[23]); |
| 398 | - | ||
| 399 | // 版本号 | 329 | // 版本号 |
| 400 | tempM.put("versions",sectionList.get(i)[24]); | 330 | tempM.put("versions",sectionList.get(i)[24]); |
| 401 | - | ||
| 402 | // 说明 | 331 | // 说明 |
| 403 | tempM.put("descriptions",sectionList.get(i)[25]); | 332 | tempM.put("descriptions",sectionList.get(i)[25]); |
| 404 | // 说明 | 333 | // 说明 |
| 405 | tempM.put("isRoadeSpeed",sectionList.get(i)[26]); | 334 | tempM.put("isRoadeSpeed",sectionList.get(i)[26]); |
| 406 | - | ||
| 407 | tempM.put("name", sectionList.get(i)[9]); | 335 | tempM.put("name", sectionList.get(i)[9]); |
| 408 | - | ||
| 409 | tempM.put("text", sectionList.get(i)[9]); | 336 | tempM.put("text", sectionList.get(i)[9]); |
| 410 | - | ||
| 411 | tempM.put("icon", null); | 337 | tempM.put("icon", null); |
| 412 | - | ||
| 413 | tempM.put("pId", 300); | 338 | tempM.put("pId", 300); |
| 414 | - | ||
| 415 | tempM.put("id", (i+1)*1000); | 339 | tempM.put("id", (i+1)*1000); |
| 416 | - | ||
| 417 | tempM.put("groupType", "3"); | 340 | tempM.put("groupType", "3"); |
| 418 | - | ||
| 419 | tempM.put("chaildredType", "section"); | 341 | tempM.put("chaildredType", "section"); |
| 420 | - | ||
| 421 | tempM.put("enable", true); | 342 | tempM.put("enable", true); |
| 422 | - | ||
| 423 | sectionChildren.add(tempM); | 343 | sectionChildren.add(tempM); |
| 424 | - | 344 | + } |
| 345 | + } else { | ||
| 346 | + if(stationList.size()>0) { | ||
| 347 | + Map<String, Object> tempM = new HashMap<String, Object>(); | ||
| 348 | + tempM.put("name", "添加路段"); | ||
| 349 | + tempM.put("text", "添加路段"); | ||
| 350 | + tempM.put("lineId", stationList.get(0)[1]); | ||
| 351 | + tempM.put("lineCode", stationList.get(0)[5]); | ||
| 352 | + tempM.put("dir", stationList.get(0)[8]); | ||
| 353 | + tempM.put("versions", stationList.get(0)[14]); | ||
| 354 | + tempM.put("icon", null); | ||
| 355 | + tempM.put("pId", 300); | ||
| 356 | + tempM.put("id", 1000); | ||
| 357 | + tempM.put("groupType", "3"); | ||
| 358 | + tempM.put("chaildredType", "addSection"); | ||
| 359 | + tempM.put("sectionBsectionVector", "LINESTRING("+stationList.get(0)[20]+")"); | ||
| 360 | + tempM.put("enable", true); | ||
| 361 | + sectionChildren.add(tempM); | ||
| 425 | } | 362 | } |
| 426 | } | 363 | } |
| 427 | 364 | ||
| @@ -563,98 +500,102 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -563,98 +500,102 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 563 | int len = objects.size(); | 500 | int len = objects.size(); |
| 564 | 501 | ||
| 565 | if(objects.size()>0) { | 502 | if(objects.size()>0) { |
| 503 | + // 遍历站点 | ||
| 504 | + traversalStation(objects, resultList, len); | ||
| 505 | + } | ||
| 506 | + return resultList; | ||
| 507 | + } | ||
| 566 | 508 | ||
| 567 | - for(int i = 0 ; i < len; i++) { | ||
| 568 | - Map<String, Object> tempM = new HashMap<String,Object>(); | 509 | + private void traversalStation(List<Object[]> objects, List<Map<String, Object>> resultList, int len) { |
| 510 | + for(int i = 0 ; i < len; i++) { | ||
| 511 | + Map<String, Object> tempM = new HashMap<String,Object>(); | ||
| 569 | 512 | ||
| 570 | - tempM.put("stationRouteLine", objects.get(i)[0]); | 513 | + tempM.put("stationRouteLine", objects.get(i)[0]); |
| 571 | 514 | ||
| 572 | - tempM.put("stationRouteStation", objects.get(i)[1]); | 515 | + tempM.put("stationRouteStation", objects.get(i)[1]); |
| 573 | 516 | ||
| 574 | - tempM.put("stationRouteCode", objects.get(i)[2]); | 517 | + tempM.put("stationRouteCode", objects.get(i)[2]); |
| 575 | 518 | ||
| 576 | - tempM.put("stationRouteLIneCode", objects.get(i)[3]); | 519 | + tempM.put("stationRouteLIneCode", objects.get(i)[3]); |
| 577 | 520 | ||
| 578 | - tempM.put("stationRouteStationMark", objects.get(i)[4]); | 521 | + tempM.put("stationRouteStationMark", objects.get(i)[4]); |
| 579 | 522 | ||
| 580 | - tempM.put("stationOutStationNmber", objects.get(i)[5]); | 523 | + tempM.put("stationOutStationNmber", objects.get(i)[5]); |
| 581 | 524 | ||
| 582 | - tempM.put("stationRoutedirections", objects.get(i)[6]); | 525 | + tempM.put("stationRoutedirections", objects.get(i)[6]); |
| 583 | 526 | ||
| 584 | - tempM.put("stationRouteDistances", objects.get(i)[7]); | 527 | + tempM.put("stationRouteDistances", objects.get(i)[7]); |
| 585 | 528 | ||
| 586 | - tempM.put("stationRouteToTime", objects.get(i)[8]); | 529 | + tempM.put("stationRouteToTime", objects.get(i)[8]); |
| 587 | 530 | ||
| 588 | - tempM.put("staitonRouteFirstTime", objects.get(i)[9]); | 531 | + tempM.put("staitonRouteFirstTime", objects.get(i)[9]); |
| 589 | 532 | ||
| 590 | - tempM.put("stationRouteEndTime", objects.get(i)[10]); | 533 | + tempM.put("stationRouteEndTime", objects.get(i)[10]); |
| 591 | 534 | ||
| 592 | - tempM.put("stationRouteDescriptions", objects.get(i)[11]); | 535 | + tempM.put("stationRouteDescriptions", objects.get(i)[11]); |
| 593 | 536 | ||
| 594 | - tempM.put("stationRouteDestroy", objects.get(i)[12]); | 537 | + tempM.put("stationRouteDestroy", objects.get(i)[12]); |
| 595 | 538 | ||
| 596 | - tempM.put("stationRouteVersions", objects.get(i)[13]); | 539 | + tempM.put("stationRouteVersions", objects.get(i)[13]); |
| 597 | 540 | ||
| 598 | - tempM.put("stationRouteCreateBy", objects.get(i)[14]); | 541 | + tempM.put("stationRouteCreateBy", objects.get(i)[14]); |
| 599 | 542 | ||
| 600 | - tempM.put("stationRouteCreateDate", objects.get(i)[15]); | 543 | + tempM.put("stationRouteCreateDate", objects.get(i)[15]); |
| 601 | 544 | ||
| 602 | - tempM.put("stationRouteUpdateBy", objects.get(i)[16]); | 545 | + tempM.put("stationRouteUpdateBy", objects.get(i)[16]); |
| 603 | 546 | ||
| 604 | - tempM.put("stationRouteUpdateDate", objects.get(i)[17]); | 547 | + tempM.put("stationRouteUpdateDate", objects.get(i)[17]); |
| 605 | 548 | ||
| 606 | - tempM.put("stationId", objects.get(i)[18]); | 549 | + tempM.put("stationId", objects.get(i)[18]); |
| 607 | 550 | ||
| 608 | - tempM.put("stationCode", objects.get(i)[19]); | 551 | + tempM.put("stationCode", objects.get(i)[19]); |
| 609 | 552 | ||
| 610 | - tempM.put("stationRouteName", objects.get(i)[20]); | 553 | + tempM.put("stationRouteName", objects.get(i)[20]); |
| 611 | 554 | ||
| 612 | - tempM.put("stationRoadCoding", objects.get(i)[21]); | 555 | + tempM.put("stationRoadCoding", objects.get(i)[21]); |
| 613 | 556 | ||
| 614 | - tempM.put("stationDbType", objects.get(i)[22]); | 557 | + tempM.put("stationDbType", objects.get(i)[22]); |
| 615 | 558 | ||
| 616 | - tempM.put("stationJwpoints", objects.get(i)[23]); | 559 | + tempM.put("stationJwpoints", objects.get(i)[23]); |
| 617 | 560 | ||
| 618 | - tempM.put("stationGlonx", objects.get(i)[24]); | 561 | + tempM.put("stationGlonx", objects.get(i)[24]); |
| 619 | 562 | ||
| 620 | - tempM.put("stationGlaty", objects.get(i)[25]); | 563 | + tempM.put("stationGlaty", objects.get(i)[25]); |
| 621 | 564 | ||
| 622 | - tempM.put("stationX", objects.get(i)[26]); | 565 | + tempM.put("stationX", objects.get(i)[26]); |
| 623 | 566 | ||
| 624 | - tempM.put("stationY", objects.get(i)[27]); | 567 | + tempM.put("stationY", objects.get(i)[27]); |
| 625 | 568 | ||
| 626 | - tempM.put("stationBPolyonGrid", objects.get(i)[28]); | 569 | + tempM.put("stationBPolyonGrid", objects.get(i)[28]); |
| 627 | 570 | ||
| 628 | - tempM.put("stationGPloyonGrid", objects.get(i)[29]); | 571 | + tempM.put("stationGPloyonGrid", objects.get(i)[29]); |
| 629 | 572 | ||
| 630 | - tempM.put("stationDestroy", objects.get(i)[30]); | 573 | + tempM.put("stationDestroy", objects.get(i)[30]); |
| 631 | 574 | ||
| 632 | - tempM.put("stationRadius", objects.get(i)[31]); | 575 | + tempM.put("stationRadius", objects.get(i)[31]); |
| 633 | 576 | ||
| 634 | - tempM.put("stationShapesType", objects.get(i)[32]); | 577 | + tempM.put("stationShapesType", objects.get(i)[32]); |
| 635 | 578 | ||
| 636 | - tempM.put("stationVersions", objects.get(i)[33]); | 579 | + tempM.put("stationVersions", objects.get(i)[33]); |
| 637 | 580 | ||
| 638 | - tempM.put("sttationDescriptions", objects.get(i)[34]); | 581 | + tempM.put("sttationDescriptions", objects.get(i)[34]); |
| 639 | 582 | ||
| 640 | - tempM.put("stationCreateBy", objects.get(i)[35]); | 583 | + tempM.put("stationCreateBy", objects.get(i)[35]); |
| 641 | 584 | ||
| 642 | - tempM.put("stationCreateDate", objects.get(i)[36]); | 585 | + tempM.put("stationCreateDate", objects.get(i)[36]); |
| 643 | 586 | ||
| 644 | - tempM.put("stationUpdateBy", objects.get(i)[37]); | 587 | + tempM.put("stationUpdateBy", objects.get(i)[37]); |
| 645 | 588 | ||
| 646 | - tempM.put("stationUpdateDate", objects.get(i)[38]); | 589 | + tempM.put("stationUpdateDate", objects.get(i)[38]); |
| 647 | 590 | ||
| 648 | - tempM.put("stationRouteId", objects.get(i)[39]); | ||
| 649 | - tempM.put("zdmc", objects.get(i)[40]); | 591 | + tempM.put("stationRouteId", objects.get(i)[39]); |
| 592 | + tempM.put("zdmc", objects.get(i)[40]); | ||
| 650 | 593 | ||
| 651 | - resultList.add(tempM); | ||
| 652 | - } | ||
| 653 | - } | ||
| 654 | - return resultList; | 594 | + resultList.add(tempM); |
| 595 | + } | ||
| 655 | } | 596 | } |
| 656 | 597 | ||
| 657 | - /** | 598 | + /** |
| 658 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) | 599 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 659 | * | 600 | * |
| 660 | * @param map <lineId:线路ID; direction:方向> | 601 | * @param map <lineId:线路ID; direction:方向> |
| @@ -692,6 +633,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -692,6 +633,29 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 692 | 633 | ||
| 693 | return resultList; | 634 | return resultList; |
| 694 | } | 635 | } |
| 636 | + | ||
| 637 | + /** | ||
| 638 | + * @Description :TODO(查询线路某方向下所有站点) | ||
| 639 | + * | ||
| 640 | + * @param map <lineId:线路ID; direction:方向> | ||
| 641 | + * | ||
| 642 | + * @return List<Map<String, Object>> | ||
| 643 | + */ | ||
| 644 | + @Override | ||
| 645 | + public List<Map<String, Object>> getStationRouteList(Map<String, Object> map) { | ||
| 646 | + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); | ||
| 647 | + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); | ||
| 648 | + List<Object[]> objects = repository.getStationRouteList(lineId, direction); | ||
| 649 | + List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | ||
| 650 | + | ||
| 651 | + int len = objects.size(); | ||
| 652 | + | ||
| 653 | + if(objects.size()>0) { | ||
| 654 | + // 遍历站点 | ||
| 655 | + traversalStation(objects, resultList, len); | ||
| 656 | + } | ||
| 657 | + return resultList; | ||
| 658 | + } | ||
| 695 | 659 | ||
| 696 | 660 | ||
| 697 | /** | 661 | /** |
| @@ -774,109 +738,72 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -774,109 +738,72 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 774 | */ | 738 | */ |
| 775 | @Override | 739 | @Override |
| 776 | public Map<String, Object> usingSingle(Map<String, Object> map) { | 740 | public Map<String, Object> usingSingle(Map<String, Object> map) { |
| 777 | - | ||
| 778 | // 返回值map | 741 | // 返回值map |
| 779 | Map<String, Object> resultMap = new HashMap<String,Object>(); | 742 | Map<String, Object> resultMap = new HashMap<String,Object>(); |
| 780 | - | ||
| 781 | try { | 743 | try { |
| 782 | - | ||
| 783 | // 获取线路ID | 744 | // 获取线路ID |
| 784 | Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); | 745 | Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); |
| 785 | - | ||
| 786 | /** 查询线路信息 @param:<lineId:线路ID> */ | 746 | /** 查询线路信息 @param:<lineId:线路ID> */ |
| 787 | Line line = lineRepository.findOne(lineId); | 747 | Line line = lineRepository.findOne(lineId); |
| 788 | - | ||
| 789 | /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */ | 748 | /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */ |
| 790 | List<Object[]> objects = repository.usingSingle(lineId); | 749 | List<Object[]> objects = repository.usingSingle(lineId); |
| 791 | - | ||
| 792 | if (objects.size()>0) { | 750 | if (objects.size()>0) { |
| 793 | - | ||
| 794 | /** 获取配置文件里的ftp登录参数 */ | 751 | /** 获取配置文件里的ftp登录参数 */ |
| 795 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); | 752 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); |
| 796 | - | ||
| 797 | // 压缩文件名 | 753 | // 压缩文件名 |
| 798 | String odlGzFileName = line.getLineCode() + ".txt.gz"; | 754 | String odlGzFileName = line.getLineCode() + ".txt.gz"; |
| 799 | - | ||
| 800 | // txt文件名 | 755 | // txt文件名 |
| 801 | String textFileName = line.getLineCode() + ".txt"; | 756 | String textFileName = line.getLineCode() + ".txt"; |
| 802 | - | ||
| 803 | // 创建一个ftp上传实例 | 757 | // 创建一个ftp上传实例 |
| 804 | FTPClientUtils clientUtils = new FTPClientUtils(); | 758 | FTPClientUtils clientUtils = new FTPClientUtils(); |
| 805 | - | ||
| 806 | // IP | 759 | // IP |
| 807 | String url = FTPParamMap.get("url").toString(); | 760 | String url = FTPParamMap.get("url").toString(); |
| 808 | - | ||
| 809 | // 端口 | 761 | // 端口 |
| 810 | int port = Integer.valueOf(FTPParamMap.get("port").toString()); | 762 | int port = Integer.valueOf(FTPParamMap.get("port").toString()); |
| 811 | - | ||
| 812 | // 用户名 | 763 | // 用户名 |
| 813 | String username = FTPParamMap.get("username").toString(); | 764 | String username = FTPParamMap.get("username").toString(); |
| 814 | - | ||
| 815 | // 密码 | 765 | // 密码 |
| 816 | String password = FTPParamMap.get("password").toString(); | 766 | String password = FTPParamMap.get("password").toString(); |
| 817 | - | ||
| 818 | // 相对路径 | 767 | // 相对路径 |
| 819 | String remotePath = FTPParamMap.get("remotePath").toString(); | 768 | String remotePath = FTPParamMap.get("remotePath").toString(); |
| 820 | - | ||
| 821 | /** 如果已存在相同行单文件名则先删除 */ | 769 | /** 如果已存在相同行单文件名则先删除 */ |
| 822 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); | 770 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); |
| 823 | - | ||
| 824 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); | 771 | clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); |
| 825 | - | ||
| 826 | String textStr = ""; | 772 | String textStr = ""; |
| 827 | - | ||
| 828 | - boolean tempTag = ishxType(objects); | ||
| 829 | - | ||
| 830 | - if(tempTag) | 773 | +// boolean tempTag = ishxType(objects); |
| 774 | + Integer linePlayType = line.getLinePlayType() == null ? -1:line.getLinePlayType(); | ||
| 775 | + if(linePlayType == 1) | ||
| 831 | textStr = hxTextFileToFtp(objects,lineId);// 环线行单文件内容 | 776 | textStr = hxTextFileToFtp(objects,lineId);// 环线行单文件内容 |
| 832 | - else | 777 | + else if (linePlayType == 0) |
| 833 | textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/ | 778 | textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/ |
| 834 | - | ||
| 835 | - /*textStr = line.getName() + "\t" + "2" + "\r" + textStr;*/ | ||
| 836 | - | 779 | + else |
| 780 | + resultMap.put("status","NOLinePlayType");// 线路无线路规划类型 | ||
| 837 | textStr = line.getName() + " " + "2" + "\r" + textStr; | 781 | textStr = line.getName() + " " + "2" + "\r" + textStr; |
| 838 | - | ||
| 839 | InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); | 782 | InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); |
| 840 | - | ||
| 841 | /** 生成txt文件,上传ftp */ | 783 | /** 生成txt文件,上传ftp */ |
| 842 | clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); | 784 | clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); |
| 843 | - | ||
| 844 | // 创建打包实例 | 785 | // 创建打包实例 |
| 845 | PackTarGZUtils packTarGZUtils= new PackTarGZUtils(); | 786 | PackTarGZUtils packTarGZUtils= new PackTarGZUtils(); |
| 846 | - | ||
| 847 | /** 获取txt文件 */ | 787 | /** 获取txt文件 */ |
| 848 | File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName); | 788 | File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName); |
| 849 | - | ||
| 850 | File target = new File(odlGzFileName); | 789 | File target = new File(odlGzFileName); |
| 851 | - | ||
| 852 | // 将txt文件打包 | 790 | // 将txt文件打包 |
| 853 | File targetFile = PackTarGZUtils.compress(textFile, target); | 791 | File targetFile = PackTarGZUtils.compress(textFile, target); |
| 854 | - | ||
| 855 | - /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/ | ||
| 856 | - | ||
| 857 | clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath); | 792 | clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath); |
| 858 | - | ||
| 859 | // 删除文件 | 793 | // 删除文件 |
| 860 | textFile.delete(); | 794 | textFile.delete(); |
| 861 | targetFile.delete(); | 795 | targetFile.delete(); |
| 862 | - | ||
| 863 | resultMap.put("status", ResponseCode.SUCCESS); | 796 | resultMap.put("status", ResponseCode.SUCCESS); |
| 864 | - | ||
| 865 | }else { | 797 | }else { |
| 866 | - | ||
| 867 | resultMap.put("status","NOTDATA"); | 798 | resultMap.put("status","NOTDATA"); |
| 868 | } | 799 | } |
| 869 | - | ||
| 870 | - | ||
| 871 | } catch (Exception e) { | 800 | } catch (Exception e) { |
| 872 | - | ||
| 873 | resultMap.put("status", ResponseCode.ERROR); | 801 | resultMap.put("status", ResponseCode.ERROR); |
| 874 | - | ||
| 875 | logger.error("save erro.", e); | 802 | logger.error("save erro.", e); |
| 876 | - | ||
| 877 | - } | 803 | + } |
| 878 | return resultMap; | 804 | return resultMap; |
| 879 | } | 805 | } |
| 806 | + // 判断线路走向是环线还是双向 | ||
| 880 | public boolean ishxType(List<Object[]> listObj) { | 807 | public boolean ishxType(List<Object[]> listObj) { |
| 881 | boolean tag = true; | 808 | boolean tag = true; |
| 882 | String pointBStr[] = null,pointEStr[] = null; | 809 | String pointBStr[] = null,pointEStr[] = null; |
| @@ -889,9 +816,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -889,9 +816,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 889 | if(Integer.valueOf(listObj.get(i)[8].toString())==1) | 816 | if(Integer.valueOf(listObj.get(i)[8].toString())==1) |
| 890 | numzd++; | 817 | numzd++; |
| 891 | } | 818 | } |
| 892 | - Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1])); | 819 | + Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1])); |
| 893 | Point p2 = new Point(Double.valueOf(pointEStr[0]),Double.valueOf(pointEStr[1])); | 820 | Point p2 = new Point(Double.valueOf(pointEStr[0]),Double.valueOf(pointEStr[1])); |
| 894 | - if(GeoUtils.getDistance(p1, p2)>100 && numzd>2) | 821 | + if(GeoUtils.getDistance(p1, p2)>100 && numzd>2) |
| 895 | tag = false; | 822 | tag = false; |
| 896 | return tag; | 823 | return tag; |
| 897 | } | 824 | } |
| @@ -1241,95 +1168,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -1241,95 +1168,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 1241 | int len = objects.size(); | 1168 | int len = objects.size(); |
| 1242 | 1169 | ||
| 1243 | if(objects.size()>0) { | 1170 | if(objects.size()>0) { |
| 1244 | - | ||
| 1245 | - for(int i = 0 ; i < len; i++) { | ||
| 1246 | - Map<String, Object> tempM = new HashMap<String,Object>(); | ||
| 1247 | - | ||
| 1248 | - tempM.put("stationRouteLine", objects.get(i)[0]); | ||
| 1249 | - | ||
| 1250 | - tempM.put("stationRouteStation", objects.get(i)[1]); | ||
| 1251 | - | ||
| 1252 | - tempM.put("stationRouteCode", objects.get(i)[2]); | ||
| 1253 | - | ||
| 1254 | - tempM.put("stationRouteLIneCode", objects.get(i)[3]); | ||
| 1255 | - | ||
| 1256 | - tempM.put("stationRouteStationMark", objects.get(i)[4]); | ||
| 1257 | - | ||
| 1258 | - tempM.put("stationOutStationNmber", objects.get(i)[5]); | ||
| 1259 | - | ||
| 1260 | - tempM.put("stationRoutedirections", objects.get(i)[6]); | ||
| 1261 | - | ||
| 1262 | - tempM.put("stationRouteDistances", objects.get(i)[7]); | ||
| 1263 | - | ||
| 1264 | - tempM.put("stationRouteToTime", objects.get(i)[8]); | ||
| 1265 | - | ||
| 1266 | - tempM.put("staitonRouteFirstTime", objects.get(i)[9]); | ||
| 1267 | - | ||
| 1268 | - tempM.put("stationRouteEndTime", objects.get(i)[10]); | ||
| 1269 | - | ||
| 1270 | - tempM.put("stationRouteDescriptions", objects.get(i)[11]); | ||
| 1271 | - | ||
| 1272 | - tempM.put("stationRouteDestroy", objects.get(i)[12]); | ||
| 1273 | - | ||
| 1274 | - tempM.put("stationRouteVersions", objects.get(i)[13]); | ||
| 1275 | - | ||
| 1276 | - tempM.put("stationRouteCreateBy", objects.get(i)[14]); | ||
| 1277 | - | ||
| 1278 | - tempM.put("stationRouteCreateDate", objects.get(i)[15]); | ||
| 1279 | - | ||
| 1280 | - tempM.put("stationRouteUpdateBy", objects.get(i)[16]); | ||
| 1281 | - | ||
| 1282 | - tempM.put("stationRouteUpdateDate", objects.get(i)[17]); | ||
| 1283 | - | ||
| 1284 | - tempM.put("stationId", objects.get(i)[18]); | ||
| 1285 | - | ||
| 1286 | - tempM.put("stationCode", objects.get(i)[19]); | ||
| 1287 | - | ||
| 1288 | - tempM.put("stationRouteName", objects.get(i)[20]); | ||
| 1289 | - | ||
| 1290 | - tempM.put("stationRoadCoding", objects.get(i)[21]); | ||
| 1291 | - | ||
| 1292 | - tempM.put("stationDbType", objects.get(i)[22]); | ||
| 1293 | - | ||
| 1294 | - tempM.put("stationJwpoints", objects.get(i)[23]); | ||
| 1295 | - | ||
| 1296 | - tempM.put("stationGlonx", objects.get(i)[24]); | ||
| 1297 | - | ||
| 1298 | - tempM.put("stationGlaty", objects.get(i)[25]); | ||
| 1299 | - | ||
| 1300 | - tempM.put("stationX", objects.get(i)[26]); | ||
| 1301 | - | ||
| 1302 | - tempM.put("stationY", objects.get(i)[27]); | ||
| 1303 | - | ||
| 1304 | - tempM.put("stationBPolyonGrid", objects.get(i)[28]); | ||
| 1305 | - | ||
| 1306 | - tempM.put("stationGPloyonGrid", objects.get(i)[29]); | ||
| 1307 | - | ||
| 1308 | - tempM.put("stationDestroy", objects.get(i)[30]); | ||
| 1309 | - | ||
| 1310 | - tempM.put("stationRadius", objects.get(i)[31]); | ||
| 1311 | - | ||
| 1312 | - tempM.put("stationShapesType", objects.get(i)[32]); | ||
| 1313 | - | ||
| 1314 | - tempM.put("stationVersions", objects.get(i)[33]); | ||
| 1315 | - | ||
| 1316 | - tempM.put("sttationDescriptions", objects.get(i)[34]); | ||
| 1317 | - | ||
| 1318 | - tempM.put("stationCreateBy", objects.get(i)[35]); | ||
| 1319 | - | ||
| 1320 | - tempM.put("stationCreateDate", objects.get(i)[36]); | ||
| 1321 | - | ||
| 1322 | - tempM.put("stationUpdateBy", objects.get(i)[37]); | ||
| 1323 | - | ||
| 1324 | - tempM.put("stationUpdateDate", objects.get(i)[38]); | ||
| 1325 | - | ||
| 1326 | - tempM.put("stationRouteId", objects.get(i)[39]); | ||
| 1327 | - tempM.put("zdmc", objects.get(i)[40]); | ||
| 1328 | - | ||
| 1329 | - resultList.add(tempM); | ||
| 1330 | - } | ||
| 1331 | - | ||
| 1332 | - } | 1171 | + |
| 1172 | + traversalStation(objects, resultList, len); | ||
| 1173 | + | ||
| 1174 | + } | ||
| 1333 | 1175 | ||
| 1334 | return resultList; | 1176 | return resultList; |
| 1335 | } | 1177 | } |
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | var branchMap = new Map(); | 30 | var branchMap = new Map(); |
| 31 | initCompanySelect2(function(array) { | 31 | initCompanySelect2(function(array) { |
| 32 | $.each(array, function() { | 32 | $.each(array, function() { |
| 33 | - companyMap[this.businessCode] = this.businessName; | 33 | + companyMap[this.businessCode] = this.busi nessName; |
| 34 | // companyMap.put(this.businessCode.toString(), this.businessName); | 34 | // companyMap.put(this.businessCode.toString(), this.businessName); |
| 35 | if(this.businessCode != null || this.businessCode !=''){ | 35 | if(this.businessCode != null || this.businessCode !=''){ |
| 36 | /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | 36 | /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ |
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
| @@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
| 6 | // 关闭左侧栏 | 6 | // 关闭左侧栏 |
| 7 | if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | 7 | if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} |
| 8 | // 定义 page : 当前页;initPag ; icheckOptions:选择框 | 8 | // 定义 page : 当前页;initPag ; icheckOptions:选择框 |
| 9 | - var page = 0, | ||
| 10 | - initPag, | 9 | + window.page = 0; |
| 10 | + var initPag, | ||
| 11 | icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'}, | 11 | icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'}, |
| 12 | storage = window.localStorage; | 12 | storage = window.localStorage; |
| 13 | if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') { | 13 | if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') { |
| @@ -301,7 +301,6 @@ | @@ -301,7 +301,6 @@ | ||
| 301 | }); | 301 | }); |
| 302 | // 线路版本编辑 | 302 | // 线路版本编辑 |
| 303 | $(document).on('click', 'a.update_versions_route_btn', function () { | 303 | $(document).on('click', 'a.update_versions_route_btn', function () { |
| 304 | - debugger | ||
| 305 | var lineId = $(this).data('lineid'); | 304 | var lineId = $(this).data('lineid'); |
| 306 | swal({ | 305 | swal({ |
| 307 | title: "操作须知", | 306 | title: "操作须知", |
src/main/resources/static/pages/base/stationroute/add.html
| @@ -360,6 +360,7 @@ $('#add_station_mobal').on('AddStationMobal.show', function(e, addMap,ajaxd,stao | @@ -360,6 +360,7 @@ $('#add_station_mobal').on('AddStationMobal.show', function(e, addMap,ajaxd,stao | ||
| 360 | ajaxd.getSectionRouteInfo(Line.id,add_direction_v,function(data) { | 360 | ajaxd.getSectionRouteInfo(Line.id,add_direction_v,function(data) { |
| 361 | fun.linePanlThree(Line.id,data,add_direction_v); | 361 | fun.linePanlThree(Line.id,data,add_direction_v); |
| 362 | }); | 362 | }); |
| 363 | + fun.editMapStatusRemove(); | ||
| 363 | } | 364 | } |
| 364 | function hideMoble() { | 365 | function hideMoble() { |
| 365 | // 隐藏mobal | 366 | // 隐藏mobal |
src/main/resources/static/pages/base/stationroute/add_manual_select.html
| @@ -31,8 +31,8 @@ | @@ -31,8 +31,8 @@ | ||
| 31 | </form> | 31 | </form> |
| 32 | </div> | 32 | </div> |
| 33 | <div class="modal-footer"> | 33 | <div class="modal-footer"> |
| 34 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 35 | <button type="button" class="btn btn-primary" id="addManualSelectnextButton">下一步</button> | 34 | <button type="button" class="btn btn-primary" id="addManualSelectnextButton">下一步</button> |
| 35 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 36 | </div> | 36 | </div> |
| 37 | </div> | 37 | </div> |
| 38 | </div> | 38 | </div> |
src/main/resources/static/pages/base/stationroute/add_select.html
| @@ -38,8 +38,8 @@ | @@ -38,8 +38,8 @@ | ||
| 38 | </form> | 38 | </form> |
| 39 | </div> | 39 | </div> |
| 40 | <div class="modal-footer"> | 40 | <div class="modal-footer"> |
| 41 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 42 | <button type="button" class="btn btn-primary" id="addSelectnextButton">下一步</button> | 41 | <button type="button" class="btn btn-primary" id="addSelectnextButton">下一步</button> |
| 42 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 43 | </div> | 43 | </div> |
| 44 | </div> | 44 | </div> |
| 45 | </div> | 45 | </div> |
| @@ -164,12 +164,13 @@ $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stat | @@ -164,12 +164,13 @@ $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stat | ||
| 164 | } | 164 | } |
| 165 | }); | 165 | }); |
| 166 | }else if(baseRes==1) { | 166 | }else if(baseRes==1) { |
| 167 | - map_.clearMarkAndOverlays(); | 167 | + // map_.clearMarkAndOverlays(); |
| 168 | // 以藏站点新增方式mobal | 168 | // 以藏站点新增方式mobal |
| 169 | $('#add_select_mobal').modal('hide'); | 169 | $('#add_select_mobal').modal('hide'); |
| 170 | // 打开绘制工具 | 170 | // 打开绘制工具 |
| 171 | drw.openDrawingManager(); | 171 | drw.openDrawingManager(); |
| 172 | - map_.localtionPoint(stationName); | 172 | + // map_.localtionPoint(stationName); |
| 173 | + fun.editMapStatus(); | ||
| 173 | } | 174 | } |
| 174 | // 查询是否存在输入的站点名称 | 175 | // 查询是否存在输入的站点名称 |
| 175 | /* ajaxd_.getLikeStationName(stationName,function(data) { | 176 | /* ajaxd_.getLikeStationName(stationName,function(data) { |
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
| 1 | #bmap_basic{ | 1 | #bmap_basic{ |
| 2 | min-width: 100%; | 2 | min-width: 100%; |
| 3 | - /*width: calc(100% + 26px); */ | ||
| 4 | margin-top: -10px; | 3 | margin-top: -10px; |
| 5 | - border: 2px solid #fdfdfd; | ||
| 6 | - min-height: 1200px; | ||
| 7 | height:100%; | 4 | height:100%; |
| 8 | - overflow: hidden; | 5 | +} |
| 6 | + | ||
| 7 | +.mian-portlet-body{ | ||
| 8 | + height: 100%; | ||
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | html,body{ | 11 | html,body{ |
| 12 | overflow:hidden; | 12 | overflow:hidden; |
| 13 | - height: 99%; | 13 | + height: calc(100% - 10px); |
| 14 | +} | ||
| 15 | + | ||
| 16 | +.protlet-box-layer{ | ||
| 17 | + position: absolute; | ||
| 18 | + z-index: 900; | ||
| 19 | + height: 100%; | ||
| 20 | + width: 100%; | ||
| 21 | + background: #ffffff85; | ||
| 22 | + display: none; | ||
| 14 | } | 23 | } |
| 15 | 24 | ||
| 16 | .rm3_image { | 25 | .rm3_image { |
| @@ -19,6 +28,52 @@ html,body{ | @@ -19,6 +28,52 @@ html,body{ | ||
| 19 | 28 | ||
| 20 | } | 29 | } |
| 21 | 30 | ||
| 31 | +.search_panel{ | ||
| 32 | + position: absolute; | ||
| 33 | + z-index: 99; | ||
| 34 | + height: 42px; | ||
| 35 | + top: 40px; | ||
| 36 | + left: 500px; | ||
| 37 | + background: #fff1f0; | ||
| 38 | + padding: 0px; | ||
| 39 | + box-shadow: 5px 1px 5px rgba(90, 90, 90, 0.48); | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +.search_input_panel { | ||
| 43 | + display: inline; | ||
| 44 | + height: 42px; | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +.search_input_panel .search_input { | ||
| 48 | + width: 200px; | ||
| 49 | + height: 42px; | ||
| 50 | + padding:0 20px 0 10px; | ||
| 51 | + float:left; | ||
| 52 | + border:none; | ||
| 53 | + outline: 0px; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +.search_input_panel .clear { | ||
| 57 | + right: 42px; | ||
| 58 | + position: absolute; | ||
| 59 | + top: 15px; | ||
| 60 | + width: 20px; | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +.search_button_panel{ | ||
| 64 | + height: 42px; | ||
| 65 | + display: inline; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +.search_button { | ||
| 69 | + width: 42px; | ||
| 70 | + height: 42px; | ||
| 71 | + background: #fff; | ||
| 72 | + border:none; | ||
| 73 | + top: 0; | ||
| 74 | + outline: 0px; | ||
| 75 | +} | ||
| 76 | + | ||
| 22 | /* 隐藏百度地图logo */ | 77 | /* 隐藏百度地图logo */ |
| 23 | .anchorBL, | 78 | .anchorBL, |
| 24 | .anchorBL, | 79 | .anchorBL, |
| @@ -36,8 +91,7 @@ html,body{ | @@ -36,8 +91,7 @@ html,body{ | ||
| 36 | height: auto; | 91 | height: auto; |
| 37 | background:transparent; | 92 | background:transparent; |
| 38 | border:0px solid; | 93 | border:0px solid; |
| 39 | - box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33); | ||
| 40 | - border-radius: 6px !important;box-shadow: 10px 10px 5px #888888; | 94 | + border-radius: 6px !important;box-shadow: 5px 5px 5px rgba(90, 90, 90, 0.48); |
| 41 | } | 95 | } |
| 42 | 96 | ||
| 43 | .help-block{ | 97 | .help-block{ |
| @@ -45,47 +99,12 @@ html,body{ | @@ -45,47 +99,12 @@ html,body{ | ||
| 45 | font-size: 15px; | 99 | font-size: 15px; |
| 46 | } | 100 | } |
| 47 | 101 | ||
| 48 | -/*.BMap_pop div:nth-child(1) ,*/ | ||
| 49 | -/*.BMap_pop div:nth-child(2) ,*/ | ||
| 50 | -/*.BMap_pop div:nth-child(3) ,*/ | ||
| 51 | -/*.BMap_pop div:nth-child(4) ,*/ | ||
| 52 | -/*.BMap_pop div:nth-child(5) ,*/ | ||
| 53 | -/*.BMap_pop div:nth-child(6) ,*/ | ||
| 54 | -/*.BMap_pop div:nth-child(7) {*/ | ||
| 55 | - /**/ | ||
| 56 | - /*border:0px solid rgb(255, 255, 255) !important;*/ | ||
| 57 | - /*background-color:#3B3F51 !important;*/ | ||
| 58 | - /**/ | ||
| 59 | -/*}*/ | ||
| 60 | - | ||
| 61 | -/*.BMap_pop div:nth-child(3){*/ | ||
| 62 | - /**/ | ||
| 63 | - /*width:23px !important;*/ | ||
| 64 | - /**/ | ||
| 65 | -/*}*/ | ||
| 66 | - | ||
| 67 | -/*.BMap_pop div:nth-child(7) {*/ | ||
| 68 | - /**/ | ||
| 69 | - /*width:23px !important;*/ | ||
| 70 | - /**/ | ||
| 71 | - /*height:24px !important;*/ | ||
| 72 | - /**/ | ||
| 73 | -/*}*/ | ||
| 74 | - | ||
| 75 | -/*.BMap_pop div:nth-child(5) {*/ | ||
| 76 | - /**/ | ||
| 77 | - /*height:24px !important;*/ | ||
| 78 | - /**/ | ||
| 79 | -/*}*/ | ||
| 80 | - | ||
| 81 | -/* 图片以后在弄,先隐藏div */ | ||
| 82 | -/*.BMap_pop div:nth-child(8) {*/ | ||
| 83 | - /**/ | ||
| 84 | - /*height:0px !important;*/ | ||
| 85 | - /*!* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; *!*/ | ||
| 86 | - /*!* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; *!*/ | ||
| 87 | - /**/ | ||
| 88 | -/*}*/ | 102 | +.info_win_btn { |
| 103 | + background: #ff8355; | ||
| 104 | + color: #fff; | ||
| 105 | + font-size: 12px; | ||
| 106 | + border: 1px solid transparent; | ||
| 107 | +} | ||
| 89 | 108 | ||
| 90 | .BMap_pop { | 109 | .BMap_pop { |
| 91 | 110 | ||
| @@ -94,36 +113,111 @@ html,body{ | @@ -94,36 +113,111 @@ html,body{ | ||
| 94 | } | 113 | } |
| 95 | 114 | ||
| 96 | .defeat-scroll { | 115 | .defeat-scroll { |
| 97 | -width: 98%; | ||
| 98 | -height:380px; | ||
| 99 | -/* overflow:auto; */ | ||
| 100 | -overflow:hidden; | 116 | + width: 98%; |
| 117 | + height:380px; | ||
| 118 | + overflow:hidden; | ||
| 101 | } | 119 | } |
| 102 | .defeat-scroll::-webkit-scrollbar { | 120 | .defeat-scroll::-webkit-scrollbar { |
| 103 | -width:6px; | ||
| 104 | -height:6px; | 121 | + width:6px; |
| 122 | + height:6px; | ||
| 105 | } | 123 | } |
| 106 | .defeat-scroll::-webkit-scrollbar-button { | 124 | .defeat-scroll::-webkit-scrollbar-button { |
| 107 | -/* background-color:#FF7677; */ | ||
| 108 | -background:rgba(255, 255, 255, 0); | 125 | + background:rgba(255, 255, 255, 0); |
| 109 | } | 126 | } |
| 110 | .defeat-scroll::-webkit-scrollbar-track { | 127 | .defeat-scroll::-webkit-scrollbar-track { |
| 111 | -/* background:#FF66D5; */ | ||
| 112 | -background:rgba(255, 255, 255, 0); | 128 | + background:rgba(255, 255, 255, 0); |
| 113 | } | 129 | } |
| 114 | .defeat-scroll::-webkit-scrollbar-track-piece { | 130 | .defeat-scroll::-webkit-scrollbar-track-piece { |
| 115 | -/* background:#ff0000; */ | ||
| 116 | -background:rgba(255, 255, 255, 0); | 131 | + background:rgba(255, 255, 255, 0); |
| 117 | } | 132 | } |
| 118 | .defeat-scroll::-webkit-scrollbar-thumb{ | 133 | .defeat-scroll::-webkit-scrollbar-thumb{ |
| 119 | -background:rgba(197, 196, 196, 0.81); | ||
| 120 | -border-radius:10px !important; | 134 | + background:rgba(197, 196, 196, 0.81); |
| 135 | + border-radius:10px !important; | ||
| 121 | } | 136 | } |
| 122 | .defeat-scroll::-webkit-scrollbar-corner { | 137 | .defeat-scroll::-webkit-scrollbar-corner { |
| 123 | -/* background:#82AFFF; */ | ||
| 124 | -background:rgba(255, 255, 255, 0); | 138 | + background:rgba(255, 255, 255, 0); |
| 125 | } | 139 | } |
| 126 | -.defeat-scroll::-webkit-scrollbar-resizer { | ||
| 127 | -/* background:#FF0BEE; */ | ||
| 128 | -background:rgba(255, 255, 255, 0); | ||
| 129 | -} | ||
| 130 | \ No newline at end of file | 140 | \ No newline at end of file |
| 141 | +/*.defeat-scroll::-webkit-scrollbar-resizer { | ||
| 142 | + background:rgba(255, 255, 255, 0); | ||
| 143 | +}*/ | ||
| 144 | + | ||
| 145 | +.add_road_search_point_wrap{ | ||
| 146 | + width: 280px; | ||
| 147 | + height: 120px; | ||
| 148 | + position: absolute; | ||
| 149 | + top: 40px; | ||
| 150 | + left: calc(50% - 100px); | ||
| 151 | + z-index: 999; | ||
| 152 | + background: #fdfdfd; | ||
| 153 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +.buffer_edit_body{ | ||
| 157 | + padding: 5px 0 0 15px; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +.buffer_edit_body .form-group{ | ||
| 161 | + margin-top: 10px; | ||
| 162 | + margin-bottom: 0px; | ||
| 163 | + white: 240px | ||
| 164 | +} | ||
| 165 | + | ||
| 166 | +.add_road_search_point_wrap ._title { | ||
| 167 | + padding-right: 18px; | ||
| 168 | + text-align: center; | ||
| 169 | + font-size: 17px; | ||
| 170 | + color: #2b2b2b; | ||
| 171 | + /*padding: 2px 0 0 0;*/ | ||
| 172 | + font-weight: 600; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +.buffer_edit_body .btns{ | ||
| 176 | + text-align: right; | ||
| 177 | +} | ||
| 178 | + | ||
| 179 | +.buffer_edit_body .form-group .inline{ | ||
| 180 | + width: 100px !important; | ||
| 181 | + height: 30px; | ||
| 182 | + margin-right: 7px; | ||
| 183 | + display: inline-block; | ||
| 184 | + position: relative; | ||
| 185 | + max-width: 100%; | ||
| 186 | + vertical-align: middle; | ||
| 187 | +} | ||
| 188 | + | ||
| 189 | +.sbmint-btn { | ||
| 190 | + padding: 0 15px; | ||
| 191 | + height: 28px; | ||
| 192 | + line-height: 28px; | ||
| 193 | + vertical-align: top; | ||
| 194 | + margin-top: 2px; | ||
| 195 | + background-color: #1e87f0; | ||
| 196 | + color: #fff; | ||
| 197 | + border: 1px solid transparent; | ||
| 198 | +} | ||
| 199 | +.cancel-btn { | ||
| 200 | + padding: 0 15px; | ||
| 201 | + height: 28px; | ||
| 202 | + line-height: 28px; | ||
| 203 | + vertical-align: top; | ||
| 204 | + margin-top: 2px; | ||
| 205 | + background-color: transparent; | ||
| 206 | + color: #333; | ||
| 207 | + border: 1px solid #e5e5e5; | ||
| 208 | +} | ||
| 209 | + | ||
| 210 | +.draw_polyline_switch{ | ||
| 211 | + display: inline-block; | ||
| 212 | + font-size: 12px; | ||
| 213 | + vertical-align: bottom; | ||
| 214 | + margin-left: 5px; | ||
| 215 | +} | ||
| 216 | + | ||
| 217 | +.draw_polyline_switch>a{ | ||
| 218 | + color: red; | ||
| 219 | +} | ||
| 220 | + | ||
| 221 | +.buffer_edit_body .form-group input{ | ||
| 222 | + height: 30px; | ||
| 223 | +} | ||
| 224 | + |
src/main/resources/static/pages/base/stationroute/delete_select.html
| @@ -29,9 +29,9 @@ | @@ -29,9 +29,9 @@ | ||
| 29 | </form> | 29 | </form> |
| 30 | </div> | 30 | </div> |
| 31 | <div class="modal-footer"> | 31 | <div class="modal-footer"> |
| 32 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 33 | <button type="button" class="btn btn-primary" | 32 | <button type="button" class="btn btn-primary" |
| 34 | - id="deleteSelectnextButton">下一步</button> | 33 | + id="deleteSelectnextButton">下一步</button> |
| 34 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 35 | </div> | 35 | </div> |
| 36 | </div> | 36 | </div> |
| 37 | </div> | 37 | </div> |
src/main/resources/static/pages/base/stationroute/deletesection.html
| @@ -139,25 +139,25 @@ $('#delete_section_mobal').on('deleteSectionMobal.show',function(e, ajaxd, line, | @@ -139,25 +139,25 @@ $('#delete_section_mobal').on('deleteSectionMobal.show',function(e, ajaxd, line, | ||
| 139 | ids = ids.substr(1, ids.length - 1); | 139 | ids = ids.substr(1, ids.length - 1); |
| 140 | var params = {}; | 140 | var params = {}; |
| 141 | params.ids = ids; | 141 | params.ids = ids; |
| 142 | - $.get('/sectionroute/batchDestroy',params,function(resuntDate) { | ||
| 143 | - if (resuntDate.status == 'SUCCESS') { | ||
| 144 | - // 弹出添加成功提示消息 | ||
| 145 | - layer.msg('修改成功...'); | ||
| 146 | - /** 通知更新缓存区 */ | ||
| 147 | - //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)}) | ||
| 148 | - } else { | ||
| 149 | - // 弹出添加失败提示消息 | ||
| 150 | - layer.msg('修改失败...'); | ||
| 151 | - } | ||
| 152 | - initSearch(); | ||
| 153 | - // 刷新左边树 | ||
| 154 | - fun.resjtreeDate(line.id,delBatch.dir); | ||
| 155 | - /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | ||
| 156 | - ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) { | ||
| 157 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | ||
| 158 | - fun.linePanlThree(line.id,data,delBatch.dir); | ||
| 159 | - }); | ||
| 160 | - }); | 142 | + $.post('/sectionroute/batchDestroy',params,function(resuntDate) { |
| 143 | + if (resuntDate.status == 'SUCCESS') { | ||
| 144 | + // 弹出添加成功提示消息 | ||
| 145 | + layer.msg('修改成功...'); | ||
| 146 | + /** 通知更新缓存区 */ | ||
| 147 | + //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)}) | ||
| 148 | + } else { | ||
| 149 | + // 弹出添加失败提示消息 | ||
| 150 | + layer.msg('修改失败...'); | ||
| 151 | + } | ||
| 152 | + initSearch(); | ||
| 153 | + // 刷新左边树 | ||
| 154 | + fun.resjtreeDate(line.id,delBatch.dir); | ||
| 155 | + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | ||
| 156 | + ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) { | ||
| 157 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | ||
| 158 | + fun.linePanlThree(line.id,data,delBatch.dir); | ||
| 159 | + }); | ||
| 160 | + }); | ||
| 161 | } else { | 161 | } else { |
| 162 | layer.msg('请选择要删除的路段!!!'); | 162 | layer.msg('请选择要删除的路段!!!'); |
| 163 | } | 163 | } |
src/main/resources/static/pages/base/stationroute/deletestation.html
| @@ -141,7 +141,7 @@ $('#delete_station_mobal').on('deleteStationMobal.show',function(e, ajaxd, line, | @@ -141,7 +141,7 @@ $('#delete_station_mobal').on('deleteStationMobal.show',function(e, ajaxd, line, | ||
| 141 | ids = ids.substr(1, ids.length - 1); | 141 | ids = ids.substr(1, ids.length - 1); |
| 142 | var params = {}; | 142 | var params = {}; |
| 143 | params.ids = ids; | 143 | params.ids = ids; |
| 144 | - $.get('/stationroute/batchDestroy',params,function(resuntDate) { | 144 | + $.post('/stationroute/batchDestroy',params,function(resuntDate) { |
| 145 | if (resuntDate.status == 'SUCCESS') { | 145 | if (resuntDate.status == 'SUCCESS') { |
| 146 | // 弹出添加成功提示消息 | 146 | // 弹出添加成功提示消息 |
| 147 | layer.msg('修改成功...'); | 147 | layer.msg('修改成功...'); |
src/main/resources/static/pages/base/stationroute/doublename_road.html
| @@ -32,8 +32,8 @@ | @@ -32,8 +32,8 @@ | ||
| 32 | </form> | 32 | </form> |
| 33 | </div> | 33 | </div> |
| 34 | <div class="modal-footer"> | 34 | <div class="modal-footer"> |
| 35 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 36 | <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button> | 35 | <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button> |
| 36 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 37 | </div> | 37 | </div> |
| 38 | </div> | 38 | </div> |
| 39 | </div> | 39 | </div> |
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | }); | 79 | }); |
| 80 | function closeMobleSetClean() { | 80 | function closeMobleSetClean() { |
| 81 | // 清除地图覆盖物 | 81 | // 清除地图覆盖物 |
| 82 | - map_.clearMarkAndOverlays(); | 82 | + // map_.clearMarkAndOverlays(); |
| 83 | fun.resjtreeDate(lineId,dir); | 83 | fun.resjtreeDate(lineId,dir); |
| 84 | fun.editAChangeCssRemoveDisabled(); | 84 | fun.editAChangeCssRemoveDisabled(); |
| 85 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { | 85 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { |
| @@ -128,12 +128,11 @@ | @@ -128,12 +128,11 @@ | ||
| 128 | params.versions = versions; | 128 | params.versions = versions; |
| 129 | // 生成路段 | 129 | // 生成路段 |
| 130 | $.get('/section/doubleName',params,function (resuntDate) { | 130 | $.get('/section/doubleName',params,function (resuntDate) { |
| 131 | - debugger | ||
| 132 | if(resuntDate.status=='SUCCESS') { | 131 | if(resuntDate.status=='SUCCESS') { |
| 133 | // 弹出添加成功提示消息 | 132 | // 弹出添加成功提示消息 |
| 134 | layer.msg('生成成功...'); | 133 | layer.msg('生成成功...'); |
| 135 | } else if (resuntDate.status=='Failure') { | 134 | } else if (resuntDate.status=='Failure') { |
| 136 | - layer.msg('抱歉,选取的路段太短,无法生成双路段!'); | 135 | + layer.msg('抱歉,您选取的路段基于高德地图的数据无法生成双路段!'); |
| 137 | } else { | 136 | } else { |
| 138 | // 弹出添加失败提示消息 | 137 | // 弹出添加失败提示消息 |
| 139 | layer.msg('生成失败...'); | 138 | layer.msg('生成失败...'); |
| @@ -141,7 +140,7 @@ | @@ -141,7 +140,7 @@ | ||
| 141 | $('#doublename_road_mobal').modal('hide'); | 140 | $('#doublename_road_mobal').modal('hide'); |
| 142 | var dir = params.directions; | 141 | var dir = params.directions; |
| 143 | // 刷行左边树 | 142 | // 刷行左边树 |
| 144 | - fun.resjtreeDate(lineId,dir); | 143 | + // fun.resjtreeDate(lineId,dir); |
| 145 | closeMobleSetClean(); | 144 | closeMobleSetClean(); |
| 146 | }); | 145 | }); |
| 147 | }); | 146 | }); |
src/main/resources/static/pages/base/stationroute/edit.html
| @@ -21,25 +21,19 @@ | @@ -21,25 +21,19 @@ | ||
| 21 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | 21 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 22 | <input type="hidden" name="x" id="xInput" value=""/> | 22 | <input type="hidden" name="x" id="xInput" value=""/> |
| 23 | <input type="hidden" name="y" id="yInput" value=""/> | 23 | <input type="hidden" name="y" id="yInput" value=""/> |
| 24 | + <input type="hidden" name="zdmc" id="zdmcInput"/> | ||
| 25 | + <input type="hidden" name="descriptions" id="descriptionsTextarea" /> | ||
| 26 | + <input type="hidden" name="directions" id="stationdirSelect" /> | ||
| 27 | + | ||
| 28 | + <!-- 站点名称 --> | ||
| 24 | <!-- 站点名称 --> | 29 | <!-- 站点名称 --> |
| 25 | <div class="form-body"> | 30 | <div class="form-body"> |
| 26 | <div class="form-group"> | 31 | <div class="form-group"> |
| 27 | <label class="control-label col-md-3"> | 32 | <label class="control-label col-md-3"> |
| 28 | - <span class="required"> * </span> 站点名称 : | ||
| 29 | - </label> | ||
| 30 | - <div class="col-md-6"> | ||
| 31 | - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly"> | ||
| 32 | - </div> | ||
| 33 | - </div> | ||
| 34 | - </div> | ||
| 35 | - <!-- 站点路由名称 --> | ||
| 36 | - <div class="form-body"> | ||
| 37 | - <div class="form-group"> | ||
| 38 | - <label class="control-label col-md-3"> | ||
| 39 | - <span class="required"> * </span> 站点路由名称: | 33 | + <span class="required"> * </span> 站点名称: |
| 40 | </label> | 34 | </label> |
| 41 | <div class="col-md-6"> | 35 | <div class="col-md-6"> |
| 42 | - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称"> | 36 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称" readonly="readonly"> |
| 43 | </div> | 37 | </div> |
| 44 | </div> | 38 | </div> |
| 45 | </div> | 39 | </div> |
| @@ -54,21 +48,6 @@ | @@ -54,21 +48,6 @@ | ||
| 54 | </div> | 48 | </div> |
| 55 | </div> | 49 | </div> |
| 56 | </div> | 50 | </div> |
| 57 | - <!-- 站点方向 --> | ||
| 58 | - <div class="form-body"> | ||
| 59 | - <div class="form-group"> | ||
| 60 | - <label class="control-label col-md-3"> | ||
| 61 | - <span class="required"> * </span>站点方向 : | ||
| 62 | - </label> | ||
| 63 | - <div class="col-md-6"> | ||
| 64 | - <select name="directions" class="form-control" id="stationdirSelect"> | ||
| 65 | - <option value="">-- 请选择站点类型 --</option> | ||
| 66 | - <option value="0">上行</option> | ||
| 67 | - <option value="1">下行</option> | ||
| 68 | - </select> | ||
| 69 | - </div> | ||
| 70 | - </div> | ||
| 71 | - </div> | ||
| 72 | <!-- 站点序号 --> | 51 | <!-- 站点序号 --> |
| 73 | <div class="form-body"> | 52 | <div class="form-body"> |
| 74 | <div class="form-group"> | 53 | <div class="form-group"> |
| @@ -175,13 +154,6 @@ | @@ -175,13 +154,6 @@ | ||
| 175 | </div> | 154 | </div> |
| 176 | </div> | 155 | </div> |
| 177 | </div> | 156 | </div> |
| 178 | - <!-- 描述/说明 --> | ||
| 179 | - <div class="form-group"> | ||
| 180 | - <label class="control-label col-md-3"> 描述/说明 : </label> | ||
| 181 | - <div class="col-md-6"> | ||
| 182 | - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | ||
| 183 | - </div> | ||
| 184 | - </div> | ||
| 185 | </form> | 157 | </form> |
| 186 | </div> | 158 | </div> |
| 187 | <div class="modal-footer"> | 159 | <div class="modal-footer"> |
| @@ -198,7 +170,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -198,7 +170,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 198 | var editStationParmasObj = station_.getEitdStation(); | 170 | var editStationParmasObj = station_.getEitdStation(); |
| 199 | var addLine = Line_.getLineObj(); | 171 | var addLine = Line_.getLineObj(); |
| 200 | fun.setFormValue(editStationParmasObj); | 172 | fun.setFormValue(editStationParmasObj); |
| 201 | - var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; | 173 | + var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLIneCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRoutedirections}; |
| 202 | initSelect(initzdlyP); | 174 | initSelect(initzdlyP); |
| 203 | // 显示mobal | 175 | // 显示mobal |
| 204 | $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 176 | $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| @@ -217,6 +189,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -217,6 +189,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 217 | ajaxd.getSectionRouteInfo(addLine.id,add_direction_v,function(data) { | 189 | ajaxd.getSectionRouteInfo(addLine.id,add_direction_v,function(data) { |
| 218 | fun.linePanlThree(addLine.id,data,add_direction_v); | 190 | fun.linePanlThree(addLine.id,data,add_direction_v); |
| 219 | }); | 191 | }); |
| 192 | + fun.editMapStatusRemove(); | ||
| 220 | } | 193 | } |
| 221 | // 编辑表单元素 | 194 | // 编辑表单元素 |
| 222 | var form = $('#edit_station_form'); | 195 | var form = $('#edit_station_form'); |
| @@ -283,7 +256,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -283,7 +256,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 283 | var id = addLine.id; | 256 | var id = addLine.id; |
| 284 | var dir = params.directions | 257 | var dir = params.directions |
| 285 | // 刷行左边树 | 258 | // 刷行左边树 |
| 286 | - fun.resjtreeDate(id,dir); | 259 | + // fun.resjtreeDate(id,dir); |
| 287 | closeMobleSetClean(); | 260 | closeMobleSetClean(); |
| 288 | }); | 261 | }); |
| 289 | } | 262 | } |
| @@ -312,7 +285,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -312,7 +285,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 312 | $.each(array, function(i, g){ | 285 | $.each(array, function(i, g){ |
| 313 | // 判断. | 286 | // 判断. |
| 314 | if(g.name!='' || g.name != null) { | 287 | if(g.name!='' || g.name != null) { |
| 315 | - if(g.stationRouteCode != editStationParmasObj.stationRouteStationRouteCode) { | 288 | + if(g.stationRouteCode != editStationParmasObj.stationRouteCode) { |
| 316 | // 添加拼音检索下拉框格式数据数组. | 289 | // 添加拼音检索下拉框格式数据数组. |
| 317 | if(editStationParmasObj.stationRouteStationMark=='E' && i == (len_-2)){ | 290 | if(editStationParmasObj.stationRouteStationMark=='E' && i == (len_-2)){ |
| 318 | paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions, | 291 | paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions, |
| @@ -333,13 +306,13 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -333,13 +306,13 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 333 | }); | 306 | }); |
| 334 | } | 307 | } |
| 335 | function setZdlyValue() { | 308 | function setZdlyValue() { |
| 336 | - ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) { | 309 | + ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRoutedirections,editStationParmasObj.stationRouteCode,function(str) { |
| 337 | if(str.length>0){ | 310 | if(str.length>0){ |
| 338 | var upStationRouteCode; | 311 | var upStationRouteCode; |
| 339 | if (editStationParmasObj.stationRouteStationMark == 'E') { | 312 | if (editStationParmasObj.stationRouteStationMark == 'E') { |
| 340 | - upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + editStationParmasObj.stationRouteDirections; | 313 | + upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + editStationParmasObj.stationRoutedirections; |
| 341 | } else{ | 314 | } else{ |
| 342 | - upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections; | 315 | + upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRoutedirections; |
| 343 | } | 316 | } |
| 344 | $('#stationrouteSelect').select2('val',upStationRouteCode); | 317 | $('#stationrouteSelect').select2('val',upStationRouteCode); |
| 345 | }else { | 318 | }else { |
| @@ -374,5 +347,5 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -374,5 +347,5 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 374 | } | 347 | } |
| 375 | return tel; | 348 | return tel; |
| 376 | }, '方向必须一致!'); | 349 | }, '方向必须一致!'); |
| 377 | -}); | 350 | +}); |
| 378 | </script> | 351 | </script> |
| 379 | \ No newline at end of file | 352 | \ No newline at end of file |
src/main/resources/static/pages/base/stationroute/edit_select.html
| @@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
| 19 | 系统无法生成,请选择其他方式新增 | 19 | 系统无法生成,请选择其他方式新增 |
| 20 | </div> | 20 | </div> |
| 21 | <div class="form-group" id="formRequ"> | 21 | <div class="form-group" id="formRequ"> |
| 22 | - <label class="col-md-3 control-label"><span class="required"> * </span>原始站点名称:</label> | 22 | + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> |
| 23 | <div class="col-md-9" id="errorInfo"> | 23 | <div class="col-md-9" id="errorInfo"> |
| 24 | <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> | 24 | <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> |
| 25 | </div> | 25 | </div> |
| @@ -40,17 +40,14 @@ | @@ -40,17 +40,14 @@ | ||
| 40 | </form> | 40 | </form> |
| 41 | </div> | 41 | </div> |
| 42 | <div class="modal-footer"> | 42 | <div class="modal-footer"> |
| 43 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 44 | <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> | 43 | <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> |
| 44 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 45 | </div> | 45 | </div> |
| 46 | </div> | 46 | </div> |
| 47 | </div> | 47 | </div> |
| 48 | </div> | 48 | </div> |
| 49 | <script type="text/javascript"> | 49 | <script type="text/javascript"> |
| 50 | -$('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,dir_){ | ||
| 51 | - var sel = fun.getCurrSelNode(dir_); | ||
| 52 | - debugger | ||
| 53 | - var Station = sel[0].original; | 50 | +$('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,editStationObj,lineObj,fun,Station){ |
| 54 | // 显示选择修改方式弹出层 | 51 | // 显示选择修改方式弹出层 |
| 55 | $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 52 | $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 56 | setTimeout(function(){ | 53 | setTimeout(function(){ |
| @@ -75,7 +72,7 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | @@ -75,7 +72,7 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | ||
| 75 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | 72 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); |
| 76 | },500); | 73 | },500); |
| 77 | // 获取站点名称元素并赋值 | 74 | // 获取站点名称元素并赋值 |
| 78 | - $('#stationNamebootbox').val(Station.stationStationName); | 75 | + $('#stationNamebootbox').val(Station.stationRouteName); |
| 79 | // 定义站点图形 | 76 | // 定义站点图形 |
| 80 | var stationShapesTypeV = Station.stationShapesType; | 77 | var stationShapesTypeV = Station.stationShapesType; |
| 81 | // 获取表单元素 | 78 | // 获取表单元素 |
| @@ -118,28 +115,25 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | @@ -118,28 +115,25 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | ||
| 118 | var editStationName = params.stationNamebootbox; | 115 | var editStationName = params.stationNamebootbox; |
| 119 | 116 | ||
| 120 | if(params.editselect==0){ | 117 | if(params.editselect==0){ |
| 121 | - $('#downLine').addClass('btn disabled'); | ||
| 122 | - $('.btn-circle').addClass('disabled'); | ||
| 123 | - $('#upLine').addClass('btn disabled'); | ||
| 124 | editStationObj.setEitdStation(Station); | 118 | editStationObj.setEitdStation(Station); |
| 125 | editStationObj.setEitdStationName(editStationName); | 119 | editStationObj.setEitdStationName(editStationName); |
| 126 | 120 | ||
| 127 | - map_.clearMarkAndOverlays(); | 121 | + // map_.clearMarkAndOverlays(); |
| 128 | // 打开绘制工具 | 122 | // 打开绘制工具 |
| 129 | drw.openDrawingManager(); | 123 | drw.openDrawingManager(); |
| 130 | - map_.localtionPoint(editStationName); | 124 | + map_.localtionPoint(editStationName+"公交站点"); |
| 125 | + fun.editMapStatus(); | ||
| 131 | }else if(params.editselect==1){ | 126 | }else if(params.editselect==1){ |
| 132 | - $('#downLine').addClass('btn disabled'); | ||
| 133 | - $('.btn-circle').addClass('disabled'); | ||
| 134 | - $('#upLine').addClass('btn disabled'); | ||
| 135 | editStationObj.setEitdStation(Station); | 127 | editStationObj.setEitdStation(Station); |
| 136 | editStationObj.setEitdStationName(editStationName); | 128 | editStationObj.setEitdStationName(editStationName); |
| 137 | - | 129 | + map_.clearMark(); |
| 138 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | 130 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 139 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | 131 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', |
| 140 | shift: 0,time: 3000}); | 132 | shift: 0,time: 3000}); |
| 141 | // 编辑图形 | 133 | // 编辑图形 |
| 142 | - map_.editShapes(editStationName,stationShapesTypeV,mindex); | 134 | + // map_.editShapes(editStationName,stationShapesTypeV,mindex); |
| 135 | + map_.editShapes(editStationObj); | ||
| 136 | + fun.editMapStatus(); | ||
| 143 | } | 137 | } |
| 144 | } | 138 | } |
| 145 | }); | 139 | }); |
src/main/resources/static/pages/base/stationroute/editsection.html
| @@ -14,12 +14,17 @@ | @@ -14,12 +14,17 @@ | ||
| 14 | <!-- 线路ID --> | 14 | <!-- 线路ID --> |
| 15 | <input type="hidden" name="sectionId" id="sectionIdInput"> | 15 | <input type="hidden" name="sectionId" id="sectionIdInput"> |
| 16 | <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput"> | 16 | <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput"> |
| 17 | + <input type="hidden" name="sectionCode" id="sectionCodeInput"> | ||
| 17 | <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput"> | 18 | <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput"> |
| 18 | <input type="hidden" name="lineCode" id="lineCodeInput"> | 19 | <input type="hidden" name="lineCode" id="lineCodeInput"> |
| 19 | <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> | 20 | <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> |
| 20 | <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/> | 21 | <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/> |
| 21 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | 22 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 22 | <input type="hidden" name="isRoadeSpeed" id="isRoadeSpeedInput"/> | 23 | <input type="hidden" name="isRoadeSpeed" id="isRoadeSpeedInput"/> |
| 24 | + <input type="hidden" name="directions" id="directionsSection"> | ||
| 25 | + <input type="hidden" name="speedLimit" id="speedLimitInput" > | ||
| 26 | + <input type="hidden" name="roadCoding" id="roadCodingCodInput"/> | ||
| 27 | + <input type="hidden" name="versions" id="versionsInput"/> | ||
| 23 | <!-- 路段名称 --> | 28 | <!-- 路段名称 --> |
| 24 | <div class="form-body"> | 29 | <div class="form-body"> |
| 25 | <div class="form-group"> | 30 | <div class="form-group"> |
| @@ -31,17 +36,6 @@ | @@ -31,17 +36,6 @@ | ||
| 31 | </div> | 36 | </div> |
| 32 | </div> | 37 | </div> |
| 33 | </div> | 38 | </div> |
| 34 | - <!-- 路段编码 --> | ||
| 35 | - <div class="form-body"> | ||
| 36 | - <div class="form-group"> | ||
| 37 | - <label class="control-label col-md-3"> | ||
| 38 | - <span class="required"> * </span> 路段编码: | ||
| 39 | - </label> | ||
| 40 | - <div class="col-md-6"> | ||
| 41 | - <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput" placeholder="路段编码" readonly="readonly"> | ||
| 42 | - </div> | ||
| 43 | - </div> | ||
| 44 | - </div> | ||
| 45 | <!-- 路段序号 --> | 39 | <!-- 路段序号 --> |
| 46 | <div class="form-body"> | 40 | <div class="form-body"> |
| 47 | <div class="form-group"> | 41 | <div class="form-group"> |
| @@ -54,103 +48,20 @@ | @@ -54,103 +48,20 @@ | ||
| 54 | </div> | 48 | </div> |
| 55 | </div> | 49 | </div> |
| 56 | </div> | 50 | </div> |
| 57 | - <!-- 路段方向 --> | ||
| 58 | - <div class="form-body"> | ||
| 59 | - <div class="form-group"> | ||
| 60 | - <label class="control-label col-md-3"> | ||
| 61 | - <span class="required"> * </span>路段方向: | ||
| 62 | - </label> | ||
| 63 | - <div class="col-md-6"> | ||
| 64 | - <select name="directions" class="form-control" id="directionsSection"> | ||
| 65 | - <option value="">-- 请选择路段类型 --</option> | ||
| 66 | - <option value="0">上行</option> | ||
| 67 | - <option value="1">下行</option> | ||
| 68 | - </select> | ||
| 69 | - </div> | ||
| 70 | - </div> | ||
| 71 | - </div> | ||
| 72 | - <!-- 路段限速 --> | ||
| 73 | - <div class="form-body"> | ||
| 74 | - <div class="form-group"> | ||
| 75 | - <label class="control-label col-md-3"> | ||
| 76 | - <span class="required"> * </span> 路段限速: | ||
| 77 | - </label> | ||
| 78 | - <div class="col-md-6"> | ||
| 79 | - <input type="text" class="form-control" name="speedLimit" id="speedLimitInput" placeholder="路段限速"> | ||
| 80 | - </div> | ||
| 81 | - </div> | ||
| 82 | - </div> | ||
| 83 | - <!-- 是否撤销 --> | ||
| 84 | - <div class="form-body"> | ||
| 85 | - <div class="form-group"> | ||
| 86 | - <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销:</label> | ||
| 87 | - <div class="col-md-6"> | ||
| 88 | - <select name="destroy" class="form-control" id="destroySelect"> | ||
| 89 | - <option value="">-- 请选择撤销类型 --</option> | ||
| 90 | - <option value="0">否</option> | ||
| 91 | - <option value="1">是</option> | ||
| 92 | - </select> | ||
| 93 | - </div> | ||
| 94 | - </div> | ||
| 95 | - </div> | ||
| 96 | - <!-- 道路编码--> | ||
| 97 | - <div class="form-body"> | ||
| 98 | - <div class="form-group"> | ||
| 99 | - <label class="control-label col-md-3">道路编码:</label> | ||
| 100 | - <div class="col-md-6"> | ||
| 101 | - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码"> | ||
| 102 | - </div> | ||
| 103 | - </div> | ||
| 104 | - </div> | ||
| 105 | - <!-- 路段长度 --> | ||
| 106 | - <div class="form-body"> | ||
| 107 | - <div class="form-group"> | ||
| 108 | - <label class="col-md-3 control-label">路段长度:</label> | ||
| 109 | - <div class="col-md-6"> | ||
| 110 | - <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" placeholder="路段长度"> | ||
| 111 | - <span class="help-block">单位:公里(km)</span> | ||
| 112 | - </div> | ||
| 113 | - </div> | ||
| 114 | - </div> | ||
| 115 | - <!-- 路段历时 --> | ||
| 116 | - <div class="form-body"> | ||
| 117 | - <div class="form-group"> | ||
| 118 | - <label class="col-md-3 control-label">路段历时:</label> | ||
| 119 | - <div class="col-md-6"> | ||
| 120 | - <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" placeholder="路段历时"> | ||
| 121 | - <span class="help-block">单位:分钟(min)</span> | ||
| 122 | - </div> | ||
| 123 | - </div> | ||
| 124 | - </div> | ||
| 125 | - <!-- 版本号 --> | ||
| 126 | - <div class="form-body"> | ||
| 127 | - <div class="form-group"> | ||
| 128 | - <label class="col-md-3 control-label">版本号 :</label> | ||
| 129 | - <div class="col-md-6"> | ||
| 130 | - <input type="text" class="form-control" name="versions" id="versionsInput" Readonly> | ||
| 131 | - </div> | ||
| 132 | - </div> | ||
| 133 | - </div> | ||
| 134 | - <!-- 描述/说明 --> | ||
| 135 | - <div class="form-group"> | ||
| 136 | - <label class="control-label col-md-3"> 描述/说明: </label> | ||
| 137 | - <div class="col-md-6"> | ||
| 138 | - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | ||
| 139 | - </div> | ||
| 140 | - </div> | 51 | + |
| 141 | </form> | 52 | </form> |
| 142 | </div> | 53 | </div> |
| 143 | <div class="modal-footer"> | 54 | <div class="modal-footer"> |
| 144 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 145 | <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button> | 55 | <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button> |
| 56 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 146 | </div> | 57 | </div> |
| 147 | </div> | 58 | </div> |
| 148 | </div> | 59 | </div> |
| 149 | </div> | 60 | </div> |
| 150 | <script type="text/javascript"> | 61 | <script type="text/javascript"> |
| 151 | 62 | ||
| 152 | -$('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){ | ||
| 153 | - var Section = section.getEitdSection(); | 63 | +$('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,p,fun){ |
| 64 | + var Section = p.data; | ||
| 154 | fun.setSectionFormValue(Section); | 65 | fun.setSectionFormValue(Section); |
| 155 | // 方向 | 66 | // 方向 |
| 156 | var dir = Section.sectionrouteDirections; | 67 | var dir = Section.sectionrouteDirections; |
| @@ -159,15 +70,6 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -159,15 +70,6 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 159 | ajaxd.getStation(lineId,dir,function(treeData) { | 70 | ajaxd.getStation(lineId,dir,function(treeData) { |
| 160 | var array = treeData[0].children[1].children,paramsD =new Array(); | 71 | var array = treeData[0].children[1].children,paramsD =new Array(); |
| 161 | var eq_scetionRouteCode = Section.sectionrouteCode; | 72 | var eq_scetionRouteCode = Section.sectionrouteCode; |
| 162 | - /* for(var i = 0 ; i<dArray.length; i++){ | ||
| 163 | - var ptions_v = dArray[i].sectionrouteCode; | ||
| 164 | - if(eq_scetionRouteCode == ptions_v){ | ||
| 165 | - continue; | ||
| 166 | - } | ||
| 167 | - options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName + ' (' + ptions_v +')' | ||
| 168 | - + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ; | ||
| 169 | - } | ||
| 170 | - $('#sectionrouteCodeSelect').html(options); */ | ||
| 171 | paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'}); | 73 | paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'}); |
| 172 | // 遍历. | 74 | // 遍历. |
| 173 | $.each(array, function(i, g){ | 75 | $.each(array, function(i, g){ |
| @@ -195,16 +97,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -195,16 +97,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 195 | }); | 97 | }); |
| 196 | }); | 98 | }); |
| 197 | // 显示mobal | 99 | // 显示mobal |
| 198 | - $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 100 | + $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});// |
| 199 | // 当调用 hide 实例方法时触发 | 101 | // 当调用 hide 实例方法时触发 |
| 200 | $('#edit_section_mobal').on('hide.bs.modal', function () { | 102 | $('#edit_section_mobal').on('hide.bs.modal', function () { |
| 201 | closeMobleSetClean(); | 103 | closeMobleSetClean(); |
| 202 | }); | 104 | }); |
| 203 | function closeMobleSetClean() { | 105 | function closeMobleSetClean() { |
| 204 | - // 清除地图覆盖物 | ||
| 205 | - map_.clearMarkAndOverlays(); | ||
| 206 | - /** 设置修改路段集合对象为空 */ | ||
| 207 | - section.setEitdSection({}); | 106 | + // 清除地图覆盖物 |
| 107 | + map_.clearMarkAndOverlays(); | ||
| 208 | fun.resjtreeDate(lineId,dir); | 108 | fun.resjtreeDate(lineId,dir); |
| 209 | fun.editAChangeCssRemoveDisabled(); | 109 | fun.editAChangeCssRemoveDisabled(); |
| 210 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { | 110 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { |
| @@ -227,14 +127,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -227,14 +127,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 227 | focusInvalid : false, | 127 | focusInvalid : false, |
| 228 | rules : { | 128 | rules : { |
| 229 | 'sectionName' : {required : true,maxlength:50},// 路段名称 必填项 | 129 | 'sectionName' : {required : true,maxlength:50},// 路段名称 必填项 |
| 230 | - 'sectionCode': {required : true,},// 路段编码 必填项 | 130 | + /*'sectionCode': {required : true,},// 路段编码 必填项 |
| 231 | 'directions' : {required : true,},// 路段方向 必填项 | 131 | 'directions' : {required : true,},// 路段方向 必填项 |
| 232 | 'speedLimit' : {required : true,number : true},// 路段限速 必须输入合法的数字(负数,小数)。 | 132 | 'speedLimit' : {required : true,number : true},// 路段限速 必须输入合法的数字(负数,小数)。 |
| 233 | 'destroy' : {required : true,},// 是否撤销 必填项. | 133 | 'destroy' : {required : true,},// 是否撤销 必填项. |
| 234 | 'roadCoding' : {number : true},// 道路编码 必须输入合法的数字(负数,小数)。 | 134 | 'roadCoding' : {number : true},// 道路编码 必须输入合法的数字(负数,小数)。 |
| 235 | 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。 | 135 | 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。 |
| 236 | 'sectionDistance' : {number : true},// 路段长度 必须输入合法的数字(负数,小数)。 | 136 | 'sectionDistance' : {number : true},// 路段长度 必须输入合法的数字(负数,小数)。 |
| 237 | - 'descriptions' : {maxlength: 150}// 描述与说明 最大长度. | 137 | + 'descriptions' : {maxlength: 150}// 描述与说明 最大长度.*/ |
| 238 | }, | 138 | }, |
| 239 | invalidHandler : function(event, validator) { | 139 | invalidHandler : function(event, validator) { |
| 240 | error.show(); | 140 | error.show(); |
| @@ -250,7 +150,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -250,7 +150,14 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 250 | label.closest('.form-group').removeClass('has-error'); | 150 | label.closest('.form-group').removeClass('has-error'); |
| 251 | }, | 151 | }, |
| 252 | submitHandler : function(f) { | 152 | submitHandler : function(f) { |
| 153 | + // 获取折线坐标集合 | ||
| 154 | + var editPloyLineArray = p.getPath(); | ||
| 155 | + // 折线坐标集合 | ||
| 156 | + $('#bsectionVectorInput').val(JSON.stringify(editPloyLineArray)); | ||
| 253 | var params = form.serializeJSON(); | 157 | var params = form.serializeJSON(); |
| 158 | + params.destroy=0; | ||
| 159 | + params.sectionDistance=0; | ||
| 160 | + params.sectionTime=0; | ||
| 254 | error.hide(); | 161 | error.hide(); |
| 255 | if(params.sectionrouteCode=='请选择...') | 162 | if(params.sectionrouteCode=='请选择...') |
| 256 | params.sectionrouteCode=''; | 163 | params.sectionrouteCode=''; |
| @@ -264,8 +171,6 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -264,8 +171,6 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 264 | } | 171 | } |
| 265 | $('#edit_section_mobal').modal('hide'); | 172 | $('#edit_section_mobal').modal('hide'); |
| 266 | var dir = params.directions | 173 | var dir = params.directions |
| 267 | - // 刷行左边树 | ||
| 268 | - fun.resjtreeDate(lineId,dir); | ||
| 269 | closeMobleSetClean(); | 174 | closeMobleSetClean(); |
| 270 | }); | 175 | }); |
| 271 | } | 176 | } |
src/main/resources/static/pages/base/stationroute/js/addstationobj.js
| @@ -31,7 +31,7 @@ var AddStationObj = function () { | @@ -31,7 +31,7 @@ var AddStationObj = function () { | ||
| 31 | }, | 31 | }, |
| 32 | 32 | ||
| 33 | /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | 33 | /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ |
| 34 | - setAddStationBJwpoints : function(bJwpoints) { | 34 | + setAddStationJwpoints : function(bJwpoints) { |
| 35 | 35 | ||
| 36 | station.bJwpoints = bJwpoints; | 36 | station.bJwpoints = bJwpoints; |
| 37 | }, | 37 | }, |
src/main/resources/static/pages/base/stationroute/js/drawingManager.js
| @@ -68,7 +68,7 @@ var DrawingManagerObj = function () { | @@ -68,7 +68,7 @@ var DrawingManagerObj = function () { | ||
| 68 | 68 | ||
| 69 | var pointE = e; | 69 | var pointE = e; |
| 70 | 70 | ||
| 71 | - // 多变行质心点 | 71 | + // 多边行中心点 |
| 72 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | 72 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; |
| 73 | 73 | ||
| 74 | var addPolyGonLen_ = pointE.getPath().length; | 74 | var addPolyGonLen_ = pointE.getPath().length; |
| @@ -96,7 +96,7 @@ var DrawingManagerObj = function () { | @@ -96,7 +96,7 @@ var DrawingManagerObj = function () { | ||
| 96 | if(!$.isEmptyObject(add)){ | 96 | if(!$.isEmptyObject(add)){ |
| 97 | 97 | ||
| 98 | /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | 98 | /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ |
| 99 | - AddStationObj.setAddStationBJwpoints(addSttationPoints_); | 99 | + AddStationObj.setAddStationJwpoints(addSttationPoints_); |
| 100 | 100 | ||
| 101 | /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | 101 | /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ |
| 102 | AddStationObj.setAddStationShapesType('d'); | 102 | AddStationObj.setAddStationShapesType('d'); |
| @@ -119,7 +119,7 @@ var DrawingManagerObj = function () { | @@ -119,7 +119,7 @@ var DrawingManagerObj = function () { | ||
| 119 | if(!$.isEmptyObject(edit)){ | 119 | if(!$.isEmptyObject(edit)){ |
| 120 | 120 | ||
| 121 | /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | 121 | /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ |
| 122 | - EditStationObj.setEitdStationBJwpoints(addSttationPoints_); | 122 | + EditStationObj.setEitdStationJwpoints(addSttationPoints_); |
| 123 | 123 | ||
| 124 | /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | 124 | /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ |
| 125 | EditStationObj.setEitdStationShapesType('d'); | 125 | EditStationObj.setEitdStationShapesType('d'); |
src/main/resources/static/pages/base/stationroute/js/editstationobj.js
| @@ -31,9 +31,9 @@ var EditStationObj = function () { | @@ -31,9 +31,9 @@ var EditStationObj = function () { | ||
| 31 | }, | 31 | }, |
| 32 | 32 | ||
| 33 | /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | 33 | /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ |
| 34 | - setEitdStationBJwpoints : function(bJwpoints) { | 34 | + setEitdStationJwpoints : function(bJwpoints) { |
| 35 | 35 | ||
| 36 | - station.stationBJwpoints = bJwpoints; | 36 | + station.stationJwpoints = bJwpoints; |
| 37 | }, | 37 | }, |
| 38 | 38 | ||
| 39 | /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | 39 | /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ |
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
| @@ -18,7 +18,9 @@ | @@ -18,7 +18,9 @@ | ||
| 18 | * - - - - - -》 stationRouteIsDestroy:撤销站点 | 18 | * - - - - - -》 stationRouteIsDestroy:撤销站点 |
| 19 | * | 19 | * |
| 20 | * - - - - - -》 sectionUpdate : 编辑线路走向保存 | 20 | * - - - - - -》 sectionUpdate : 编辑线路走向保存 |
| 21 | - * | 21 | + * |
| 22 | + * - - - - - -》 sectionSave : 生成线路走向 | ||
| 23 | + * | ||
| 22 | * - - - - - -》 getIdLineName:获取线路名称 | 24 | * - - - - - -》 getIdLineName:获取线路名称 |
| 23 | * | 25 | * |
| 24 | * - - - - - -》 getSectionRouteInfo:查询路段信息 | 26 | * - - - - - -》 getSectionRouteInfo:查询路段信息 |
| @@ -54,7 +56,7 @@ var GetAjaxData = function(){ | @@ -54,7 +56,7 @@ var GetAjaxData = function(){ | ||
| 54 | }, | 56 | }, |
| 55 | // 查询线路某方向下所有站点的中心百度坐标 | 57 | // 查询线路某方向下所有站点的中心百度坐标 |
| 56 | getStationRoutePoint : function(id_,dir_,callback) { | 58 | getStationRoutePoint : function(id_,dir_,callback) { |
| 57 | - $get('/stationroute/getStationRouteCenterPoints',{lineId:id_,direction:dir_},function(result) { | 59 | + $get('/stationroute/getStationRouteList',{lineId:id_,direction:dir_},function(result) { |
| 58 | callback && callback(result); | 60 | callback && callback(result); |
| 59 | }); | 61 | }); |
| 60 | }, | 62 | }, |
| @@ -65,7 +67,7 @@ var GetAjaxData = function(){ | @@ -65,7 +67,7 @@ var GetAjaxData = function(){ | ||
| 65 | callback && callback(array); | 67 | callback && callback(array); |
| 66 | }); | 68 | }); |
| 67 | }, | 69 | }, |
| 68 | - | 70 | + |
| 69 | // 查询站点编码 | 71 | // 查询站点编码 |
| 70 | getStationCode : function(callback) { | 72 | getStationCode : function(callback) { |
| 71 | $get('/station/getStationCode',null,function(stationCode) { | 73 | $get('/station/getStationCode',null,function(stationCode) { |
| @@ -74,6 +76,12 @@ var GetAjaxData = function(){ | @@ -74,6 +76,12 @@ var GetAjaxData = function(){ | ||
| 74 | } | 76 | } |
| 75 | }); | 77 | }); |
| 76 | }, | 78 | }, |
| 79 | + // 查询路段编码 | ||
| 80 | + getSectionCode : function(callback) { | ||
| 81 | + $get('/section/getSectionCode',null,function(sectionCode) { | ||
| 82 | + callback && callback(sectionCode); | ||
| 83 | + }); | ||
| 84 | + }, | ||
| 77 | findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) { | 85 | findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) { |
| 78 | $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) { | 86 | $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) { |
| 79 | callback && callback(result); | 87 | callback && callback(result); |
| @@ -110,15 +118,17 @@ var GetAjaxData = function(){ | @@ -110,15 +118,17 @@ var GetAjaxData = function(){ | ||
| 110 | 118 | ||
| 111 | // 编辑线路走向保存 | 119 | // 编辑线路走向保存 |
| 112 | sectionUpdate:function(section,callback) { | 120 | sectionUpdate:function(section,callback) { |
| 113 | - | ||
| 114 | $post('/section/sectionUpdate',section,function(data) { | 121 | $post('/section/sectionUpdate',section,function(data) { |
| 115 | - | ||
| 116 | callback && callback(data); | 122 | callback && callback(data); |
| 117 | - | ||
| 118 | }) | 123 | }) |
| 119 | - | ||
| 120 | }, | 124 | }, |
| 121 | - | 125 | + // 生成线路走向 |
| 126 | + sectionSave:function(section,callback){ | ||
| 127 | + $post('/section/sectionSave',section,function(data) { | ||
| 128 | + callback && callback(data); | ||
| 129 | + }) | ||
| 130 | + }, | ||
| 131 | + | ||
| 122 | // 获取线路名称 | 132 | // 获取线路名称 |
| 123 | getIdLineName : function (id,callback) { | 133 | getIdLineName : function (id,callback) { |
| 124 | 134 | ||
| @@ -143,6 +153,12 @@ var GetAjaxData = function(){ | @@ -143,6 +153,12 @@ var GetAjaxData = function(){ | ||
| 143 | callback && callback(resultdata); | 153 | callback && callback(resultdata); |
| 144 | }); | 154 | }); |
| 145 | }, | 155 | }, |
| 156 | + // 根据ID查询路段信息. | ||
| 157 | + getSectionRouteInfoById : function(sectionRouteId,callback){ | ||
| 158 | + $get('/sectionroute/findSectionRouteInfoFormId',{id:sectionRouteId},function(r) { | ||
| 159 | + return callback && callback(r); | ||
| 160 | + }); | ||
| 161 | + }, | ||
| 146 | 162 | ||
| 147 | // 手动规划线路保存 | 163 | // 手动规划线路保存 |
| 148 | manualSave : function(params,callback) { | 164 | manualSave : function(params,callback) { |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
| @@ -97,7 +97,6 @@ $(function(){ | @@ -97,7 +97,6 @@ $(function(){ | ||
| 97 | WorldsBMap.clearMarkAndOverlays(); | 97 | WorldsBMap.clearMarkAndOverlays(); |
| 98 | // 刷新左边树 | 98 | // 刷新左边树 |
| 99 | PublicFunctions.resjtreeDate(Line.id,0); | 99 | PublicFunctions.resjtreeDate(Line.id,0); |
| 100 | - PublicFunctions.resjtreeDate(Line.id,1); | ||
| 101 | /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | 100 | /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ |
| 102 | GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) { | 101 | GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) { |
| 103 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | 102 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| @@ -26,548 +26,529 @@ | @@ -26,548 +26,529 @@ | ||
| 26 | 26 | ||
| 27 | var PublicFunctions = function () { | 27 | var PublicFunctions = function () { |
| 28 | var PubFun = { | 28 | var PubFun = { |
| 29 | - /** 初始化线路标题与ID */ | ||
| 30 | - setTiteText : function(lineId) { | ||
| 31 | - // 根据线路ID获取线路名称 | ||
| 32 | - GetAjaxData.getIdLineName(lineId,function(data) { | ||
| 33 | - // 定义线路名称 | ||
| 34 | - var lineNameV = data.name; | ||
| 35 | - $('.portlet-title .caption').text(lineNameV); | ||
| 36 | - }); | ||
| 37 | - }, | ||
| 38 | - /** @param diraction 方向 @return array */ | ||
| 39 | - getCurrSelNode : function(diraction){ | ||
| 40 | - // 定义Obj | ||
| 41 | - var array = []; | ||
| 42 | - try { | 29 | + /** 初始化线路标题与ID */ |
| 30 | + setTiteText : function(lineId) { | ||
| 31 | + // 根据线路ID获取线路名称 | ||
| 32 | + GetAjaxData.getIdLineName(lineId,function(data) { | ||
| 33 | + // 定义线路名称 | ||
| 34 | + var lineNameV = data.name; | ||
| 35 | + $('.portlet-title .caption').text(lineNameV); | ||
| 36 | + }); | ||
| 37 | + }, | ||
| 38 | + /** @param diraction 方向 @return array */ | ||
| 39 | + getCurrSelNode : function(diraction){ | ||
| 40 | + // 定义Obj | ||
| 41 | + var array = []; | ||
| 42 | + try { | ||
| 43 | + // 上行 | ||
| 44 | + if(diraction=='0'){ | ||
| 45 | + // 获取上行选中节点 | ||
| 46 | + array = $.jstree.reference("#station_Up_tree").get_selected(true); | ||
| 47 | + // 下行 | ||
| 48 | + }else if(diraction=='1'){ | ||
| 49 | + // 获取下行选中节点 | ||
| 50 | + array = $.jstree.reference("#station_Down_tree").get_selected(true); | ||
| 51 | + } | ||
| 52 | + } catch (e) { | ||
| 53 | + console.log(e); | ||
| 54 | + } | ||
| 55 | + // 返回Obj | ||
| 56 | + return array; | ||
| 57 | + }, | ||
| 58 | + /** @param id:线路ID ;directionData:方向 */ | ||
| 59 | + resjtreeDate : function(id,directionData){ | ||
| 60 | + // 获取树数据 | ||
| 61 | + GetAjaxData.getStation(id,directionData,function(treeDateJson) { | ||
| 62 | + // 获取数据长度 | ||
| 63 | + var len = treeDateJson[0].children[0].children.length; | ||
| 64 | + // 上行 | ||
| 65 | + if(directionData==0){ | ||
| 66 | + // 长度大于零 | ||
| 67 | + if(len>0) { | ||
| 68 | + // 隐藏上行规划 | ||
| 69 | + $('#upToolsMobal').hide(); | ||
| 70 | + // 显示树 | ||
| 71 | + $('#uptreeMobal').show(); | ||
| 72 | + // 刷新树 | ||
| 73 | + StationTreeData.upreloadeTree(treeDateJson); | ||
| 74 | + }else { | ||
| 75 | + // 显示上行规划 | ||
| 76 | + $('#upToolsMobal').show(); | ||
| 77 | + // 隐藏上行树 | ||
| 78 | + $('#uptreeMobal').hide(); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + // 下行 | ||
| 82 | + }else if(directionData==1){ | ||
| 83 | + // 如果长度大于 | ||
| 84 | + if(len>0) { | ||
| 85 | + // 隐藏下行规划 | ||
| 86 | + $('#downToolsMobal').hide(); | ||
| 87 | + // 显示下行树 | ||
| 88 | + $('#DowntreeMobal').show(); | ||
| 89 | + // 跟新树 | ||
| 90 | + StationTreeData.dwonreloadeTree(treeDateJson); | ||
| 91 | + }else { | ||
| 92 | + // 显示下行规划 | ||
| 93 | + $('#downToolsMobal').show(); | ||
| 94 | + // 隐藏下行树 | ||
| 95 | + $('#DowntreeMobal').hide(); | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + }); | ||
| 99 | + }, | ||
| 100 | + | ||
| 101 | + /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */ | ||
| 102 | + lineNameIsHaveInterval : function(directionData) { | ||
| 103 | + // 定义线路名称 | ||
| 104 | + var lineNameV = $('.portlet-title .caption').text(); | ||
| 105 | + // 线路名称是否为区间线路 | ||
| 106 | + if(lineNameV.indexOf('区间')>0){ | ||
| 107 | + // 截去区间 | ||
| 108 | + var lineNameNew = lineNameV.replace('区间',''); | ||
| 109 | + // 是否继续弹出层 | ||
| 110 | + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 111 | + btn : [ '确认提示并提交', '取消' ] | ||
| 112 | + }, function(index) { | ||
| 113 | + // 关闭弹出层 | ||
| 114 | + layer.close(index); | ||
| 115 | + // 线路名称去掉区间 | ||
| 116 | + lineNameV = lineNameNew; | ||
| 117 | + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 118 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 119 | + },function(){ | ||
| 120 | + // 关闭弹出层 | ||
| 121 | + layer.closeAll(); | ||
| 43 | // 上行 | 122 | // 上行 |
| 44 | - if(diraction=='0'){ | ||
| 45 | - // 获取上行选中节点 | ||
| 46 | - array = $.jstree.reference("#station_Up_tree").get_selected(true); | 123 | + if(directionData==0){ |
| 124 | + // 显示上行规划 | ||
| 125 | + $('#upToolsMobal').show(); | ||
| 47 | // 下行 | 126 | // 下行 |
| 48 | - }else if(diraction=='1'){ | ||
| 49 | - // 获取下行选中节点 | ||
| 50 | - array = $.jstree.reference("#station_Down_tree").get_selected(true); | 127 | + }else if(directionData==1){ |
| 128 | + // 显示下行规划 | ||
| 129 | + $('#downToolsMobal').show(); | ||
| 51 | } | 130 | } |
| 52 | - } catch (e) { | ||
| 53 | - console.log(e); | ||
| 54 | - } | ||
| 55 | - // 返回Obj | ||
| 56 | - return array; | ||
| 57 | - }, | ||
| 58 | - /** @param id:线路ID ;directionData:方向 */ | ||
| 59 | - resjtreeDate : function(id,directionData){ | ||
| 60 | - // 获取树数据 | ||
| 61 | - GetAjaxData.getStation(id,directionData,function(treeDateJson) { | ||
| 62 | - // 获取数据长度 | ||
| 63 | - var len = treeDateJson[0].children[0].children.length; | 131 | + }); |
| 132 | + | ||
| 133 | + // 线路名称是否为定班线路 | ||
| 134 | + }else if(lineNameV.indexOf('定班')>0){ | ||
| 135 | + // 截去定班 | ||
| 136 | + var lineNameNew = lineNameV.replace('定班',''); | ||
| 137 | + // 是否继续弹出层 | ||
| 138 | + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 139 | + btn : [ '确认提示并提交', '取消' ] | ||
| 140 | + }, function(index) { | ||
| 141 | + // 关闭弹出层 | ||
| 142 | + layer.close(index); | ||
| 143 | + // 线路名称去掉区间 | ||
| 144 | + lineNameV = lineNameNew; | ||
| 145 | + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 146 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 147 | + },function(){ | ||
| 148 | + // 关闭弹出层 | ||
| 149 | + layer.closeAll(); | ||
| 64 | // 上行 | 150 | // 上行 |
| 65 | if(directionData==0){ | 151 | if(directionData==0){ |
| 66 | - // 长度大于零 | ||
| 67 | - if(len>0) { | ||
| 68 | - // 隐藏上行规划 | ||
| 69 | - $('#upToolsMobal').hide(); | ||
| 70 | - // 显示树 | ||
| 71 | - $('#uptreeMobal').show(); | ||
| 72 | - // 刷新树 | ||
| 73 | - StationTreeData.upreloadeTree(treeDateJson); | ||
| 74 | - }else { | ||
| 75 | - // 显示上行规划 | ||
| 76 | - $('#upToolsMobal').show(); | ||
| 77 | - // 隐藏上行树 | ||
| 78 | - $('#uptreeMobal').hide(); | ||
| 79 | - } | ||
| 80 | - | 152 | + // 显示上行规划 |
| 153 | + $('#upToolsMobal').show(); | ||
| 81 | // 下行 | 154 | // 下行 |
| 82 | }else if(directionData==1){ | 155 | }else if(directionData==1){ |
| 83 | - // 如果长度大于 | ||
| 84 | - if(len>0) { | ||
| 85 | - // 隐藏下行规划 | ||
| 86 | - $('#downToolsMobal').hide(); | ||
| 87 | - // 显示下行树 | ||
| 88 | - $('#DowntreeMobal').show(); | ||
| 89 | - // 跟新树 | ||
| 90 | - StationTreeData.dwonreloadeTree(treeDateJson); | ||
| 91 | - }else { | ||
| 92 | - // 显示下行规划 | ||
| 93 | - $('#downToolsMobal').show(); | ||
| 94 | - // 隐藏下行树 | ||
| 95 | - $('#DowntreeMobal').hide(); | ||
| 96 | - } | 156 | + // 显示下行规划 |
| 157 | + $('#downToolsMobal').show(); | ||
| 97 | } | 158 | } |
| 98 | }); | 159 | }); |
| 99 | - }, | ||
| 100 | - | ||
| 101 | - /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */ | ||
| 102 | - lineNameIsHaveInterval : function(directionData) { | ||
| 103 | - // 定义线路名称 | ||
| 104 | - var lineNameV = $('.portlet-title .caption').text(); | ||
| 105 | - // 线路名称是否为区间线路 | ||
| 106 | - if(lineNameV.indexOf('区间')>0){ | ||
| 107 | - // 截去区间 | ||
| 108 | - var lineNameNew = lineNameV.replace('区间',''); | ||
| 109 | - // 是否继续弹出层 | ||
| 110 | - layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 111 | - btn : [ '确认提示并提交', '取消' ] | ||
| 112 | - }, function(index) { | ||
| 113 | - // 关闭弹出层 | ||
| 114 | - layer.close(index); | ||
| 115 | - // 线路名称去掉区间 | ||
| 116 | - lineNameV = lineNameNew; | ||
| 117 | - /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 118 | - PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 119 | - },function(){ | ||
| 120 | - // 关闭弹出层 | ||
| 121 | - layer.closeAll(); | ||
| 122 | - // 上行 | ||
| 123 | - if(directionData==0){ | ||
| 124 | - // 显示上行规划 | ||
| 125 | - $('#upToolsMobal').show(); | ||
| 126 | - // 下行 | ||
| 127 | - }else if(directionData==1){ | ||
| 128 | - // 显示下行规划 | ||
| 129 | - $('#downToolsMobal').show(); | ||
| 130 | - } | 160 | + }else { |
| 161 | + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 162 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + }, | ||
| 166 | + | ||
| 167 | + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 168 | + systemLineStation : function(lineNameV,directionData) { | ||
| 169 | + /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/ | ||
| 170 | + WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){ | ||
| 171 | + // 如果线路信息不为空 | ||
| 172 | + if(BusLine) { | ||
| 173 | + // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 | ||
| 174 | + var Polygon = BusLine.getPolyline(); | ||
| 175 | + // 返回多边型的点数组(自1.2新增) | ||
| 176 | + var polyGonArray = Polygon.getPath(); | ||
| 177 | + // 获取公交站点个数(自 1.2 新增) | ||
| 178 | + var stationNumber = BusLine.getNumBusStations(); | ||
| 179 | + // 定义线路信息集合 | ||
| 180 | + var stationInfo = []; | ||
| 181 | + // 遍历 | ||
| 182 | + for(var k = 0 ; k < stationNumber; k++) { | ||
| 183 | + // 定义线路信息集合 | ||
| 184 | + var tempM = {}; | ||
| 185 | + // 添加站点名称 | ||
| 186 | + tempM.name = BusLine.getBusStation(k).name; | ||
| 187 | + // 添加站点坐标 | ||
| 188 | + tempM.potion = BusLine.getBusStation(k).position; | ||
| 189 | + tempM.wgs = {x:'',y:''}; | ||
| 190 | + // 添加 | ||
| 191 | + stationInfo.push(tempM); | ||
| 192 | + } | ||
| 193 | + // 获取站点之间的距离与时间 | ||
| 194 | + WorldsBMap.getDistanceAndDuration(stationInfo,function(json) { | ||
| 195 | + // 设置第一个站的距离 | ||
| 196 | + json[0].distance = ''; | ||
| 197 | + // 设置第一个站的时间 | ||
| 198 | + json[0].duration = ''; | ||
| 199 | + // 定义站点信息JSON字符串 | ||
| 200 | + var stationJSON = JSON.stringify(json); | ||
| 201 | + // 定义路段信息字符串 | ||
| 202 | + var sectionJSON = JSON.stringify(polyGonArray); | ||
| 203 | + // 参数集合 | ||
| 204 | + var params = {}; | ||
| 205 | + // 站点信息JSON字符串 | ||
| 206 | + params.stationJSON = stationJSON; | ||
| 207 | + var addLine = LineObj.getLineObj(); | ||
| 208 | + // 线路ID | ||
| 209 | + params.lineId = addLine.id; | ||
| 210 | + // 方向 | ||
| 211 | + params.directions = directionData; | ||
| 212 | + // 原始坐标类型 | ||
| 213 | + params.dbType = 'b'; | ||
| 214 | + // 圆形半径 | ||
| 215 | + params.radius = '100'; | ||
| 216 | + // 图形类型(r:圆形;p:多边形) | ||
| 217 | + params.shapesType = 'r'; | ||
| 218 | + // destroy:是否撤销 | ||
| 219 | + params.destroy = '0'; | ||
| 220 | + | ||
| 221 | + // 路段信息JSON字符串 | ||
| 222 | + params.sectionJSON = sectionJSON; | ||
| 223 | + // 限速 | ||
| 224 | + params.speedLimit = '60'; | ||
| 225 | + params.baseRes = 'No'; | ||
| 226 | + // 获取版本号后提交添加 | ||
| 227 | + $.get('/lineVersions/findByLineId',{'lineId':addLine.id},function(lineVersions){ | ||
| 228 | + $.each(lineVersions,function(){ | ||
| 229 | + if (this.status == 1) { | ||
| 230 | + // versions:版本号 | ||
| 231 | + params.versions = this.versions; | ||
| 232 | + // 保存 | ||
| 233 | + GetAjaxData.collectionSave(params,function(rd) { | ||
| 234 | + if(rd.status='SUCCESS') { | ||
| 235 | + // 关闭弹出层 | ||
| 236 | + layer.closeAll(); | ||
| 237 | + layer.msg('保存成功!'); | ||
| 238 | + }else { | ||
| 239 | + // 保存失败 | ||
| 240 | + layer.msg('保存失败!'); | ||
| 241 | + } | ||
| 242 | + // 刷新树 | ||
| 243 | + PublicFunctions.resjtreeDate(addLine.id,directionData); | ||
| 244 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 245 | + GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) { | ||
| 246 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 247 | + PublicFunctions.linePanlThree(addLine.id,data,directionData); | ||
| 248 | + }); | ||
| 249 | + }); | ||
| 250 | + } | ||
| 251 | + }) | ||
| 252 | + }); | ||
| 131 | }); | 253 | }); |
| 132 | - | ||
| 133 | - // 线路名称是否为定班线路 | ||
| 134 | - }else if(lineNameV.indexOf('定班')>0){ | ||
| 135 | - // 截去定班 | ||
| 136 | - var lineNameNew = lineNameV.replace('定班',''); | ||
| 137 | - // 是否继续弹出层 | ||
| 138 | - layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 139 | - btn : [ '确认提示并提交', '取消' ] | ||
| 140 | - }, function(index) { | ||
| 141 | - // 关闭弹出层 | ||
| 142 | - layer.close(index); | ||
| 143 | - // 线路名称去掉区间 | ||
| 144 | - lineNameV = lineNameNew; | ||
| 145 | - /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 146 | - PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 147 | - },function(){ | 254 | + // 关闭弹出层 |
| 255 | + layer.closeAll(); | ||
| 256 | + // 上行 | ||
| 257 | + if(directionData==0){ | ||
| 258 | + $('#stationDown').removeClass('active'); | ||
| 259 | + $('#stationDown').removeClass('in'); | ||
| 260 | + $('#stationDown').addClass('fade'); | ||
| 261 | + $('#stationUp').addClass('active in'); | ||
| 262 | + $('#downLine').parent().removeClass('active'); | ||
| 263 | + $('#upLine').parent().addClass('active'); | ||
| 264 | + // 下行 | ||
| 265 | + }else if(directionData==1){ | ||
| 266 | + $('#stationUp').removeClass('active'); | ||
| 267 | + $('#stationUp').removeClass('in'); | ||
| 268 | + $('#stationUp').addClass('fade'); | ||
| 269 | + $('#stationDown').addClass('active in'); | ||
| 270 | + $('#upLine').parent().removeClass('active'); | ||
| 271 | + $('#downLine').parent().addClass('active'); | ||
| 272 | + } | ||
| 273 | + } else { | ||
| 274 | + layer.msg('百度地图中没有此线路,无法系统规划!'); | ||
| 275 | + setTimeout(function() { | ||
| 148 | // 关闭弹出层 | 276 | // 关闭弹出层 |
| 149 | layer.closeAll(); | 277 | layer.closeAll(); |
| 150 | // 上行 | 278 | // 上行 |
| 151 | if(directionData==0){ | 279 | if(directionData==0){ |
| 152 | // 显示上行规划 | 280 | // 显示上行规划 |
| 153 | $('#upToolsMobal').show(); | 281 | $('#upToolsMobal').show(); |
| 154 | - // 下行 | 282 | + // 下行 |
| 155 | }else if(directionData==1){ | 283 | }else if(directionData==1){ |
| 156 | // 显示下行规划 | 284 | // 显示下行规划 |
| 157 | $('#downToolsMobal').show(); | 285 | $('#downToolsMobal').show(); |
| 158 | } | 286 | } |
| 159 | - }); | ||
| 160 | - }else { | ||
| 161 | - /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 162 | - PublicFunctions.systemLineStation(lineNameV,directionData); | 287 | + }, 3000); |
| 163 | } | 288 | } |
| 289 | + }); | ||
| 290 | + }, | ||
| 164 | 291 | ||
| 165 | - }, | ||
| 166 | - | ||
| 167 | - /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 168 | - systemLineStation : function(lineNameV,directionData) { | ||
| 169 | - /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/ | ||
| 170 | - WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){ | ||
| 171 | - // 如果线路信息不为空 | ||
| 172 | - if(BusLine) { | ||
| 173 | - // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 | ||
| 174 | - var Polygon = BusLine.getPolyline(); | ||
| 175 | - // 返回多边型的点数组(自1.2新增) | ||
| 176 | - var polyGonArray = Polygon.getPath(); | ||
| 177 | - // 获取公交站点个数(自 1.2 新增) | ||
| 178 | - var stationNumber = BusLine.getNumBusStations(); | ||
| 179 | - // 定义线路信息集合 | ||
| 180 | - var stationInfo = []; | ||
| 181 | - // 遍历 | ||
| 182 | - for(var k = 0 ; k < stationNumber; k++) { | ||
| 183 | - // 定义线路信息集合 | ||
| 184 | - var tempM = {}; | ||
| 185 | - // 添加站点名称 | ||
| 186 | - tempM.name = BusLine.getBusStation(k).name; | ||
| 187 | - // 添加站点坐标 | ||
| 188 | - tempM.potion = BusLine.getBusStation(k).position; | ||
| 189 | - tempM.wgs = {x:'',y:''}; | ||
| 190 | - // 添加 | ||
| 191 | - stationInfo.push(tempM); | ||
| 192 | - } | ||
| 193 | - // 获取站点之间的距离与时间 | ||
| 194 | - WorldsBMap.getDistanceAndDuration(stationInfo,function(json) { | ||
| 195 | - // 设置第一个站的距离 | ||
| 196 | - json[0].distance = ''; | ||
| 197 | - // 设置第一个站的时间 | ||
| 198 | - json[0].duration = ''; | ||
| 199 | - // 定义站点信息JSON字符串 | ||
| 200 | - var stationJSON = JSON.stringify(json); | ||
| 201 | - // 定义路段信息字符串 | ||
| 202 | - var sectionJSON = JSON.stringify(polyGonArray); | ||
| 203 | - // 参数集合 | ||
| 204 | - var params = {}; | ||
| 205 | - // 站点信息JSON字符串 | ||
| 206 | - params.stationJSON = stationJSON; | ||
| 207 | - var addLine = LineObj.getLineObj(); | ||
| 208 | - // 线路ID | ||
| 209 | - params.lineId = addLine.id; | ||
| 210 | - // 方向 | ||
| 211 | - params.directions = directionData; | ||
| 212 | - // 原始坐标类型 | ||
| 213 | - params.dbType = 'b'; | ||
| 214 | - // 圆形半径 | ||
| 215 | - params.radius = '100'; | ||
| 216 | - // 图形类型(r:圆形;p:多边形) | ||
| 217 | - params.shapesType = 'r'; | ||
| 218 | - // destroy:是否撤销 | ||
| 219 | - params.destroy = '0'; | ||
| 220 | - | ||
| 221 | - // 路段信息JSON字符串 | ||
| 222 | - params.sectionJSON = sectionJSON; | ||
| 223 | - // 限速 | ||
| 224 | - params.speedLimit = '60'; | ||
| 225 | - params.baseRes = 'No'; | ||
| 226 | - // 获取版本号后提交添加 | ||
| 227 | - $.get('/lineVersions/findByLineId',{'lineId':addLine.id},function(lineVersions){ | ||
| 228 | - $.each(lineVersions,function(){ | ||
| 229 | - if (this.status == 1) { | ||
| 230 | - // versions:版本号 | ||
| 231 | - params.versions = this.versions; | ||
| 232 | - // 保存 | ||
| 233 | - GetAjaxData.collectionSave(params,function(rd) { | ||
| 234 | - if(rd.status='SUCCESS') { | ||
| 235 | - // 关闭弹出层 | ||
| 236 | - layer.closeAll(); | ||
| 237 | - layer.msg('保存成功!'); | ||
| 238 | - }else { | ||
| 239 | - // 保存失败 | ||
| 240 | - layer.msg('保存失败!'); | ||
| 241 | - } | ||
| 242 | - // 刷新树 | ||
| 243 | - PublicFunctions.resjtreeDate(addLine.id,directionData); | ||
| 244 | - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 245 | - GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) { | ||
| 246 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 247 | - PublicFunctions.linePanlThree(addLine.id,data,directionData); | ||
| 248 | - }); | ||
| 249 | - }); | ||
| 250 | - } | ||
| 251 | - }) | ||
| 252 | - }); | ||
| 253 | - }); | ||
| 254 | - // 关闭弹出层 | ||
| 255 | - layer.closeAll(); | ||
| 256 | - // 上行 | ||
| 257 | - if(directionData==0){ | ||
| 258 | - $('#stationDown').removeClass('active'); | ||
| 259 | - $('#stationDown').removeClass('in'); | ||
| 260 | - $('#stationDown').addClass('fade'); | ||
| 261 | - $('#stationUp').addClass('active in'); | ||
| 262 | - $('#downLine').parent().removeClass('active'); | ||
| 263 | - $('#upLine').parent().addClass('active'); | ||
| 264 | - // 下行 | ||
| 265 | - }else if(directionData==1){ | ||
| 266 | - $('#stationUp').removeClass('active'); | ||
| 267 | - $('#stationUp').removeClass('in'); | ||
| 268 | - $('#stationUp').addClass('fade'); | ||
| 269 | - $('#stationDown').addClass('active in'); | ||
| 270 | - $('#upLine').parent().removeClass('active'); | ||
| 271 | - $('#downLine').parent().addClass('active'); | ||
| 272 | - } | ||
| 273 | - } else { | ||
| 274 | - layer.msg('百度地图中没有此线路,无法系统规划!'); | ||
| 275 | - setTimeout(function() { | ||
| 276 | - // 关闭弹出层 | ||
| 277 | - layer.closeAll(); | ||
| 278 | - // 上行 | ||
| 279 | - if(directionData==0){ | ||
| 280 | - // 显示上行规划 | ||
| 281 | - $('#upToolsMobal').show(); | ||
| 282 | - // 下行 | ||
| 283 | - }else if(directionData==1){ | ||
| 284 | - // 显示下行规划 | ||
| 285 | - $('#downToolsMobal').show(); | ||
| 286 | - } | ||
| 287 | - }, 3000); | ||
| 288 | - } | ||
| 289 | - }); | ||
| 290 | - }, | ||
| 291 | - | ||
| 292 | - /** @param directionV_ :方向 */ | ||
| 293 | - stationRevoke : function(directionV_) { | ||
| 294 | - // 获取树选中节点对象 | ||
| 295 | - var obj = PublicFunctions.getCurrSelNode(directionV_); | ||
| 296 | - // 是否选中,选中节点是否为站点 | ||
| 297 | - if(obj.length == 0 || obj[0].original.chaildredType !='station'){ | ||
| 298 | - // 弹出提示层 | ||
| 299 | - layer.msg('请先选择要删除的站点!'); | ||
| 300 | - return; | ||
| 301 | - } | ||
| 302 | - // 弹出是否撤销提示框 | ||
| 303 | - layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 304 | - // 站点路由ID | ||
| 305 | - var stationRouteId = obj[0].original.stationRouteId; | ||
| 306 | - // 撤销参数集合 | ||
| 307 | - var params = {stationRouteId:stationRouteId,destroy:'1'}; | ||
| 308 | - // 方向 | ||
| 309 | - var stationRouteDirections = obj[0].original.stationRouteDirections; | ||
| 310 | - // 撤销 | ||
| 311 | - GetAjaxData.stationRouteIsDestroy(params,function(result) { | ||
| 312 | - // 关闭弹出框 | ||
| 313 | - layer.close(index); | ||
| 314 | - if(result.status=='SUCCESS'){ | ||
| 315 | - layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】成功!'); | ||
| 316 | - }else{ | ||
| 317 | - layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】失败!'); | ||
| 318 | - } | ||
| 319 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 320 | - var Line = LineObj.getLineObj(); | ||
| 321 | - // 刷行左边树 | ||
| 322 | - PublicFunctions.resjtreeDate(Line.id,stationRouteDirections); | ||
| 323 | - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 324 | - GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) { | ||
| 325 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 326 | - PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections); | ||
| 327 | - }); | 292 | + /** @param directionV_ :方向 */ |
| 293 | + stationRevoke : function(directionV_) { | ||
| 294 | + // 获取树选中节点对象 | ||
| 295 | + var obj = PublicFunctions.getCurrSelNode(directionV_); | ||
| 296 | + // 是否选中,选中节点是否为站点 | ||
| 297 | + if(obj.length == 0 || obj[0].original.chaildredType !='station'){ | ||
| 298 | + // 弹出提示层 | ||
| 299 | + layer.msg('请先选择要删除的站点!'); | ||
| 300 | + return; | ||
| 301 | + } | ||
| 302 | + // 弹出是否撤销提示框 | ||
| 303 | + layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 304 | + // 站点路由ID | ||
| 305 | + var stationRouteId = obj[0].original.stationRouteId; | ||
| 306 | + // 撤销参数集合 | ||
| 307 | + var params = {stationRouteId:stationRouteId,destroy:'1'}; | ||
| 308 | + // 方向 | ||
| 309 | + var stationRouteDirections = obj[0].original.stationRouteDirections; | ||
| 310 | + // 撤销 | ||
| 311 | + GetAjaxData.stationRouteIsDestroy(params,function(result) { | ||
| 312 | + // 关闭弹出框 | ||
| 313 | + layer.close(index); | ||
| 314 | + if(result.status=='SUCCESS'){ | ||
| 315 | + layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】成功!'); | ||
| 316 | + }else{ | ||
| 317 | + layer.msg('撤销'+(directionV_==0?"上行":"下行")+'站点【'+obj[0].text+'】失败!'); | ||
| 318 | + } | ||
| 319 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 320 | + var Line = LineObj.getLineObj(); | ||
| 321 | + // 刷行左边树 | ||
| 322 | + PublicFunctions.resjtreeDate(Line.id,stationRouteDirections); | ||
| 323 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 324 | + GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) { | ||
| 325 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 326 | + PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections); | ||
| 328 | }); | 327 | }); |
| 329 | - }); | ||
| 330 | - }, | 328 | + }); |
| 329 | + }); | ||
| 330 | + }, | ||
| 331 | 331 | ||
| 332 | - /** @param direction_ :方向 */ | ||
| 333 | - editLinePlan : function(direction_) { | ||
| 334 | - var sel = PublicFunctions.getCurrSelNode(direction_); | ||
| 335 | - if(sel.length==0 || sel[0].original.chaildredType !='section'){ | ||
| 336 | - if(direction_=='0') { | ||
| 337 | - layer.msg('请先选中要编辑的上行路段!'); | ||
| 338 | - }else if(direction_=='1') { | ||
| 339 | - layer.msg('请先选中要编辑的下行路段!'); | ||
| 340 | - } | ||
| 341 | - return; | 332 | + /** @param direction_ :方向 */ |
| 333 | + editLinePlan : function(direction_) { | ||
| 334 | + var sel = PublicFunctions.getCurrSelNode(direction_); | ||
| 335 | + if(sel.length==0 || sel[0].original.chaildredType !='section'){ | ||
| 336 | + if(direction_=='0') { | ||
| 337 | + layer.msg('请先选中要编辑的上行路段!'); | ||
| 338 | + }else if(direction_=='1') { | ||
| 339 | + layer.msg('请先选中要编辑的下行路段!'); | ||
| 340 | + } | ||
| 341 | + return; | ||
| 342 | + } | ||
| 343 | + $('#downLine').addClass('btn disabled'); | ||
| 344 | + $('.btn-circle').addClass('disabled'); | ||
| 345 | + $('#upLine').addClass('btn disabled'); | ||
| 346 | + var editSectionV = sel[0].original; | ||
| 347 | + EditSectionObj.setEitdSection(editSectionV); | ||
| 348 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | ||
| 349 | + var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000}); | ||
| 350 | + WorldsBMap.editPolyUpline(); | ||
| 351 | + }, | ||
| 352 | + | ||
| 353 | + setFormValue : function(editStationParmas) { | ||
| 354 | + // 站点ID | ||
| 355 | + $('#stationIdInput').val(editStationParmas.stationId); | ||
| 356 | + // 站点路由ID | ||
| 357 | + $('#stationRouteIdInput').val(editStationParmas.stationRouteId); | ||
| 358 | + // 站点路由线路Id | ||
| 359 | + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine); | ||
| 360 | + // 线路编码 | ||
| 361 | + $('#lineCodeInput').val(editStationParmas.stationRouteLIneCode); | ||
| 362 | + // 百度坐标点图形集合 | ||
| 363 | + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | ||
| 364 | + // 获取站点名称元素设值 | ||
| 365 | + $('#zdmcInput').val(editStationParmas.stationStationName); | ||
| 366 | + // 获取站点路由名称元素设值 | ||
| 367 | + $('#stationNameInput').val(editStationParmas.stationStationName); | ||
| 368 | + // 获取站点编码元素设值 | ||
| 369 | + $('#stationCodInput').val(editStationParmas.stationCode); | ||
| 370 | + // 获取站点类型元素设值 | ||
| 371 | + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); | ||
| 372 | + // 获取站点方向元素设值 | ||
| 373 | + $('#stationdirSelect').val(editStationParmas.stationRoutedirections); | ||
| 374 | + // 获取站点道路编码元素设值 | ||
| 375 | + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding); | ||
| 376 | + // 百度地图经纬度坐标中心点 | ||
| 377 | + $('#bJwpointsInput').val(editStationParmas.stationJwpoints); | ||
| 378 | + if(editStationParmas.stationShapesType=='r') { | ||
| 379 | + // 获取图形类型元素,并添加值 | ||
| 380 | + $('#shapesTypeSelect').val('圆形'); | ||
| 381 | + }else if(editStationParmas.stationShapesType=='d'){ | ||
| 382 | + $('#radiusGroup').hide(); | ||
| 383 | + $('#shapesTypeSelect').val('多边形'); | ||
| 384 | + } | ||
| 385 | + // 获取半径元素,并添加值 | ||
| 386 | + $('#radiusInput').val(editStationParmas.stationRadius); | ||
| 387 | + // 是否撤销 | ||
| 388 | + $('#destroySelect').val(editStationParmas.stationDestroy); | ||
| 389 | + // 到站时间 | ||
| 390 | + $('#toTimeInput').val(editStationParmas.stationRouteToTime); | ||
| 391 | + // 到站距离 | ||
| 392 | + $('#distancesInput').val(editStationParmas.stationRouteDistances); | ||
| 393 | + // 线路版本号 | ||
| 394 | + $('#versionsInput').val(editStationParmas.stationRouteVersions); | ||
| 395 | + // 描述/说明 | ||
| 396 | + $('#descriptionsTextarea').val(editStationParmas.sttationDescriptions); | ||
| 397 | + }, | ||
| 398 | + | ||
| 399 | + setSectionFormValue : function(Section) { | ||
| 400 | + $('#isRoadeSpeedInput').val(Section.isRoadeSpeed); | ||
| 401 | + // 路段ID | ||
| 402 | + $('#sectionIdInput').val(Section.sectionId); | ||
| 403 | + // 路段路由ID | ||
| 404 | + $('#sectionRouteIdInput').val(Section.sectionrouteId); | ||
| 405 | + // 线路ID | ||
| 406 | + $('#sectionRouteLineInput').val(Section.sectionrouteLine); | ||
| 407 | + // 线路编码 | ||
| 408 | + $('#lineCodeInput').val(Section.sectionrouteLineCode); | ||
| 409 | + // 折线坐标集合 | ||
| 410 | + $('#bsectionVectorInput').val(Section.sectionBsectionVector); | ||
| 411 | + // 路段名称 | ||
| 412 | + $('#sectionNameInput').val(Section.sectionName); | ||
| 413 | + // 路段编码 | ||
| 414 | + $('#sectionCodeInput').val(Section.sectionCode); | ||
| 415 | + // 路段序号 | ||
| 416 | + $('#sectionrouteCodeSelect').val(Section.sectionrouteCode); | ||
| 417 | + // 路段方向 | ||
| 418 | + $('#directionsSection').val(Section.sectionrouteDirections); | ||
| 419 | + // 道路编码 | ||
| 420 | + $('#roadCodingCodInput').val(Section.sectionRoadCoding); | ||
| 421 | + // 道路限速 | ||
| 422 | + $('#speedLimitInput').val(Section.sectionSpeedLimet); | ||
| 423 | + // 路段长度 | ||
| 424 | + $('#sectionDistanceInput').val(Section.sectionDistance); | ||
| 425 | + // 时长 | ||
| 426 | + $('#sectionTimeInput').val(Section.sectionTime); | ||
| 427 | + // 版本号 | ||
| 428 | + $('#versionsInput').val(Section.versions); | ||
| 429 | + }, | ||
| 430 | + | ||
| 431 | + //lineId,data,direction | ||
| 432 | + treeSectionClick: function(lineId,data,direction){ | ||
| 433 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 434 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 435 | + // 编辑路段数据 | ||
| 436 | + for(var d= 0; d<data.length;d++){ | ||
| 437 | + // 地图折线坐标点集合 | ||
| 438 | + var polylineArray = []; | ||
| 439 | + // 获取路段折线坐标字符串 | ||
| 440 | + var sectionBsectionVectorStr = data[d].sectionBsectionVector; | ||
| 441 | + if(sectionBsectionVectorStr==null) { | ||
| 442 | + continue; | ||
| 342 | } | 443 | } |
| 343 | - $('#downLine').addClass('btn disabled'); | ||
| 344 | - $('.btn-circle').addClass('disabled'); | ||
| 345 | - $('#upLine').addClass('btn disabled'); | ||
| 346 | - var editSectionV = sel[0].original; | ||
| 347 | - EditSectionObj.setEitdSection(editSectionV); | ||
| 348 | - // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | ||
| 349 | - var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000}); | ||
| 350 | - WorldsBMap.editPolyUpline(); | ||
| 351 | - }, | ||
| 352 | - | ||
| 353 | - setFormValue : function(editStationParmas) { | ||
| 354 | - // 站点ID | ||
| 355 | - $('#stationIdInput').val(editStationParmas.stationId); | ||
| 356 | - // 站点路由ID | ||
| 357 | - $('#stationRouteIdInput').val(editStationParmas.stationRouteId); | ||
| 358 | - // 站点路由线路Id | ||
| 359 | - $('#stationRouteLineInput').val(editStationParmas.stationRouteLine); | ||
| 360 | - // 线路编码 | ||
| 361 | - $('#lineCodeInput').val(editStationParmas.stationRouteLineCode); | ||
| 362 | - // 百度坐标点图形集合 | ||
| 363 | - $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | ||
| 364 | - // 获取站点名称元素设值 | ||
| 365 | - $('#zdmcInput').val(editStationParmas.stationStationName); | ||
| 366 | - // 获取站点路由名称元素设值 | ||
| 367 | - $('#stationNameInput').val(editStationParmas.stationRouteStationName); | ||
| 368 | - // 获取站点编码元素设值 | ||
| 369 | - $('#stationCodInput').val(editStationParmas.stationStationCod); | ||
| 370 | - // 获取站点类型元素设值 | ||
| 371 | - // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); | ||
| 372 | - // 获取站点方向元素设值 | ||
| 373 | - $('#stationdirSelect').val(editStationParmas.stationRouteDirections); | ||
| 374 | - // 获取站点道路编码元素设值 | ||
| 375 | - $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding); | ||
| 376 | - // 百度地图经纬度坐标中心点 | ||
| 377 | - $('#bJwpointsInput').val(editStationParmas.stationBJwpoints); | ||
| 378 | - if(editStationParmas.stationShapesType=='r') { | ||
| 379 | - // 获取图形类型元素,并添加值 | ||
| 380 | - $('#shapesTypeSelect').val('圆形'); | ||
| 381 | - }else if(editStationParmas.stationShapesType=='d'){ | ||
| 382 | - $('#radiusGroup').hide(); | ||
| 383 | - $('#shapesTypeSelect').val('多边形'); | 444 | + // 切割段折线坐标字符串 |
| 445 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 446 | + // 分割折线坐标字符串 | ||
| 447 | + var lineArray = tempStr.split(','); | ||
| 448 | + for(var i = 0;i<lineArray.length;i++) { | ||
| 449 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 384 | } | 450 | } |
| 385 | - // 获取半径元素,并添加值 | ||
| 386 | - $('#radiusInput').val(editStationParmas.stationRadius); | ||
| 387 | - // 是否撤销 | ||
| 388 | - $('#destroySelect').val(editStationParmas.stationDestroy); | ||
| 389 | - // 到站时间 | ||
| 390 | - $('#toTimeInput').val(editStationParmas.stationRouteToTime); | ||
| 391 | - // 到站距离 | ||
| 392 | - $('#distancesInput').val(editStationParmas.stationRouteDistances); | ||
| 393 | - // 线路版本号 | ||
| 394 | - $('#versionsInput').val(editStationParmas.stationRouteVersions); | ||
| 395 | - // 描述/说明 | ||
| 396 | - $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions); | ||
| 397 | - }, | ||
| 398 | - | ||
| 399 | - setSectionFormValue : function(Section) { | ||
| 400 | - $('#isRoadeSpeedInput').val(Section.isRoadeSpeed); | ||
| 401 | - // 路段ID | ||
| 402 | - $('#sectionIdInput').val(Section.sectionId); | ||
| 403 | - // 路段路由ID | ||
| 404 | - $('#sectionRouteIdInput').val(Section.sectionrouteId); | ||
| 405 | - // 线路ID | ||
| 406 | - $('#sectionRouteLineInput').val(Section.sectionrouteLine); | ||
| 407 | - // 线路编码 | ||
| 408 | - $('#lineCodeInput').val(Section.sectionrouteLineCode); | ||
| 409 | - // 折线坐标集合 | ||
| 410 | - $('#bsectionVectorInput').val(Section.sectionBsectionVector); | ||
| 411 | - // 路段名称 | ||
| 412 | - $('#sectionNameInput').val(Section.sectionName); | ||
| 413 | - // 路段编码 | ||
| 414 | - $('#sectionCodeInput').val(Section.sectionCode); | ||
| 415 | - // 路段序号 | ||
| 416 | - $('#sectionrouteCodeSelect').val(Section.sectionrouteCode); | ||
| 417 | - // 路段方向 | ||
| 418 | - $('#directionsSection').val(Section.sectionrouteDirections); | ||
| 419 | - // 道路编码 | ||
| 420 | - $('#roadCodingCodInput').val(Section.sectionRoadCoding); | ||
| 421 | - // 道路限速 | ||
| 422 | - $('#speedLimitInput').val(Section.sectionSpeedLimet); | ||
| 423 | - // 路段长度 | ||
| 424 | - $('#sectionDistanceInput').val(Section.sectionDistance); | ||
| 425 | - // 时长 | ||
| 426 | - $('#sectionTimeInput').val(Section.sectionTime); | ||
| 427 | - // 版本号 | ||
| 428 | - $('#versionsInput').val(Section.versions); | ||
| 429 | - // 是否撤销 | ||
| 430 | - $('#destroySelect').val(Section.destroy); | ||
| 431 | - // 描述/说明 | ||
| 432 | - $('#descriptionsTextarea').val(Section.descriptions); | ||
| 433 | - }, | ||
| 434 | - | ||
| 435 | - //lineId,data,direction | ||
| 436 | - treeSectionClick: function(lineId,data,direction){ | ||
| 437 | - /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | 451 | + var index = parseInt(polylineArray.length/2); |
| 452 | + var center = polylineArray[index]; | ||
| 453 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 454 | + WorldsBMap.drawingUpline(polylineArray,center); | ||
| 455 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 456 | + WorldsBMap.drawingUpStationPoint(data[d], d+1); | ||
| 457 | + } | ||
| 458 | + }, | ||
| 459 | + | ||
| 460 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 461 | + linePanlThree : function(lineId,data,direction) { | ||
| 462 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 463 | + GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { | ||
| 438 | WorldsBMap.clearMarkAndOverlays(); | 464 | WorldsBMap.clearMarkAndOverlays(); |
| 439 | - // 编辑路段数据 | ||
| 440 | - for(var d= 0; d<data.length;d++){ | ||
| 441 | - // 地图折线坐标点集合 | ||
| 442 | - var polylineArray = []; | ||
| 443 | - // 获取路段折线坐标字符串 | ||
| 444 | - var sectionBsectionVectorStr = data[d].sectionBsectionVector; | ||
| 445 | - if(sectionBsectionVectorStr==null) { | ||
| 446 | - continue; | ||
| 447 | - } | ||
| 448 | - // 切割段折线坐标字符串 | ||
| 449 | - var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 450 | - // 分割折线坐标字符串 | ||
| 451 | - var lineArray = tempStr.split(','); | ||
| 452 | - for(var i = 0;i<lineArray.length;i++) { | ||
| 453 | - polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | 465 | + var polyline_center; |
| 466 | + // 如果站点路由数据不为空 | ||
| 467 | + if(resultdata.length>0) { | ||
| 468 | + var ceter_index = Math.round(resultdata.length / 2); | ||
| 469 | + var ceterPointsStr = resultdata[ceter_index].stationJwpoints; | ||
| 470 | + var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 471 | + polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | ||
| 472 | + // 遍历站点路由数据 | ||
| 473 | + for(var s = 0 ; s<resultdata.length;s++) { | ||
| 474 | + WorldsBMap.drawingUpStationPoint(resultdata[s], s+1); | ||
| 454 | } | 475 | } |
| 455 | - var index = parseInt(polylineArray.length/2); | ||
| 456 | - var center = polylineArray[index]; | ||
| 457 | - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 458 | - WorldsBMap.drawingUpline(polylineArray,center); | ||
| 459 | - /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 460 | - WorldsBMap.drawingUpStationPoint(center,data[d].name,d+1); | 476 | + |
| 461 | } | 477 | } |
| 462 | - }, | ||
| 463 | - | ||
| 464 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 465 | - linePanlThree : function(lineId,data,direction) { | ||
| 466 | - /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 467 | - GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { | ||
| 468 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 469 | - var polyline_center; | ||
| 470 | - // 如果站点路由数据不为空 | ||
| 471 | - if(resultdata.length>0) { | ||
| 472 | - var ceter_index = Math.round(resultdata.length / 2); | ||
| 473 | - var ceterPointsStr = resultdata[ceter_index].bJwpoints; | ||
| 474 | - var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 475 | - polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | ||
| 476 | - // 遍历站点路由数据 | ||
| 477 | - for(var s = 0 ; s<resultdata.length;s++) { | ||
| 478 | - // 中心点坐标字符串 | ||
| 479 | - var bJwpointsStr = resultdata[s].bJwpoints; | ||
| 480 | - var stationName = resultdata[s].stationName; | ||
| 481 | - // 起个中心点坐标字符串 | ||
| 482 | - var bJwpointsArray = bJwpointsStr.split(' '); | ||
| 483 | - // 设置中心点 | ||
| 484 | - var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | ||
| 485 | - /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 486 | - WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); | ||
| 487 | - } | ||
| 488 | - | ||
| 489 | - } | ||
| 490 | - // 路段数据长度 | ||
| 491 | - var dataLen = data.length; | ||
| 492 | - // 如果大于零 | ||
| 493 | - if(dataLen>0) { | ||
| 494 | - // 编辑路段数据 | ||
| 495 | - for(var d= 0; d<dataLen;d++){ | ||
| 496 | - // 地图折线坐标点集合 | ||
| 497 | - var polylineArray = []; | ||
| 498 | - // 获取路段折线坐标字符串 | ||
| 499 | - var sectionBsectionVectorStr = data[d].sectionBsectionVector; | ||
| 500 | - if(sectionBsectionVectorStr==null) | ||
| 501 | - continue; | ||
| 502 | - // 切割段折线坐标字符串 | ||
| 503 | - var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 504 | - // 分割折线坐标字符串 | ||
| 505 | - var lineArray = tempStr.split(','); | ||
| 506 | - for(var i = 0;i<lineArray.length;i++) { | ||
| 507 | - polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 508 | - } | ||
| 509 | - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 510 | - /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/ | ||
| 511 | - WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]); | ||
| 512 | - } | 478 | + // 路段数据长度 |
| 479 | + var dataLen = data.length; | ||
| 480 | + // 如果大于零 | ||
| 481 | + if(dataLen>0) { | ||
| 482 | + WorldsBMap.drawingUpline01(polyline_center,data); | ||
| 483 | + } | ||
| 484 | + }); | ||
| 485 | + }, | ||
| 486 | + /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */ | ||
| 487 | + TreeUpOrDown : function(lineId,diraction) { | ||
| 488 | + /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */ | ||
| 489 | + GetAjaxData.getStation(lineId,diraction,function(treeDateJson) { | ||
| 490 | + // 获取返回数据长度 | ||
| 491 | + var len = treeDateJson[0].children[0].children.length; | ||
| 492 | + // 上行 | ||
| 493 | + if(diraction == 0) { | ||
| 494 | + /** 初始化上行树 @param:<treeDateJson:树数据结构> */ | ||
| 495 | + StationTreeData.upInit(treeDateJson); | ||
| 496 | + if(len>0) { | ||
| 497 | + $('#upToolsMobal').hide(); | ||
| 498 | + $('#uptreeMobal').show(); | ||
| 499 | + }else { | ||
| 500 | + $('#upToolsMobal').show(); | ||
| 501 | + $('#uptreeMobal').hide(); | ||
| 513 | } | 502 | } |
| 514 | - }); | ||
| 515 | - }, | ||
| 516 | - /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */ | ||
| 517 | - TreeUpOrDown : function(lineId,diraction) { | ||
| 518 | - /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */ | ||
| 519 | - GetAjaxData.getStation(lineId,diraction,function(treeDateJson) { | ||
| 520 | - // 获取返回数据长度 | ||
| 521 | - var len = treeDateJson[0].children[0].children.length; | ||
| 522 | - // 上行 | ||
| 523 | - if(diraction == 0) { | ||
| 524 | - /** 初始化上行树 @param:<treeDateJson:树数据结构> */ | ||
| 525 | - StationTreeData.upInit(treeDateJson); | ||
| 526 | - if(len>0) { | ||
| 527 | - $('#upToolsMobal').hide(); | ||
| 528 | - $('#uptreeMobal').show(); | ||
| 529 | - }else { | ||
| 530 | - $('#upToolsMobal').show(); | ||
| 531 | - $('#uptreeMobal').hide(); | ||
| 532 | - } | ||
| 533 | - // 下行 | ||
| 534 | - }else if(diraction ==1) { | ||
| 535 | - /** 出事画下行树 @param:<treeDateJson:树数据结构> */ | ||
| 536 | - StationTreeData.downInit(treeDateJson); | ||
| 537 | - if(len>0) { | ||
| 538 | - $('#downToolsMobal').hide(); | ||
| 539 | - $('#DowntreeMobal').show(); | ||
| 540 | - }else { | ||
| 541 | - $('#downToolsMobal').show(); | ||
| 542 | - $('#DowntreeMobal').hide(); | ||
| 543 | - } | 503 | + // 下行 |
| 504 | + }else if(diraction ==1) { | ||
| 505 | + /** 出事画下行树 @param:<treeDateJson:树数据结构> */ | ||
| 506 | + StationTreeData.downInit(treeDateJson); | ||
| 507 | + if(len>0) { | ||
| 508 | + $('#downToolsMobal').hide(); | ||
| 509 | + $('#DowntreeMobal').show(); | ||
| 510 | + }else { | ||
| 511 | + $('#downToolsMobal').show(); | ||
| 512 | + $('#DowntreeMobal').hide(); | ||
| 544 | } | 513 | } |
| 545 | - }); | ||
| 546 | - }, | ||
| 547 | - isHaveStationName : function(data) { | ||
| 548 | - if(data.length>0) { | ||
| 549 | - layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 550 | - layer.close(index); | ||
| 551 | - }); | ||
| 552 | - return false; | ||
| 553 | - }else { | ||
| 554 | - return true; | ||
| 555 | } | 514 | } |
| 556 | - }, | ||
| 557 | - editAChangeCssRemoveDisabled : function() { | ||
| 558 | - $('#downLine').removeClass('btn disabled'); | ||
| 559 | - $('.btn-circle').removeClass('disabled'); | ||
| 560 | - $('#upLine').removeClass('btn disabled'); | ||
| 561 | - }, | ||
| 562 | - // 方向代码转名称. | ||
| 563 | - dirdmToName : function(value){ | ||
| 564 | - var srStr = ''; | ||
| 565 | - if(value=='0') | ||
| 566 | - srStr = '上行'; | ||
| 567 | - else if(value=='1') | ||
| 568 | - srStr = '下行'; | ||
| 569 | - return srStr; | ||
| 570 | - }, | 515 | + }); |
| 516 | + }, | ||
| 517 | + isHaveStationName : function(data) { | ||
| 518 | + if(data.length>0) { | ||
| 519 | + layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 520 | + layer.close(index); | ||
| 521 | + }); | ||
| 522 | + return false; | ||
| 523 | + }else { | ||
| 524 | + return true; | ||
| 525 | + } | ||
| 526 | + }, | ||
| 527 | + // 地图处于编辑状态 | ||
| 528 | + editMapStatus : function () { | ||
| 529 | + WorldsBMap.setMap_status(1); | ||
| 530 | + $('.protlet-box-layer').show(); | ||
| 531 | + }, | ||
| 532 | + // 地图处于编辑状态 | ||
| 533 | + editMapStatusRemove : function () { | ||
| 534 | + WorldsBMap.setMap_status(0); | ||
| 535 | + $('.protlet-box-layer').hide(); | ||
| 536 | + }, | ||
| 537 | + // 选项鎖死解除 | ||
| 538 | + editAChangeCssRemoveDisabled : function() { | ||
| 539 | + $('#downLine').removeClass('btn disabled'); | ||
| 540 | + $('.btn-circle').removeClass('disabled'); | ||
| 541 | + $('#upLine').removeClass('btn disabled'); | ||
| 542 | + }, | ||
| 543 | + // 方向代码转名称. | ||
| 544 | + dirdmToName : function(value){ | ||
| 545 | + var srStr = ''; | ||
| 546 | + if(value=='0') | ||
| 547 | + srStr = '上行'; | ||
| 548 | + else if(value=='1') | ||
| 549 | + srStr = '下行'; | ||
| 550 | + return srStr; | ||
| 551 | + }, | ||
| 571 | } | 552 | } |
| 572 | return PubFun ; | 553 | return PubFun ; |
| 573 | }(); | 554 | }(); |
| 574 | \ No newline at end of file | 555 | \ No newline at end of file |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| 1 | /** | 1 | /** |
| 2 | * 百度地图 | 2 | * 百度地图 |
| 3 | - * | 3 | + * |
| 4 | * - - - - - -》init:地图初始化 | 4 | * - - - - - -》init:地图初始化 |
| 5 | - * | 5 | + * |
| 6 | * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据 | 6 | * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据 |
| 7 | - * | 7 | + * |
| 8 | * - - - - - -》getDistanceAndDuration:获取距离与时间 | 8 | * - - - - - -》getDistanceAndDuration:获取距离与时间 |
| 9 | - * | 9 | + * |
| 10 | * - - - - - -》pointsPolygon:地图画多边行 | 10 | * - - - - - -》pointsPolygon:地图画多边行 |
| 11 | - * | 11 | + * |
| 12 | * - - - - - -》pointsCircle:画圆 | 12 | * - - - - - -》pointsCircle:画圆 |
| 13 | - * | 13 | + * |
| 14 | * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标 | 14 | * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标 |
| 15 | - * | 15 | + * |
| 16 | * - - - - - -》drawingUpline:在地图上画出上行线路走向 | 16 | * - - - - - -》drawingUpline:在地图上画出上行线路走向 |
| 17 | - * | 17 | + * |
| 18 | * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划) | 18 | * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划) |
| 19 | - * | 19 | + * |
| 20 | * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划) | 20 | * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划) |
| 21 | - * | 21 | + * |
| 22 | * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划) | 22 | * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划) |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | window.WorldsBMap = function () { | 25 | window.WorldsBMap = function () { |
| 26 | - | ||
| 27 | - /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */ | ||
| 28 | - var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false; | ||
| 29 | - | ||
| 30 | - var Bmap = { | ||
| 31 | - | ||
| 32 | - init : function() { | ||
| 33 | - | ||
| 34 | - // 设置中心点, | ||
| 35 | - var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | ||
| 36 | - | ||
| 37 | - // 百度API Key | ||
| 38 | - var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | ||
| 39 | - | ||
| 40 | - // 初始化百度地图 | ||
| 41 | - mapBValue = new BMap.Map("bmap_basic"); | ||
| 42 | - | ||
| 43 | - //中心点和缩放级别 | ||
| 44 | - mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | ||
| 45 | - | ||
| 46 | - //启用地图拖拽事件,默认启用(可不写) | ||
| 47 | - mapBValue.enableDragging(); | ||
| 48 | - | ||
| 49 | - //启用地图滚轮放大缩小 | ||
| 50 | - mapBValue.enableScrollWheelZoom(); | ||
| 51 | - | ||
| 52 | - //禁用鼠标双击放大 | ||
| 53 | - mapBValue.disableDoubleClickZoom(); | ||
| 54 | - | ||
| 55 | - //启用键盘上下左右键移动地图 | ||
| 56 | - mapBValue.enableKeyboard(); | ||
| 57 | - | ||
| 58 | - return mapBValue; | ||
| 59 | - }, | ||
| 60 | - | ||
| 61 | - /** 获取地图对象 @return 地图对象map */ | ||
| 62 | - getmapBValue : function() { | ||
| 63 | - | ||
| 64 | - return mapBValue; | ||
| 65 | - | ||
| 66 | - }, | ||
| 67 | - | ||
| 68 | - getPolygon : function(){ | ||
| 69 | - | ||
| 70 | - return polygon; | ||
| 71 | - }, | ||
| 72 | - | ||
| 73 | - getPolyUpline : function() { | ||
| 74 | - | ||
| 75 | - return polyUpline; | ||
| 76 | - }, | ||
| 77 | - | ||
| 78 | - getCircle : function() { | ||
| 79 | - | ||
| 80 | - return circle; | ||
| 81 | - }, | ||
| 82 | - | ||
| 83 | - getIsEditStatus : function() { | ||
| 84 | - return iseditStatus; | ||
| 85 | - }, | ||
| 86 | - | ||
| 87 | - setIsEditStatus : function(v) { | ||
| 88 | - iseditStatus = v ; | ||
| 89 | - }, | ||
| 90 | - | ||
| 91 | - initDrawingManager: function(map,styleOptions) { | ||
| 92 | - | ||
| 93 | - }, | ||
| 94 | - | ||
| 95 | - getDrawingManagerObj : function() { | ||
| 96 | - | ||
| 97 | - return drawingManagerInitV; | ||
| 98 | - }, | ||
| 99 | - | ||
| 100 | - // 从百度地图抓去站点与路段数据 | ||
| 101 | - lineInfoPanl : function(lineNameValue,i,cb) { | ||
| 102 | - | ||
| 103 | - /** 根据线路名称与方向从百度地图获取站点与路段 @param lineNameValue:线路名称;i:方向<0:上行;1:下行> */ | ||
| 104 | - WorldsBMap.getBmapStationNames(lineNameValue,i,function(BusLine){ | ||
| 105 | - | ||
| 106 | - return cb && cb(BusLine); | ||
| 107 | - | ||
| 108 | - }); | ||
| 109 | - | ||
| 110 | - }, | ||
| 111 | - | ||
| 112 | - /** 获取距离与时间 @param <points:坐标点集合> */ | ||
| 113 | - getDistanceAndDuration : function(points,callback){ | ||
| 114 | - | ||
| 115 | - // 获取长度 | ||
| 116 | - var len = points.length; | ||
| 117 | - | ||
| 118 | - (function(){ | ||
| 119 | - | ||
| 120 | - if (!arguments.callee.count) { | ||
| 121 | - | ||
| 122 | - arguments.callee.count = 0; | ||
| 123 | - | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - arguments.callee.count++; | ||
| 127 | - | ||
| 128 | - var index = parseInt(arguments.callee.count) - 1; | ||
| 129 | - | ||
| 130 | - if (index >= len-1) { | ||
| 131 | - | ||
| 132 | - callback && callback(points); | ||
| 133 | - | ||
| 134 | - return; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | ||
| 138 | - var f = arguments.callee; | ||
| 139 | - | ||
| 140 | - // 起点坐标 <坐标格式:40.056878,116.30815> | ||
| 141 | - var origin = points[index].potion.lat + ',' + points[index].potion.lng; | ||
| 142 | - | ||
| 143 | - // 终点坐标 <坐标格式:40.056878,116.30815> | ||
| 144 | - var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng; | ||
| 145 | - | ||
| 146 | - var region = '上海'; | ||
| 147 | - | ||
| 148 | - var origin_region = '上海'; | ||
| 149 | - | ||
| 150 | - var destination_region = '上海'; | ||
| 151 | - | ||
| 152 | - var output = 'json'; | ||
| 153 | - | ||
| 154 | - var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | ||
| 155 | - | ||
| 156 | - /** | ||
| 157 | - * origin:起点名称或经纬度; | ||
| 158 | - * | ||
| 159 | - * destination:终点名称或经纬度; | ||
| 160 | - * | ||
| 161 | - * origin_region:起始点所在城市,驾车导航时必填。 | ||
| 162 | - * | ||
| 163 | - * destination_region:终点所在城市,驾车导航时必填。 | ||
| 164 | - * | ||
| 165 | - * output :表示输出类型,可设置为xml或json,默认为xml。 | ||
| 166 | - * | ||
| 167 | - **/ | ||
| 168 | - var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My}; | ||
| 169 | - | ||
| 170 | - /** @description :未认证开发者默认配额为:2000次/天。 */ | ||
| 171 | - $.ajax({ | ||
| 172 | - | ||
| 173 | - // 百度地图根据坐标获取两点之间的时间与距离 | ||
| 174 | - url: 'http://api.map.baidu.com/direction/v1?mode=transit', | ||
| 175 | - | ||
| 176 | - data: paramsB, | ||
| 177 | - | ||
| 178 | - dataType: 'jsonp', | ||
| 179 | - | ||
| 180 | - success: function(r){ | ||
| 181 | - | ||
| 182 | - if(r) { | ||
| 183 | - | ||
| 184 | - if(r.message=='ok') { | ||
| 185 | - | ||
| 186 | - if(r.result.taxi==null) { | ||
| 187 | - | ||
| 188 | - // 获取距离(单位:米) | ||
| 189 | - points[index+1].distance = 0; | ||
| 190 | - | ||
| 191 | - // 获取时间(单位:秒) | ||
| 192 | - points[index+1].duration = 0; | ||
| 193 | - | ||
| 194 | - }else { | ||
| 195 | - | ||
| 196 | - // 获取距离(单位:米) | ||
| 197 | - points[index+1].distance = r.result.taxi.distance; | ||
| 198 | - | ||
| 199 | - // 获取时间(单位:秒) | ||
| 200 | - points[index+1].duration = r.result.taxi.duration; | ||
| 201 | - | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - | ||
| 205 | - } | ||
| 206 | - | ||
| 207 | - } | ||
| 208 | - | ||
| 209 | - f(); | ||
| 210 | - } | ||
| 211 | - }); | ||
| 212 | - | ||
| 213 | - })(); | ||
| 214 | - | ||
| 215 | - }, | ||
| 216 | - | ||
| 217 | - // 地图画多边形 | ||
| 218 | - pointsPolygon : function(objStation) { | ||
| 219 | - | ||
| 220 | - // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 221 | - mapBValue.setZoom(15); | ||
| 222 | - | ||
| 223 | - // 如果不为空 | ||
| 224 | - if(objStation) { | ||
| 225 | - // 获取中心点坐标字符串 | ||
| 226 | - var testpointStr = objStation.stationBJwpoints; | ||
| 227 | - // 按空格切割中心点坐标字符串 | ||
| 228 | - var BJwpointsPolygon = testpointStr.split(' '); | ||
| 229 | - // 中心点坐标 | ||
| 230 | - var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | ||
| 231 | - // 获取多边形坐标字符串 | ||
| 232 | - var stationBPolygonGrid = objStation.stationBPolygonGrid; | ||
| 233 | - // 截取多边形坐标字符串 | ||
| 234 | - var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | ||
| 235 | - // 按逗号切割 | ||
| 236 | - var pointPolygonArray = stationBPolygonGridStr.split(','); | ||
| 237 | - // 多边形坐标集合 | ||
| 238 | - var polygonP = []; | ||
| 239 | - for(var v = 0;v<pointPolygonArray.length;v++) { | ||
| 240 | - polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | ||
| 241 | - } | ||
| 242 | - | ||
| 243 | - // 画多边形 | ||
| 244 | - polygon = new BMap.Polygon(polygonP, { | ||
| 245 | - // 线条显色 | ||
| 246 | - strokeColor : "blue", | ||
| 247 | - // 边线的宽度,以像素为单位。 | ||
| 248 | - strokeWeight : 2, | ||
| 249 | - // 边线透明度,取值范围0 - 1。 | ||
| 250 | - strokeOpacity : 0.5 | ||
| 251 | - }); | ||
| 252 | - | ||
| 253 | - // 增加地图覆盖物多边形 | ||
| 254 | - mapBValue.addOverlay(polygon); | ||
| 255 | - | ||
| 256 | - // 信息窗口属性 | ||
| 257 | - var opts_polygon = { | ||
| 258 | - // 信息窗口宽度 | ||
| 259 | - width : 200, | ||
| 260 | - // 信息窗口高度 | ||
| 261 | - height : 300, | ||
| 262 | - // 信息窗位置偏移值。 | ||
| 263 | - // offset: new BMap.Size(500,20), | ||
| 264 | - //标题 | ||
| 265 | - // title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | ||
| 266 | - //设置不允许信窗发送短息 | ||
| 267 | - enableMessage : false, | ||
| 268 | - //是否开启点击地图关闭信息窗口 | ||
| 269 | - enableCloseOnClick : false | ||
| 270 | - }; | ||
| 271 | - | ||
| 272 | - var markTypeStr = ''; | ||
| 273 | - if(objStation.stationRouteStationMark=='B') { | ||
| 274 | - markTypeStr='起点站'; | ||
| 275 | - }else if(objStation.stationRouteStationMark=='Z') { | ||
| 276 | - markTypeStr ='中途站'; | ||
| 277 | - }else if(objStation.stationRouteStationMark=='E') { | ||
| 278 | - markTypeStr='终点站'; | ||
| 279 | - } | ||
| 280 | - var point = objStation.stationBJwpoints.split(" ") | ||
| 281 | - var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' + | ||
| 282 | - '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 283 | - '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 284 | - '<span class="help-block" >站点类型:' + markTypeStr + '</span>' + | ||
| 285 | - '<span class="help-block" >经度:  ' + point[0] + '</span>' + | ||
| 286 | - '<span class="help-block" >纬度:  ' + point[1] + '</span>' + | ||
| 287 | - '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 288 | - '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 289 | - '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' + | ||
| 290 | - '<span class="help-block" >版本号:  ' + objStation.stationRouteVersions + '</span>' + | ||
| 291 | - '<div style="">' + | ||
| 292 | - '<button style="float:left; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' + | ||
| 293 | - 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button>' + | ||
| 294 | - '<button style="float:right; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' + | ||
| 295 | - 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button>' + | ||
| 296 | - '</div>'; | ||
| 297 | - | ||
| 298 | - // 创建信息窗口 | ||
| 299 | - var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); | ||
| 300 | - // 自定义标注物图片 | ||
| 301 | - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 302 | - // 创建点 | ||
| 303 | - marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | ||
| 304 | - // 把标注添物加到地图上 | ||
| 305 | - mapBValue.addOverlay(marker); | ||
| 306 | - // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 307 | - var PanOptions_ ={noAnimation :true}; | ||
| 308 | - // 将地图的中心点更改为给定的点。 | ||
| 309 | - mapBValue.panTo(pointPolygon,PanOptions_); | ||
| 310 | - // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | ||
| 311 | - mapBValue.panBy(10,-150,PanOptions_); | ||
| 312 | - //开启信息窗口 | ||
| 313 | - mapBValue.openInfoWindow(infoWindow_target,pointPolygon); | ||
| 314 | - } | ||
| 315 | - | ||
| 316 | - }, | ||
| 317 | - | ||
| 318 | - editPolyUpline : function() { | ||
| 319 | - // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 320 | - polyUpline.disableMassClear(); | ||
| 321 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 322 | - // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 323 | - polyUpline.enableMassClear(); | ||
| 324 | - // 开启线路编辑 | ||
| 325 | - polyUpline.enableEditing(); | ||
| 326 | - // 添加双击折线保存事件 | ||
| 327 | - polyUpline.addEventListener('dblclick',function(e) { | ||
| 328 | - // 关闭 | ||
| 329 | - layer.closeAll(); | ||
| 330 | - polyUpline.disableEditing(); | ||
| 331 | - // 获取折线坐标集合 | ||
| 332 | - var editPloyLineArray = polyUpline.getPath(); | ||
| 333 | - EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 334 | - polyUpline= ''; | ||
| 335 | - // 加载修改路段弹出层mobal页面 | ||
| 336 | - $.get('editsection.html', function(m){ | ||
| 337 | - $(pjaxContainer).append(m); | ||
| 338 | - $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | ||
| 339 | - }); | ||
| 340 | - }); | ||
| 341 | - }, | ||
| 342 | - | ||
| 343 | - // 画圆 | ||
| 344 | - pointsCircle : function(objStation) { | ||
| 345 | - | ||
| 346 | - // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 347 | - mapBValue.setZoom(16); | ||
| 348 | - | ||
| 349 | - if(objStation) { | ||
| 350 | - | ||
| 351 | - // 清除地图覆盖物 | ||
| 352 | - mapBValue.clearOverlays(); | ||
| 353 | - | ||
| 354 | - // 获取中心坐标点字符串分割 | ||
| 355 | - var BJwpoints = objStation.stationBJwpoints.split(' '); | ||
| 356 | - | ||
| 357 | - // 中心坐标点 | ||
| 358 | - var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 359 | - | ||
| 360 | - //创建圆 | ||
| 361 | - circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | ||
| 362 | - | ||
| 363 | - // 允许覆盖物在map.clearOverlays方法中被清除 | ||
| 364 | - circle.enableMassClear(); | ||
| 365 | - | ||
| 366 | - // 百度地图添加覆盖物圆 | ||
| 367 | - mapBValue.addOverlay(circle); | ||
| 368 | - | ||
| 369 | - // 信息窗口参数属性 | ||
| 370 | - var opts = { | ||
| 371 | - // 信息窗口宽度 | ||
| 372 | - width : 200, | ||
| 373 | - // 信息窗口高度 | ||
| 374 | - height : 330, | ||
| 375 | - // 信息窗位置偏移值。 | ||
| 376 | - // offset: new BMap.Size(500,120), | ||
| 377 | - //标题 | ||
| 378 | - // title : '<h4 style="color:#ff8355">'+objStation.stationStationName+'站详情</h4>', | ||
| 379 | - //设置不允许信窗发送短息 | ||
| 380 | - enableMessage : false, | ||
| 381 | - //是否开启点击地图关闭信息窗口 | ||
| 382 | - enableCloseOnClick : false, | ||
| 383 | - // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 384 | - enableAutoPan:false | ||
| 385 | - }; | ||
| 386 | - | ||
| 387 | - var markTypeStr = ''; | ||
| 388 | - if(objStation.stationRouteStationMark=='B') { | ||
| 389 | - markTypeStr='起点站'; | ||
| 390 | - }else if(objStation.stationRouteStationMark=='Z') { | ||
| 391 | - markTypeStr ='中途站'; | ||
| 392 | - }else if(objStation.stationRouteStationMark=='E') { | ||
| 393 | - markTypeStr='终点站'; | ||
| 394 | - } | ||
| 395 | - var point1 = objStation.stationBJwpoints.split(" "); | ||
| 396 | - var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' + | ||
| 397 | - '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 398 | - '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 399 | - '<span class="help-block" >站点类型:' + markTypeStr + '</span>' + | ||
| 400 | - '<span class="help-block" >经度:  ' + point1[0] + '</span>' + | ||
| 401 | - '<span class="help-block" >纬度:  ' + point1[1] + '</span>' + | ||
| 402 | - '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 403 | - '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 404 | - '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' + | ||
| 405 | - '<span class="help-block" >半径  :' + objStation.stationRadius + '</span>' + | ||
| 406 | - '<span class="help-block" >版本号  :' + objStation.stationRouteVersions + '</span>' + | ||
| 407 | - '<div style="">' + | ||
| 408 | - '<button style="float:left; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' + | ||
| 409 | - 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button>' + | ||
| 410 | - '<button style="float:right; background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn " ' + | ||
| 411 | - 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button>' + | ||
| 412 | - '</div>'; | ||
| 413 | - | ||
| 414 | - // 创建信息窗口 | ||
| 415 | - var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 416 | - // 自定义标注物图片 | ||
| 417 | - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 418 | - | ||
| 419 | - // 创建点 | ||
| 420 | - marker = new BMap.Marker(point,{icon : icon_target}); | ||
| 421 | - | ||
| 422 | - // 把标注添物加到地图上 | ||
| 423 | - mapBValue.addOverlay(marker); | ||
| 424 | - | ||
| 425 | - setTimeout(function(){ | ||
| 426 | - //开启信息窗口 | ||
| 427 | - marker.openInfoWindow(infoWindow_target,point); | ||
| 428 | - | ||
| 429 | - },100); | ||
| 430 | - | ||
| 431 | - // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 432 | - var PanOptions_ ={noAnimation :true}; | ||
| 433 | - | ||
| 434 | - // 将地图的中心点更改为给定的点。 | ||
| 435 | - mapBValue.panTo(point,PanOptions_); | ||
| 436 | - | ||
| 437 | - mapBValue.panBy(10,-200,PanOptions_); | ||
| 438 | - | ||
| 439 | - // 添加标志物监听事件 | ||
| 440 | - marker.addEventListener("click",function() { | ||
| 441 | - | ||
| 442 | - //开启信息窗口 | ||
| 443 | - marker.openInfoWindow(infoWindow_target,point); | ||
| 444 | - | ||
| 445 | - }); | ||
| 446 | - | ||
| 447 | - } | ||
| 448 | - | ||
| 449 | - }, | ||
| 450 | - | ||
| 451 | - // 根据地理名称获取百度经纬度坐标 | ||
| 452 | - localSearchFromAdreesToPoint: function(Address,callback) { | ||
| 453 | - | ||
| 454 | - // 创建一个搜索类实例 | ||
| 455 | - var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 456 | - | ||
| 457 | - // 检索完成后的回调函数。 | ||
| 458 | - localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 459 | - | ||
| 460 | - var resultPoints = ''; | ||
| 461 | - | ||
| 462 | - if(searchResult) { | ||
| 463 | - | ||
| 464 | - // 返回索引指定的结果。索引0表示第1条结果 | ||
| 465 | - var poi = searchResult.getPoi(0); | ||
| 466 | - | ||
| 467 | - if(poi) { | ||
| 468 | - | ||
| 469 | - //获取经度和纬度 | ||
| 470 | - resultPoints = poi.point.lng + ' ' + poi.point.lat; | ||
| 471 | - | ||
| 472 | - callback && callback(resultPoints); | ||
| 473 | - | ||
| 474 | - }else { | ||
| 475 | - | ||
| 476 | - callback && callback(false); | ||
| 477 | - | ||
| 478 | - } | ||
| 479 | - | ||
| 480 | - }else { | ||
| 481 | - | ||
| 482 | - callback && callback(false); | ||
| 483 | - } | ||
| 484 | - | ||
| 485 | - }); | ||
| 486 | - | ||
| 487 | - // 根据检索词发起检索。 | ||
| 488 | - localSearch.search(Address); | ||
| 489 | - | ||
| 490 | - }, | ||
| 491 | - | ||
| 492 | - // 编辑图形 | ||
| 493 | - editShapes : function(editStationName,stationShapesTypeV,mindex) { | ||
| 494 | - // 关闭信息窗口 | ||
| 495 | - marker.closeInfoWindow(); | ||
| 496 | - | ||
| 497 | - // 清除marker | ||
| 498 | - mapBValue.removeOverlay(marker); | ||
| 499 | - | ||
| 500 | - // 编辑圆 | ||
| 501 | - if(stationShapesTypeV =='r') { | ||
| 502 | - | ||
| 503 | - // 开启编辑功能 | ||
| 504 | - circle.enableEditing(); | ||
| 505 | - | ||
| 506 | - // 编辑圆监听事件 | ||
| 507 | - circle.addEventListener('dblclick',function() { | ||
| 508 | - | ||
| 509 | - // 关闭提示弹出层 | ||
| 510 | - layer.close(mindex); | ||
| 511 | - | ||
| 512 | - // 返回圆形的半径,单位为米。 | ||
| 513 | - var newRadius = circle.getRadius(); | ||
| 514 | - | ||
| 515 | - // 返回圆形的中心点坐标。 | ||
| 516 | - var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | ||
| 517 | - | ||
| 518 | - var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | ||
| 519 | - | ||
| 520 | - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 521 | - EditStationObj.setEitdStationBJwpoints(newCenter); | ||
| 522 | - | ||
| 523 | - /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 524 | - EditStationObj.setEitdStationShapesType('r'); | ||
| 525 | - | ||
| 526 | - /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 527 | - EditStationObj.setEitdStationRadius(Math.round(newRadius)); | ||
| 528 | - | ||
| 529 | - /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 530 | - EditStationObj.setEitdBPolygonGrid(''); | ||
| 531 | - | ||
| 532 | - // 加载编辑页面 | ||
| 533 | - $.get('edit.html', function(m){ | ||
| 534 | - | ||
| 535 | - $(pjaxContainer).append(m); | ||
| 536 | - | ||
| 537 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | ||
| 538 | - | ||
| 539 | - }); | ||
| 540 | - | ||
| 541 | - }); | ||
| 542 | - | ||
| 543 | - // 编辑多变行 | ||
| 544 | - }else if(stationShapesTypeV =='d') { | ||
| 545 | - | ||
| 546 | - // 开启编辑功能(自 1.1 新增) | ||
| 547 | - polygon.enableEditing(); | ||
| 548 | - | ||
| 549 | - // 添加多变行编辑事件 | ||
| 550 | - polygon.addEventListener('dblclick',function(e) { | ||
| 551 | - | ||
| 552 | - // 获取编辑的多边形对象 | ||
| 553 | - var edit_pointE = polygon; | ||
| 554 | - | ||
| 555 | - var edit_bPloygonGrid = ""; | ||
| 556 | - | ||
| 557 | - var editPolyGonLen_ = edit_pointE.getPath().length; | ||
| 558 | - | ||
| 559 | - for(var k =0;k<editPolyGonLen_;k++) { | ||
| 560 | - | ||
| 561 | - if(k==0) { | ||
| 562 | - | ||
| 563 | - edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 564 | - | ||
| 565 | - }else { | ||
| 566 | - | ||
| 567 | - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 568 | - | ||
| 569 | - } | ||
| 570 | - | ||
| 571 | - } | ||
| 572 | - | ||
| 573 | - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | ||
| 574 | - | ||
| 575 | - // 多边形中心点 | ||
| 576 | - var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | ||
| 577 | - | ||
| 578 | - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 579 | - EditStationObj.setEitdStationBJwpoints(centre_points); | ||
| 580 | - | ||
| 581 | - /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 582 | - EditStationObj.setEitdStationShapesType('d'); | ||
| 583 | - | ||
| 584 | - /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 585 | - EditStationObj.setEitdStationRadius(''); | ||
| 586 | - | ||
| 587 | - /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 588 | - EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid); | ||
| 589 | - | ||
| 590 | - $.get('edit.html', function(m){ | ||
| 591 | - | ||
| 592 | - $(pjaxContainer).append(m); | ||
| 593 | - | ||
| 594 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | ||
| 595 | - | ||
| 596 | - }); | ||
| 597 | - | ||
| 598 | - }); | ||
| 599 | - | ||
| 600 | - } | ||
| 601 | - | ||
| 602 | - }, | ||
| 603 | - | ||
| 604 | - // 在地图上画出上行线路走向 | ||
| 605 | - drawingUpline : function (polylineArray,polyline_center,data) { | ||
| 606 | - /*WorldsBMap.clearMarkAndOverlays();*/ | ||
| 607 | - polyUpline = ''; | ||
| 608 | - // 创建线路走向 | ||
| 609 | - polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 610 | - // polyUpline.data = data; | ||
| 611 | - // 把折线添加到地图上 | ||
| 612 | - mapBValue.addOverlay(polyUpline); | ||
| 613 | - /*var ceter_index = Math.round(resultdata.length / 2); | ||
| 614 | - | ||
| 615 | - var ceterPointsStr = resultdata[ceter_index].bJwpoints; | ||
| 616 | - | ||
| 617 | - var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 618 | - | ||
| 619 | - var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ | ||
| 620 | - var PanOptions_ ={noAnimation :true}; | ||
| 621 | - mapBValue.reset(); | ||
| 622 | - mapBValue.panTo(polyline_center,PanOptions_); | ||
| 623 | - mapBValue.panBy(500,-510,PanOptions_); | ||
| 624 | - mapBValue.setZoom(14); | ||
| 625 | - | ||
| 626 | - // 信息窗口属性 | ||
| 627 | - var opts_polygon = { | 26 | + |
| 27 | + /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆; road_win_show_p:信息窗口打开状态的路段,map_status:地图编辑状态,drawingManager:绘画工具*/ | ||
| 28 | + var mapBValue = '',polygon = '', polyUpline = '', circle = '', iseditStatus = false, road_win_show_p = '', editPolyline = '', sectionArray = [], stationArray = new Map(),map_status = 0, | ||
| 29 | + drawingManager; | ||
| 30 | + var styleOptions = { | ||
| 31 | + strokeColor:"blue", //边线颜色。 | ||
| 32 | + fillColor:"blue", //填充颜色。当参数为空时,圆形将没有填充效果。 | ||
| 33 | + strokeWeight: 6, //边线的宽度,以像素为单位。 | ||
| 34 | + strokeOpacity: 0.7, //边线透明度,取值范围0 - 1。 | ||
| 35 | + fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。 | ||
| 36 | + strokeStyle: 'solid' //边线的样式,solid或dashed。 | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + var Bmap = { | ||
| 40 | + | ||
| 41 | + init: function () { | ||
| 42 | + // 设置中心点, | ||
| 43 | + var CENTER_POINT = {lng: 121.528733, lat: 31.237425}; | ||
| 44 | + // 百度API Key | ||
| 45 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | ||
| 46 | + // 初始化百度地图 | ||
| 47 | + mapBValue = new BMap.Map("bmap_basic"); | ||
| 48 | + //中心点和缩放级别 | ||
| 49 | + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng, CENTER_POINT.lat), 15); | ||
| 50 | + //启用地图拖拽事件,默认启用(可不写) | ||
| 51 | + mapBValue.enableDragging(); | ||
| 52 | + //启用地图滚轮放大缩小 | ||
| 53 | + mapBValue.enableScrollWheelZoom(); | ||
| 54 | + //禁用鼠标双击放大 | ||
| 55 | + mapBValue.disableDoubleClickZoom(); | ||
| 56 | + //启用键盘上下左右键移动地图 | ||
| 57 | + mapBValue.enableKeyboard(); | ||
| 58 | + return mapBValue; | ||
| 59 | + }, | ||
| 60 | + | ||
| 61 | + /** 获取地图对象 @return 地图对象map */ | ||
| 62 | + getmapBValue: function () { | ||
| 63 | + return mapBValue; | ||
| 64 | + }, | ||
| 65 | + getPolygon: function () { | ||
| 66 | + return polygon; | ||
| 67 | + }, | ||
| 68 | + getPolyUpline: function () { | ||
| 69 | + return polyUpline; | ||
| 70 | + }, | ||
| 71 | + getCircle: function () { | ||
| 72 | + return circle; | ||
| 73 | + }, | ||
| 74 | + getIsEditStatus: function () { | ||
| 75 | + return iseditStatus; | ||
| 76 | + }, | ||
| 77 | + setMap_status : function (i) { | ||
| 78 | + map_status = i; | ||
| 79 | + }, | ||
| 80 | + setIsEditStatus: function (v) { | ||
| 81 | + iseditStatus = v; | ||
| 82 | + }, | ||
| 83 | + /*initDrawingManager: function (map, styleOptions) { | ||
| 84 | + },*/ | ||
| 85 | + getDrawingManagerObj: function () { | ||
| 86 | + return drawingManagerInitV; | ||
| 87 | + }, | ||
| 88 | + | ||
| 89 | + // 从百度地图抓去站点与路段数据 | ||
| 90 | + lineInfoPanl: function (lineNameValue, i, cb) { | ||
| 91 | + | ||
| 92 | + /** 根据线路名称与方向从百度地图获取站点与路段 @param lineNameValue:线路名称;i:方向<0:上行;1:下行> */ | ||
| 93 | + WorldsBMap.getBmapStationNames(lineNameValue, i, function (BusLine) { | ||
| 94 | + | ||
| 95 | + return cb && cb(BusLine); | ||
| 96 | + | ||
| 97 | + }); | ||
| 98 | + | ||
| 99 | + }, | ||
| 100 | + | ||
| 101 | + /** 获取距离与时间 @param <points:坐标点集合> */ | ||
| 102 | + getDistanceAndDuration: function (points, callback) { | ||
| 103 | + | ||
| 104 | + // 获取长度 | ||
| 105 | + var len = points.length; | ||
| 106 | + | ||
| 107 | + (function () { | ||
| 108 | + | ||
| 109 | + if (!arguments.callee.count) { | ||
| 110 | + | ||
| 111 | + arguments.callee.count = 0; | ||
| 112 | + | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + arguments.callee.count++; | ||
| 116 | + | ||
| 117 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 118 | + | ||
| 119 | + if (index >= len - 1) { | ||
| 120 | + | ||
| 121 | + callback && callback(points); | ||
| 122 | + | ||
| 123 | + return; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | ||
| 127 | + var f = arguments.callee; | ||
| 128 | + | ||
| 129 | + // 起点坐标 <坐标格式:40.056878,116.30815> | ||
| 130 | + var origin = points[index].potion.lat + ',' + points[index].potion.lng; | ||
| 131 | + | ||
| 132 | + // 终点坐标 <坐标格式:40.056878,116.30815> | ||
| 133 | + var destination = points[index + 1].potion.lat + ',' + points[index + 1].potion.lng; | ||
| 134 | + | ||
| 135 | + var region = '上海'; | ||
| 136 | + | ||
| 137 | + var origin_region = '上海'; | ||
| 138 | + | ||
| 139 | + var destination_region = '上海'; | ||
| 140 | + | ||
| 141 | + var output = 'json'; | ||
| 142 | + | ||
| 143 | + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | ||
| 144 | + | ||
| 145 | + /** | ||
| 146 | + * origin:起点名称或经纬度; | ||
| 147 | + * | ||
| 148 | + * destination:终点名称或经纬度; | ||
| 149 | + * | ||
| 150 | + * origin_region:起始点所在城市,驾车导航时必填。 | ||
| 151 | + * | ||
| 152 | + * destination_region:终点所在城市,驾车导航时必填。 | ||
| 153 | + * | ||
| 154 | + * output :表示输出类型,可设置为xml或json,默认为xml。 | ||
| 155 | + * | ||
| 156 | + **/ | ||
| 157 | + var paramsB = { | ||
| 158 | + origin: origin, | ||
| 159 | + destination: destination, | ||
| 160 | + region: region, | ||
| 161 | + origin_region: origin_region, | ||
| 162 | + destination_region: destination_region, | ||
| 163 | + output: output, | ||
| 164 | + ak: ak_My | ||
| 165 | + }; | ||
| 166 | + | ||
| 167 | + /** @description :未认证开发者默认配额为:2000次/天。 */ | ||
| 168 | + $.ajax({ | ||
| 169 | + | ||
| 170 | + // 百度地图根据坐标获取两点之间的时间与距离 | ||
| 171 | + url: 'http://api.map.baidu.com/direction/v1?mode=transit', | ||
| 172 | + | ||
| 173 | + data: paramsB, | ||
| 174 | + | ||
| 175 | + dataType: 'jsonp', | ||
| 176 | + | ||
| 177 | + success: function (r) { | ||
| 178 | + | ||
| 179 | + if (r) { | ||
| 180 | + | ||
| 181 | + if (r.message == 'ok') { | ||
| 182 | + | ||
| 183 | + if (r.result.taxi == null) { | ||
| 184 | + | ||
| 185 | + // 获取距离(单位:米) | ||
| 186 | + points[index + 1].distance = 0; | ||
| 187 | + | ||
| 188 | + // 获取时间(单位:秒) | ||
| 189 | + points[index + 1].duration = 0; | ||
| 190 | + | ||
| 191 | + } else { | ||
| 192 | + | ||
| 193 | + // 获取距离(单位:米) | ||
| 194 | + points[index + 1].distance = r.result.taxi.distance; | ||
| 195 | + | ||
| 196 | + // 获取时间(单位:秒) | ||
| 197 | + points[index + 1].duration = r.result.taxi.duration; | ||
| 198 | + | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + f(); | ||
| 207 | + } | ||
| 208 | + }); | ||
| 209 | + | ||
| 210 | + })(); | ||
| 211 | + | ||
| 212 | + }, | ||
| 213 | + // 打开站点信息窗口 | ||
| 214 | + openStationInfoWin : function (objStation) { | ||
| 215 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 216 | + mapBValue.setZoom(25); | ||
| 217 | + if (objStation) { | ||
| 218 | + // 站点形状 | ||
| 219 | + var shapes = objStation.stationShapesType; | ||
| 220 | + // 获取中心坐标点字符串分割 | ||
| 221 | + var BJwpoints = objStation.stationJwpoints.split(' '); | ||
| 222 | + | ||
| 223 | + // 中心坐标点 | ||
| 224 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 225 | + var width = WorldsBMap.strGetLength(objStation.stationRouteName) * 11; | ||
| 226 | + // 信息窗口参数属性 | ||
| 227 | + var opts = { | ||
| 628 | // 信息窗口宽度 | 228 | // 信息窗口宽度 |
| 629 | - width : 200, | 229 | + width: (width < 200 ? 200 : width), |
| 630 | // 信息窗口高度 | 230 | // 信息窗口高度 |
| 631 | - height : 300, | 231 | + height: shapes=="r" ?330:300, |
| 632 | // 信息窗位置偏移值。 | 232 | // 信息窗位置偏移值。 |
| 633 | - // offset: new BMap.Size(500,20), | ||
| 634 | - //标题 | ||
| 635 | - // title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | 233 | + offset: new BMap.Size(10,-20), |
| 636 | //设置不允许信窗发送短息 | 234 | //设置不允许信窗发送短息 |
| 637 | - enableMessage : false, | 235 | + enableMessage: false, |
| 638 | //是否开启点击地图关闭信息窗口 | 236 | //是否开启点击地图关闭信息窗口 |
| 639 | - enableCloseOnClick : false | 237 | + enableCloseOnClick: false, |
| 238 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 239 | + enableAutoPan: false | ||
| 640 | }; | 240 | }; |
| 641 | 241 | ||
| 642 | - // var markTypeStr = ''; | ||
| 643 | - // if(objStation.stationRouteStationMark=='B') { | ||
| 644 | - // markTypeStr='起点站'; | ||
| 645 | - // }else if(objStation.stationRouteStationMark=='Z') { | ||
| 646 | - // markTypeStr ='中途站'; | ||
| 647 | - // }else if(objStation.stationRouteStationMark=='E') { | ||
| 648 | - // markTypeStr='终点站'; | ||
| 649 | - // } | ||
| 650 | - // var point = objStation.stationBJwpoints.split(" ") | ||
| 651 | - // var htm = '<span style="color: #ff8355;font-size: 20px;">' + objStation.stationStationName + '</span>' + | ||
| 652 | - // '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 653 | - // '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 654 | - // '<span class="help-block" >站点类型:' + markTypeStr + '</span>' + | ||
| 655 | - // '<span class="help-block" >经度:  ' + point[0] + '</span>' + | ||
| 656 | - // '<span class="help-block" >纬度:  ' + point[1] + '</span>' + | ||
| 657 | - // '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 658 | - // '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 659 | - // '<span class="help-block" >缓冲区形状:' + (objStation.stationShapesType == "r"?"圆形":"多边形") + '</span>' + | ||
| 660 | - // '<span class="help-block" >版本号:  ' + objStation.stationRouteVersions + '</span>' + | ||
| 661 | - // '<div style="display: flex">' + | ||
| 662 | - // '<span><button style="background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn btn-circle" ' + | ||
| 663 | - // 'id="editStation" onclick="WorldsBMap.editStation('+objStation.stationRouteDirections+')">修改站点</button></span>' + | ||
| 664 | - // '<span><button style="background: #ff8355; color: #fff; padding-bottom:5px; font-size: 9px;" class="btn btn-circle" ' + | ||
| 665 | - // 'id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad('+objStation.stationRouteId+')">添加站点间路段</button></span>' + | ||
| 666 | - // '</div>'; | ||
| 667 | - // | ||
| 668 | - // // 创建信息窗口 | ||
| 669 | - // var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); | ||
| 670 | - // // 自定义标注物图片 | ||
| 671 | - // var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 672 | - // // 创建点 | ||
| 673 | - // marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | ||
| 674 | - // // 把标注添物加到地图上 | ||
| 675 | - // mapBValue.addOverlay(marker); | ||
| 676 | - // // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 677 | - // var PanOptions_ ={noAnimation :true}; | ||
| 678 | - // // 将地图的中心点更改为给定的点。 | ||
| 679 | - // mapBValue.panTo(pointPolygon,PanOptions_); | ||
| 680 | - // // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | ||
| 681 | - // mapBValue.panBy(10,-150,PanOptions_); | ||
| 682 | - // //开启信息窗口 | ||
| 683 | - // mapBValue.openInfoWindow(infoWindow_target,pointPolygon); | ||
| 684 | - }, | ||
| 685 | - | ||
| 686 | - | ||
| 687 | - // 在地图上画出上行线路走向 | ||
| 688 | - drawingUpline01 : function (polylineArray,polyline_center,data) { | ||
| 689 | - var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | ||
| 690 | - // 创建线路走向 | ||
| 691 | - polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 692 | - polyUpline01.data = data; | ||
| 693 | - // 把折线添加到地图上 | ||
| 694 | - mapBValue.addOverlay(polyUpline01); | ||
| 695 | - polyUpline01.addEventListener('click',function(e) { | ||
| 696 | - if(WorldsBMap.getIsEditStatus()) { | ||
| 697 | - layer.msg('请先保存正在编辑的路段信息...'); | ||
| 698 | - return false; | ||
| 699 | - } | ||
| 700 | - polyUpline01.enableEditing(); | ||
| 701 | - WorldsBMap.setIsEditStatus(true); | ||
| 702 | - }); | ||
| 703 | - // 添加双击折线保存事件 | ||
| 704 | - polyUpline01.addEventListener('dblclick',function(e) { | ||
| 705 | - WorldsBMap.setIsEditStatus(false); | ||
| 706 | - // 关闭 | ||
| 707 | - layer.closeAll(); | ||
| 708 | - polyUpline01.disableEditing(); | ||
| 709 | - EditSectionObj.setEitdSection(polyUpline01.data); | ||
| 710 | - // 获取折线坐标集合 | ||
| 711 | - var editPloyLineArray = polyUpline01.getPath(); | ||
| 712 | - EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 713 | - // polyUpline= ''; | ||
| 714 | - // 加载修改路段弹出层mobal页面 | ||
| 715 | - $.get('editsection.html', function(m){ | ||
| 716 | - $(pjaxContainer).append(m); | ||
| 717 | - $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | ||
| 718 | - }); | ||
| 719 | - }); | ||
| 720 | - var PanOptions_ ={noAnimation :true}; | ||
| 721 | - mapBValue.reset(); | ||
| 722 | - mapBValue.panTo(polyline_center,PanOptions_); | ||
| 723 | - mapBValue.panBy(500,-510,PanOptions_); | ||
| 724 | - mapBValue.setZoom(14); | ||
| 725 | - }, | ||
| 726 | - | ||
| 727 | - /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 728 | - drawingUpStationPoint : function(point_center,stationName,s) { | ||
| 729 | - | ||
| 730 | - // 自定义标注物图片 | ||
| 731 | - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10)); | ||
| 732 | - | ||
| 733 | - var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">' | ||
| 734 | - + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">' | ||
| 735 | - + '</div>' | ||
| 736 | - + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>'; | ||
| 737 | - | ||
| 738 | - | ||
| 739 | - var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{ | ||
| 740 | - "anchor" : new BMap.Size(-10,8), | ||
| 741 | - "enableDragging" : true}); | ||
| 742 | - | ||
| 743 | - | ||
| 744 | - myRichMarker1.disableDragging(); | ||
| 745 | - mapBValue.addOverlay(myRichMarker1); | ||
| 746 | - | ||
| 747 | - | ||
| 748 | - // 创建标注物 | ||
| 749 | - marker = new BMap.Marker(point_center,{icon : icon_target}); | ||
| 750 | - | ||
| 751 | - // 允许覆盖物在map.clearOverlays方法中被清除。 | ||
| 752 | - marker.enableMassClear(); | ||
| 753 | - | ||
| 754 | - mapBValue.addOverlay(marker); | ||
| 755 | - }, | ||
| 756 | - | ||
| 757 | - // 站点名称获取百度坐标(手动规划) | ||
| 758 | - stationsNameToPoints : function(arra,callback) { | ||
| 759 | - // 获取长度 | ||
| 760 | - var len = arra.length; | ||
| 761 | - var stationList = []; | ||
| 762 | - (function(){ | ||
| 763 | - if (!arguments.callee.count) { | ||
| 764 | - arguments.callee.count = 0; | ||
| 765 | - } | ||
| 766 | - arguments.callee.count++; | ||
| 767 | - var index = parseInt(arguments.callee.count) - 1; | ||
| 768 | - if (index >= len) { | ||
| 769 | - callback && callback(stationList); | ||
| 770 | - return ; | ||
| 771 | - } | ||
| 772 | - var f = arguments.callee; | ||
| 773 | - if(arra[index].name!=''){ | ||
| 774 | - var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 775 | - localSearch.search(arra[index].name); | ||
| 776 | - localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 777 | - var poi = searchResult.getPoi(0); | ||
| 778 | - if(poi) { | ||
| 779 | - stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:poi.point.lng,lat:poi.point.lat}}); | ||
| 780 | - }else { | ||
| 781 | - stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:arra[index].wgs.x,lat:arra[index].wgs.y}}); | ||
| 782 | - } | ||
| 783 | - f(); | ||
| 784 | - }); | ||
| 785 | - }else { | ||
| 786 | - f(); | ||
| 787 | - } | ||
| 788 | - })(); | ||
| 789 | - }, | ||
| 790 | - | ||
| 791 | - // 根据坐标点获取两点之间的时间与距离(手动规划) | ||
| 792 | - getDistanceAndTotime : function(stationList,cb) { | ||
| 793 | - | ||
| 794 | - stationList[0].distance = ''; | ||
| 795 | - | ||
| 796 | - stationList[0].duration = ''; | ||
| 797 | - | ||
| 798 | - // var sectionList = []; | ||
| 799 | - | ||
| 800 | - // 获取长度 | ||
| 801 | - var len = stationList.length; | ||
| 802 | - | ||
| 803 | - (function(){ | ||
| 804 | - | ||
| 805 | - if (!arguments.callee.count) { | ||
| 806 | - | ||
| 807 | - arguments.callee.count = 0; | ||
| 808 | - | ||
| 809 | - } | ||
| 810 | - | ||
| 811 | - arguments.callee.count++; | ||
| 812 | - | ||
| 813 | - var index = parseInt(arguments.callee.count) - 1; | ||
| 814 | - | ||
| 815 | - if (index >= len-1) { | ||
| 816 | - | ||
| 817 | - // cb && cb(stationList,sectionList); | ||
| 818 | - cb && cb(stationList); | ||
| 819 | - return; | ||
| 820 | - } | ||
| 821 | - | ||
| 822 | - var f = arguments.callee; | ||
| 823 | - | ||
| 824 | - var poiOne = new BMap.Point(stationList[index].potion.lng,stationList[index].potion.lat); | ||
| 825 | - | ||
| 826 | - var poiTwo = new BMap.Point(stationList[index+1].potion.lng,stationList[index+1].potion.lat); | ||
| 827 | - | ||
| 828 | - var transit = new BMap.TransitRoute(mapBValue, {renderOptions: {map: mapBValue},onSearchComplete: searchComplete}); | ||
| 829 | - | ||
| 830 | - transit.search(poiOne,poiTwo); | ||
| 831 | - | ||
| 832 | - function searchComplete(results){ | ||
| 833 | - | ||
| 834 | - var plan = results.getPlan(0); | ||
| 835 | - | ||
| 836 | - if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | ||
| 837 | - | ||
| 838 | - stationList[index+1].distance = ''; | ||
| 839 | - | ||
| 840 | - stationList[index+1].duration = ''; | ||
| 841 | - | ||
| 842 | - // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:''}); | ||
| 843 | - | ||
| 844 | - }else { | ||
| 845 | - | ||
| 846 | - stationList[index+1].distance = plan.getDistance(true); | ||
| 847 | - | ||
| 848 | - stationList[index+1].duration = plan.getDuration(true); | ||
| 849 | - | ||
| 850 | - // var line = plan.getRoute(0); | ||
| 851 | - | ||
| 852 | - // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:line.getPath()}); | ||
| 853 | - | ||
| 854 | - } | ||
| 855 | - | ||
| 856 | - f(); | ||
| 857 | - } | ||
| 858 | - | ||
| 859 | - })(); | ||
| 860 | - | ||
| 861 | - }, | ||
| 862 | - | ||
| 863 | - // 根据坐标点获取两点之间的折线路段(手动规划) | ||
| 864 | - getSectionListPlonly : function(stationsPoint,cb) { | ||
| 865 | - | ||
| 866 | - var len = stationsPoint.length; | ||
| 867 | - | ||
| 868 | - var sectionList = []; | ||
| 869 | - | ||
| 870 | - (function(){ | ||
| 871 | - | ||
| 872 | - if (!arguments.callee.count) { | ||
| 873 | - | ||
| 874 | - arguments.callee.count = 0; | ||
| 875 | - | ||
| 876 | - } | ||
| 877 | - | ||
| 878 | - arguments.callee.count++; | ||
| 879 | - | ||
| 880 | - var index = parseInt(arguments.callee.count) - 1; | ||
| 881 | - | ||
| 882 | - if (index >= len-1 ) { | ||
| 883 | - | ||
| 884 | - cb && cb(sectionList); | ||
| 885 | - return; | ||
| 886 | - } | ||
| 887 | - | ||
| 888 | - var f = arguments.callee; | ||
| 889 | - | ||
| 890 | - var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); | ||
| 891 | - | ||
| 892 | - var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); | ||
| 893 | - | ||
| 894 | - /* var transit = new BMap.TransitRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet});*/ | ||
| 895 | - | ||
| 896 | - var transit = new BMap.DrivingRoute(mapBValue, {renderOptions: {map: mapBValue},onPolylinesSet: searchPolylinesSet}); | ||
| 897 | - | ||
| 898 | - function searchPolylinesSet(results){ | ||
| 899 | - | ||
| 900 | - if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | ||
| 901 | - | ||
| 902 | - | ||
| 903 | - }else { | ||
| 904 | - | ||
| 905 | - var sectionArrayList = []; | ||
| 906 | - for (i = 0; i < results.length; i++){ | ||
| 907 | - | ||
| 908 | - // console.log(results[i].getPolyline().getPath()); | ||
| 909 | - sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 910 | - | ||
| 911 | - } | ||
| 912 | - | ||
| 913 | - var sectionName = stationsPoint[index].name + '至' + stationsPoint[index+1].name; | ||
| 914 | - | ||
| 915 | - sectionList.push({sectionName:sectionName,points:sectionArrayList}); | ||
| 916 | - | ||
| 917 | - } | ||
| 918 | - | ||
| 919 | - f(); | ||
| 920 | - } | ||
| 921 | - | ||
| 922 | - transit.search(poiOne,poiTwo); | ||
| 923 | - | ||
| 924 | - })(); | ||
| 925 | - | ||
| 926 | - }, | ||
| 927 | - | ||
| 928 | - localtionPoint : function(stationNameV) { | ||
| 929 | - | ||
| 930 | - WorldsBMap.localSearchFromAdreesToPoint(stationNameV,function(Points) { | ||
| 931 | - | ||
| 932 | - if(Points) { | ||
| 933 | - | ||
| 934 | - var BJwpointsArray = Points.split(' '); | ||
| 935 | - | ||
| 936 | - var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | ||
| 937 | - | ||
| 938 | - var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | ||
| 939 | - | ||
| 940 | - var PanOptions ={noAnimation :true}; | ||
| 941 | - | ||
| 942 | - mapBValue.panTo(stationNameChangePoint,PanOptions); | ||
| 943 | - | ||
| 944 | - mapBValue.panBy(0,-100); | ||
| 945 | - | ||
| 946 | - // 将标注添加到地图中 | ||
| 947 | - mapBValue.addOverlay(marker_stargt2); | ||
| 948 | - | ||
| 949 | - //跳动的动画 | ||
| 950 | - marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | ||
| 951 | - | ||
| 952 | - } | ||
| 953 | - | ||
| 954 | - }); | ||
| 955 | - | ||
| 956 | - }, | ||
| 957 | - | ||
| 958 | - /** 系统规划抓去数据 @param lineNameValue:线路名称;i:方向*/ | ||
| 959 | - getBmapStationNames : function(lineNameValue,i,callback) { | ||
| 960 | - | ||
| 961 | - var busline = new BMap.BusLineSearch(mapBValue,{ | ||
| 962 | - | ||
| 963 | - // 设置公交列表查询后的回调函数。参数:rs: BusListResult类型 | ||
| 964 | - onGetBusListComplete:function(BusListResult) { | ||
| 965 | - | ||
| 966 | - // 如果不为空 | ||
| 967 | - if(BusListResult){ | ||
| 968 | - | ||
| 969 | - //获取第一个公交列表显示到map上 | ||
| 970 | - var fstLine = BusListResult.getBusListItem(i); | ||
| 971 | - | ||
| 972 | - /*if(fstLine==undefined){ | ||
| 973 | - | ||
| 974 | - layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 975 | - | ||
| 976 | - layer.closeAll(); | ||
| 977 | - | ||
| 978 | - if(i==0){ | ||
| 979 | - | ||
| 980 | - $('#upToolsMobal').show(); | ||
| 981 | - | ||
| 982 | - }else if(i==1){ | ||
| 983 | - | ||
| 984 | - $('#downToolsMobal').show(); | ||
| 985 | - | ||
| 986 | - } | ||
| 987 | - | ||
| 988 | - return; | ||
| 989 | - }); | ||
| 990 | - | ||
| 991 | - }*/ | ||
| 992 | - | ||
| 993 | - if(fstLine==undefined){ | ||
| 994 | - | ||
| 995 | - | ||
| 996 | - callback && callback(null); | ||
| 997 | - | ||
| 998 | - } | ||
| 999 | - | ||
| 1000 | - busline.getBusLine(fstLine); | ||
| 1001 | - | ||
| 1002 | - } | ||
| 1003 | - | ||
| 1004 | - }, | ||
| 1005 | - | ||
| 1006 | - //设置公交线路查询后的回调函数.参数:rs: BusLine类型 | ||
| 1007 | - onGetBusLineComplete: function(BusLine){ | ||
| 1008 | - | ||
| 1009 | - // 如果不为空 | ||
| 1010 | - if(BusLine){ | ||
| 1011 | - | ||
| 1012 | - callback && callback(BusLine); | ||
| 1013 | - | ||
| 1014 | - } | ||
| 1015 | - | ||
| 1016 | - } | ||
| 1017 | - | ||
| 1018 | - }); | ||
| 1019 | - | ||
| 1020 | - busline.getBusList(lineNameValue); | ||
| 1021 | - | ||
| 1022 | - }, | ||
| 1023 | - editStation : function(dir) { | ||
| 1024 | - // $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) { | ||
| 1025 | - $.get('edit_select.html', function(m){ | 242 | + var markTypeStr = ''; |
| 243 | + if (objStation.stationRouteStationMark == 'B') { | ||
| 244 | + markTypeStr = '起点站'; | ||
| 245 | + } else if (objStation.stationRouteStationMark == 'Z') { | ||
| 246 | + markTypeStr = '中途站'; | ||
| 247 | + } else if (objStation.stationRouteStationMark == 'E') { | ||
| 248 | + markTypeStr = '终点站'; | ||
| 249 | + } | ||
| 250 | + var htm = '<span style="color: #ff8355;font-size: 20px; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;display: -webkit-box; -webkit-box-orient: vertical;">' + objStation.stationRouteName + '</span>' + | ||
| 251 | + '<span class="help-block" >站点编码:' + objStation.stationCode + '</span>' + | ||
| 252 | + '<span class="help-block" >站点序号:' + objStation.stationRouteCode + '</span>' + | ||
| 253 | + '<span class="help-block" >站点类型:' + markTypeStr + '</span>' + | ||
| 254 | + '<span class="help-block" >经度:  ' + BJwpoints[0] + '</span>' + | ||
| 255 | + '<span class="help-block" >纬度:  ' + BJwpoints[1] + '</span>' + | ||
| 256 | + '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 257 | + '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 258 | + '<span class="help-block" >缓冲区形状:' + (shapes == "r" ? "圆形" : "多边形") + '</span>' + | ||
| 259 | + (shapes=="r" ? ("<span class='help-block' >半径  :" + objStation.stationRadius + "</span>") : " ")+ | ||
| 260 | + '<span class="help-block" >版本号  :' + objStation.stationRouteVersions + '</span>' + | ||
| 261 | + '<div>' + | ||
| 262 | + '<button class="info_win_btn" id="editStation" onclick="WorldsBMap.editStation(' + objStation.stationRouteId+','+objStation.stationRoutedirections + ')">修改站点</button>' + | ||
| 263 | + '<button class="info_win_btn" id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad(' + objStation.stationRouteId + ')">添加站点间路段</button>' + | ||
| 264 | + '<button class="info_win_btn" onclick="WorldsBMap.destroyStation('+ objStation.stationRouteId + ','+objStation.stationRouteLine+','+objStation.stationRoutedirections+')">撤销</button>' + | ||
| 265 | + '</div>'; | ||
| 266 | + | ||
| 267 | + // 创建信息窗口 | ||
| 268 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 269 | + setTimeout(function () { | ||
| 270 | + //开启信息窗口 | ||
| 271 | + mapBValue.openInfoWindow(infoWindow_target, point); | ||
| 272 | + }, 100); | ||
| 273 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 274 | + var PanOptions_ = {noAnimation: true}; | ||
| 275 | + // 将地图的中心点更改为给定的点。 | ||
| 276 | + mapBValue.panTo(point, PanOptions_); | ||
| 277 | + // mapBValue.panBy(10, -150, PanOptions_); | ||
| 278 | + } | ||
| 279 | + }, | ||
| 280 | + | ||
| 281 | + editPolyUpline: function () { | ||
| 282 | + // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 283 | + polyUpline.disableMassClear(); | ||
| 284 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 285 | + // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 286 | + polyUpline.enableMassClear(); | ||
| 287 | + // 开启线路编辑 | ||
| 288 | + polyUpline.enableEditing(); | ||
| 289 | + // 添加双击折线保存事件 | ||
| 290 | + polyUpline.addEventListener('dblclick', function (e) { | ||
| 291 | + // 关闭 | ||
| 292 | + layer.closeAll(); | ||
| 293 | + polyUpline.disableEditing(); | ||
| 294 | + // 获取折线坐标集合 | ||
| 295 | + var editPloyLineArray = polyUpline.getPath(); | ||
| 296 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 297 | + polyUpline = ''; | ||
| 298 | + // 加载修改路段弹出层mobal页面 | ||
| 299 | + $.get('editsection.html', function (m) { | ||
| 300 | + $(pjaxContainer).append(m); | ||
| 301 | + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap, GetAjaxData, EditSectionObj, PublicFunctions]); | ||
| 302 | + }); | ||
| 303 | + }); | ||
| 304 | + }, | ||
| 305 | + | ||
| 306 | + // 根据地理名称获取百度经纬度坐标 | ||
| 307 | + localSearchFromAdreesToPoint: function (Address, callback) { | ||
| 308 | + | ||
| 309 | + // 创建一个搜索类实例 | ||
| 310 | + var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 311 | + | ||
| 312 | + // 检索完成后的回调函数。 | ||
| 313 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 314 | + | ||
| 315 | + var resultPoints = ''; | ||
| 316 | + | ||
| 317 | + if (searchResult) { | ||
| 318 | + | ||
| 319 | + // 返回索引指定的结果。索引0表示第1条结果 | ||
| 320 | + var poi = searchResult.getPoi(0); | ||
| 321 | + | ||
| 322 | + if (poi) { | ||
| 323 | + | ||
| 324 | + //获取经度和纬度 | ||
| 325 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | ||
| 326 | + | ||
| 327 | + callback && callback(resultPoints); | ||
| 328 | + | ||
| 329 | + } else { | ||
| 330 | + | ||
| 331 | + callback && callback(false); | ||
| 332 | + | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + } else { | ||
| 336 | + | ||
| 337 | + callback && callback(false); | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + }); | ||
| 341 | + | ||
| 342 | + // 根据检索词发起检索。 | ||
| 343 | + localSearch.search(Address); | ||
| 344 | + | ||
| 345 | + }, | ||
| 346 | + | ||
| 347 | + // 编辑图形 | ||
| 348 | + editShapes: function (obj) { | ||
| 349 | + // 关闭信息窗口 | ||
| 350 | + mapBValue.closeInfoWindow(); | ||
| 351 | + | ||
| 352 | + // 清除marker | ||
| 353 | + // mapBValue.removeOverlay(marker); | ||
| 354 | + var station = obj.getEitdStation(); | ||
| 355 | + var stationShapesTypeV = station.stationShapesType; | ||
| 356 | + // 编辑圆 | ||
| 357 | + if (stationShapesTypeV == 'r') { | ||
| 358 | + | ||
| 359 | + // 获取中心坐标点字符串分割 | ||
| 360 | + var BJwpoints = station.stationJwpoints.split(' '); | ||
| 361 | + // 中心坐标点 | ||
| 362 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 363 | + //创建圆 | ||
| 364 | + circle = new BMap.Circle(point, station.stationRadius, { | ||
| 365 | + strokeColor: "red", | ||
| 366 | + strokeWeight: 2, | ||
| 367 | + strokeOpacity: 0.7 | ||
| 368 | + }); | ||
| 369 | + // 允许覆盖物在map.clearOverlays方法中被清除 | ||
| 370 | + circle.enableMassClear(); | ||
| 371 | + // 百度地图添加覆盖物圆 | ||
| 372 | + mapBValue.addOverlay(circle); | ||
| 373 | + // 开启编辑功能 | ||
| 374 | + circle.enableEditing(); | ||
| 375 | + // 编辑圆监听事件 | ||
| 376 | + circle.addEventListener('dblclick', function () { | ||
| 377 | + // 返回圆形的半径,单位为米。 | ||
| 378 | + var newRadius = circle.getRadius(); | ||
| 379 | + // 返回圆形的中心点坐标。 | ||
| 380 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | ||
| 381 | + var centre_New = [{potion: {lng: circle.getCenter().lng, lat: circle.getCenter().lat}}]; | ||
| 382 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 383 | + EditStationObj.setEitdStationJwpoints(newCenter); | ||
| 384 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 385 | + EditStationObj.setEitdStationShapesType('r'); | ||
| 386 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 387 | + EditStationObj.setEitdStationRadius(Math.round(newRadius)); | ||
| 388 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 389 | + EditStationObj.setEitdBPolygonGrid(''); | ||
| 390 | + // 加载编辑页面 | ||
| 391 | + $.get('edit.html', function (m) { | ||
| 1026 | $(pjaxContainer).append(m); | 392 | $(pjaxContainer).append(m); |
| 1027 | - $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,dir]); | 393 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); |
| 1028 | }); | 394 | }); |
| 1029 | - // }); | ||
| 1030 | - }, | ||
| 1031 | - addBetweenStationRoad : function (stationRouteId) { | ||
| 1032 | - $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) { | ||
| 1033 | - var stationRouteBegin = route[0]; | ||
| 1034 | - // 查询下一个站点 | ||
| 1035 | - $.get("/stationroute/findDownStationRoute",{"lineId":stationRouteBegin.stationRouteLine, "direction":stationRouteBegin.stationRoutedirections, "stationRouteCode":stationRouteBegin.stationRouteCode},function (stationRoute) { | ||
| 1036 | - var stationRouteFinish = stationRoute[0]; | ||
| 1037 | - | ||
| 1038 | - if(stationRouteFinish){ | ||
| 1039 | - var pointBegin = stationRouteBegin.stationJwpoints.split(" "); | ||
| 1040 | - var pointFinish = stationRouteFinish.stationJwpoints.split(" ") | ||
| 1041 | - console.log(pointFinish); | ||
| 1042 | - var sectionList = []; | ||
| 1043 | - // 两个站点的坐标 | ||
| 1044 | - var poiOne = new BMap.Point(pointBegin[0],pointBegin[1]); | ||
| 1045 | - var poiTwo = new BMap.Point(pointFinish[0],pointFinish[1]); | ||
| 1046 | - // 路径规划保存按钮 | ||
| 1047 | - var label = new BMap.Label("保存路段", { | ||
| 1048 | - offset: new BMap.Size(13, -53) | 395 | + }); |
| 396 | + | ||
| 397 | + // 编辑多变行 | ||
| 398 | + } else if (stationShapesTypeV == 'd') { | ||
| 399 | + // 获取中心点坐标字符串 | ||
| 400 | + var testpointStr = station.stationJwpoints; | ||
| 401 | + // 按空格切割中心点坐标字符串 | ||
| 402 | + var BJwpointsPolygon = testpointStr.split(' '); | ||
| 403 | + // 中心点坐标 | ||
| 404 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | ||
| 405 | + // 获取多边形坐标字符串 | ||
| 406 | + var stationBPolygonGrid = station.stationBPolyonGrid; | ||
| 407 | + // 截取多边形坐标字符串 | ||
| 408 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9, stationBPolygonGrid.length - 2); | ||
| 409 | + // 按逗号切割 | ||
| 410 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | ||
| 411 | + // 多边形坐标集合 | ||
| 412 | + var polygonP = []; | ||
| 413 | + for (var v = 0; v < pointPolygonArray.length; v++) { | ||
| 414 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0], pointPolygonArray[v].split(" ")[1])); | ||
| 415 | + } | ||
| 416 | + | ||
| 417 | + // 画多边形 | ||
| 418 | + polygon = new BMap.Polygon(polygonP, { | ||
| 419 | + // 线条显色 | ||
| 420 | + strokeColor: "red", | ||
| 421 | + // 边线的宽度,以像素为单位。 | ||
| 422 | + strokeWeight: 2, | ||
| 423 | + // 边线透明度,取值范围0 - 1。 | ||
| 424 | + strokeOpacity: 0.7 | ||
| 425 | + }); | ||
| 426 | + | ||
| 427 | + // 增加地图覆盖物多边形 | ||
| 428 | + mapBValue.addOverlay(polygon); | ||
| 429 | + | ||
| 430 | + // 开启编辑功能(自 1.1 新增) | ||
| 431 | + polygon.enableEditing(); | ||
| 432 | + | ||
| 433 | + // 添加多变行编辑事件 | ||
| 434 | + polygon.addEventListener('dblclick', function (e) { | ||
| 435 | + | ||
| 436 | + // 获取编辑的多边形对象 | ||
| 437 | + var edit_pointE = polygon; | ||
| 438 | + | ||
| 439 | + var edit_bPloygonGrid = ""; | ||
| 440 | + | ||
| 441 | + var editPolyGonLen_ = edit_pointE.getPath().length; | ||
| 442 | + | ||
| 443 | + for (var k = 0; k < editPolyGonLen_; k++) { | ||
| 444 | + | ||
| 445 | + if (k == 0) { | ||
| 446 | + | ||
| 447 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 448 | + | ||
| 449 | + } else { | ||
| 450 | + | ||
| 451 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 452 | + | ||
| 453 | + } | ||
| 454 | + | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | ||
| 458 | + | ||
| 459 | + // 多边形中心点 | ||
| 460 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | ||
| 461 | + | ||
| 462 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 463 | + EditStationObj.setEitdStationJwpoints(centre_points); | ||
| 464 | + | ||
| 465 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 466 | + EditStationObj.setEitdStationShapesType('d'); | ||
| 467 | + | ||
| 468 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 469 | + EditStationObj.setEitdStationRadius(''); | ||
| 470 | + | ||
| 471 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 472 | + EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid); | ||
| 473 | + | ||
| 474 | + $.get('edit.html', function (m) { | ||
| 475 | + | ||
| 476 | + $(pjaxContainer).append(m); | ||
| 477 | + | ||
| 478 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); | ||
| 479 | + | ||
| 480 | + }); | ||
| 481 | + | ||
| 482 | + }); | ||
| 483 | + | ||
| 484 | + } | ||
| 485 | + | ||
| 486 | + }, | ||
| 487 | + | ||
| 488 | + // 在地图上画出上行线路走向 | ||
| 489 | + /*drawingUpline: function (polylineArray, polyline_center, data) { | ||
| 490 | + /!*WorldsBMap.clearMarkAndOverlays();*!/ | ||
| 491 | + polyUpline = ''; | ||
| 492 | + // 创建线路走向 | ||
| 493 | + polyUpline = new BMap.Polyline(polylineArray, {strokeColor: "red", strokeWeight: 6, strokeOpacity: 0.7}); | ||
| 494 | + // polyUpline.data = data; | ||
| 495 | + // 把折线添加到地图上 | ||
| 496 | + mapBValue.addOverlay(polyUpline); | ||
| 497 | + /!*var ceter_index = Math.round(resultdata.length / 2); | ||
| 498 | + | ||
| 499 | + var ceterPointsStr = resultdata[ceter_index].bJwpoints; | ||
| 500 | + | ||
| 501 | + var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 502 | + | ||
| 503 | + var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*!/ | ||
| 504 | + var PanOptions_ = {noAnimation: true}; | ||
| 505 | + mapBValue.reset(); | ||
| 506 | + mapBValue.panTo(polyline_center, PanOptions_); | ||
| 507 | + mapBValue.panBy(500, -510, PanOptions_); | ||
| 508 | + mapBValue.setZoom(14); | ||
| 509 | + },*/ | ||
| 510 | + | ||
| 511 | + | ||
| 512 | + // 画路段走向 | ||
| 513 | + drawingUpline01: function (polyline_center, datas) { | ||
| 514 | + if (polyline_center && datas) { | ||
| 515 | + // 编辑路段数据 | ||
| 516 | + sectionArray = []; | ||
| 517 | + for (var d = 0; d < datas.length; d++) { | ||
| 518 | + var data = datas[d]; | ||
| 519 | + // 地图折线坐标点集合 | ||
| 520 | + var polylineArray = []; | ||
| 521 | + // 获取路段折线坐标字符串 | ||
| 522 | + var sectionBsectionVectorStr = data.sectionBsectionVector; | ||
| 523 | + if (sectionBsectionVectorStr == null) | ||
| 524 | + continue; | ||
| 525 | + // 切割段折线坐标字符串 | ||
| 526 | + var tempStr = sectionBsectionVectorStr.substring(11, sectionBsectionVectorStr.length - 1); | ||
| 527 | + // 分割折线坐标字符串 | ||
| 528 | + var lineArray = tempStr.split(','); | ||
| 529 | + for (var i = 0; i < lineArray.length; i++) { | ||
| 530 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0], lineArray[i].split(' ')[1])); | ||
| 531 | + } | ||
| 532 | + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | ||
| 533 | + // 创建线路走向 | ||
| 534 | + polyUpline01 = new BMap.Polyline(polylineArray, { | ||
| 535 | + strokeColor: "red", | ||
| 536 | + strokeWeight: 6, | ||
| 537 | + strokeOpacity: 0.7 | ||
| 538 | + }); | ||
| 539 | + polyUpline01.data = data; | ||
| 540 | + polyUpline01.ct_source = '1'; | ||
| 541 | + // 把折线添加到地图上 | ||
| 542 | + mapBValue.addOverlay(polyUpline01); | ||
| 543 | + // 聚焦事件 | ||
| 544 | + polyUpline01.addEventListener('mousemove', function (e) { | ||
| 545 | + if (this != editPolyline) | ||
| 546 | + this.setStrokeColor("#20bd26"); | ||
| 547 | + }); | ||
| 548 | + // 失去焦点 | ||
| 549 | + polyUpline01.addEventListener('mouseout', function (e) { | ||
| 550 | + if (this != editPolyline && this != road_win_show_p) | ||
| 551 | + this.setStrokeColor("red"); | ||
| 552 | + }); | ||
| 553 | + // 添加单击事件 | ||
| 554 | + polyUpline01.addEventListener('onclick', function (e) { | ||
| 555 | + // 打开信息窗口 | ||
| 556 | + if (map_status != 1) | ||
| 557 | + WorldsBMap.openSectionInfoWin(this); | ||
| 558 | + }); | ||
| 559 | + sectionArray.push(polyUpline01); | ||
| 560 | + } | ||
| 561 | + mapBValue.setCenter(polyline_center); | ||
| 562 | + mapBValue.setZoom(15); | ||
| 563 | + // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 564 | + // polyUpline01.disableMassClear(); | ||
| 565 | + } | ||
| 566 | + }, | ||
| 567 | + | ||
| 568 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 569 | + drawingUpStationPoint: function (station, s) { | ||
| 570 | + // 中心点坐标字符串 | ||
| 571 | + var bJwpointsStr = station.stationJwpoints; | ||
| 572 | + var stationName = station.stationRouteName; | ||
| 573 | + // 起个中心点坐标字符串 | ||
| 574 | + var bJwpointsArray = bJwpointsStr.split(' '); | ||
| 575 | + // 设置中心点 | ||
| 576 | + var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | ||
| 577 | + // 自定义标注物图片 | ||
| 578 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png', new BMap.Size(10, 10)); | ||
| 579 | + | ||
| 580 | + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">' | ||
| 581 | + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">' | ||
| 582 | + + '</div>' | ||
| 583 | + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">' + s + '</span>' + stationName + '</label>'; | ||
| 584 | + | ||
| 585 | + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center, { | ||
| 586 | + "title": stationName, | ||
| 587 | + "anchor": new BMap.Size(-10, 8), | ||
| 588 | + "enableDragging": true | ||
| 589 | + }); | ||
| 590 | + myRichMarker1.disableDragging(); | ||
| 591 | + myRichMarker1.ct_source = '1'; | ||
| 592 | + mapBValue.addOverlay(myRichMarker1); | ||
| 593 | + myRichMarker1.addEventListener('click', function () { | ||
| 594 | + if(map_status != 1) | ||
| 595 | + WorldsBMap.openStationInfoWin(station); | ||
| 596 | + }); | ||
| 597 | + stationArray[station.stationRouteId] = station; | ||
| 598 | + }, | ||
| 599 | + | ||
| 600 | + // 站点名称获取百度坐标(手动规划) | ||
| 601 | + stationsNameToPoints: function (arra, callback) { | ||
| 602 | + // 获取长度 | ||
| 603 | + var len = arra.length; | ||
| 604 | + var stationList = []; | ||
| 605 | + (function () { | ||
| 606 | + if (!arguments.callee.count) { | ||
| 607 | + arguments.callee.count = 0; | ||
| 608 | + } | ||
| 609 | + arguments.callee.count++; | ||
| 610 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 611 | + if (index >= len) { | ||
| 612 | + callback && callback(stationList); | ||
| 613 | + return; | ||
| 614 | + } | ||
| 615 | + var f = arguments.callee; | ||
| 616 | + if (arra[index].name != '') { | ||
| 617 | + var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 618 | + localSearch.search(arra[index].name); | ||
| 619 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 620 | + var poi = searchResult.getPoi(0); | ||
| 621 | + if (poi) { | ||
| 622 | + stationList.push({ | ||
| 623 | + name: arra[index].name.replace('公交车站', ''), | ||
| 624 | + wgs: arra[index].wgs, | ||
| 625 | + potion: {lng: poi.point.lng, lat: poi.point.lat} | ||
| 626 | + }); | ||
| 627 | + } else { | ||
| 628 | + stationList.push({ | ||
| 629 | + name: arra[index].name.replace('公交车站', ''), | ||
| 630 | + wgs: arra[index].wgs, | ||
| 631 | + potion: {lng: arra[index].wgs.x, lat: arra[index].wgs.y} | ||
| 1049 | }); | 632 | }); |
| 1050 | - label.setStyle({ | ||
| 1051 | - color: '#fff', | ||
| 1052 | - background:"url(/pages/base/stationroute/css/img/bg.png)", | ||
| 1053 | - border: '0px solid', | ||
| 1054 | - textAlign: "center", | ||
| 1055 | - height: "28px", | ||
| 1056 | - lineHeight: "26px", | ||
| 1057 | - width: "80px", | ||
| 1058 | - maxWidth: "none" | 633 | + } |
| 634 | + f(); | ||
| 635 | + }); | ||
| 636 | + } else { | ||
| 637 | + f(); | ||
| 638 | + } | ||
| 639 | + })(); | ||
| 640 | + }, | ||
| 641 | + | ||
| 642 | + // 根据坐标点获取两点之间的时间与距离(手动规划) | ||
| 643 | + getDistanceAndTotime: function (stationList, cb) { | ||
| 644 | + stationList[0].distance = ''; | ||
| 645 | + stationList[0].duration = ''; | ||
| 646 | + // var sectionList = []; | ||
| 647 | + // 获取长度 | ||
| 648 | + var len = stationList.length; | ||
| 649 | + (function () { | ||
| 650 | + if (!arguments.callee.count) { | ||
| 651 | + arguments.callee.count = 0; | ||
| 652 | + } | ||
| 653 | + arguments.callee.count++; | ||
| 654 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 655 | + if (index >= len - 1) { | ||
| 656 | + // cb && cb(stationList,sectionList); | ||
| 657 | + cb && cb(stationList); | ||
| 658 | + return; | ||
| 659 | + } | ||
| 660 | + var f = arguments.callee; | ||
| 661 | + var poiOne = new BMap.Point(stationList[index].potion.lng, stationList[index].potion.lat); | ||
| 662 | + var poiTwo = new BMap.Point(stationList[index + 1].potion.lng, stationList[index + 1].potion.lat); | ||
| 663 | + var transit = new BMap.TransitRoute(mapBValue, { | ||
| 664 | + renderOptions: {map: mapBValue}, | ||
| 665 | + onSearchComplete: searchComplete | ||
| 666 | + }); | ||
| 667 | + | ||
| 668 | + transit.search(poiOne, poiTwo); | ||
| 669 | + function searchComplete(results) { | ||
| 670 | + var plan = results.getPlan(0); | ||
| 671 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS) { | ||
| 672 | + stationList[index + 1].distance = ''; | ||
| 673 | + stationList[index + 1].duration = ''; | ||
| 674 | + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:''}); | ||
| 675 | + } else { | ||
| 676 | + stationList[index + 1].distance = plan.getDistance(true); | ||
| 677 | + stationList[index + 1].duration = plan.getDuration(true); | ||
| 678 | + // var line = plan.getRoute(0); | ||
| 679 | + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:line.getPath()}); | ||
| 680 | + } | ||
| 681 | + f(); | ||
| 682 | + } | ||
| 683 | + })(); | ||
| 684 | + }, | ||
| 685 | + | ||
| 686 | + // 根据坐标点获取两点之间的折线路段(手动规划) | ||
| 687 | + getSectionListPlonly: function (stationsPoint, cb) { | ||
| 688 | + var len = stationsPoint.length; | ||
| 689 | + var sectionList = []; | ||
| 690 | + (function () { | ||
| 691 | + if (!arguments.callee.count) { | ||
| 692 | + arguments.callee.count = 0; | ||
| 693 | + } | ||
| 694 | + arguments.callee.count++; | ||
| 695 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 696 | + if (index >= len - 1) { | ||
| 697 | + cb && cb(sectionList); | ||
| 698 | + return; | ||
| 699 | + } | ||
| 700 | + var f = arguments.callee; | ||
| 701 | + var poiOne = new BMap.Point(stationsPoint[index].potion.lng, stationsPoint[index].potion.lat); | ||
| 702 | + var poiTwo = new BMap.Point(stationsPoint[index + 1].potion.lng, stationsPoint[index + 1].potion.lat); | ||
| 703 | + /* var transit = new BMap.TransitRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet});*/ | ||
| 704 | + var transit = new BMap.DrivingRoute(mapBValue, { | ||
| 705 | + renderOptions: {map: mapBValue}, | ||
| 706 | + onPolylinesSet: searchPolylinesSet | ||
| 707 | + }); | ||
| 708 | + function searchPolylinesSet(results) { | ||
| 709 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS) { | ||
| 710 | + } else { | ||
| 711 | + var sectionArrayList = []; | ||
| 712 | + for (i = 0; i < results.length; i++) { | ||
| 713 | + // console.log(results[i].getPolyline().getPath()); | ||
| 714 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 715 | + } | ||
| 716 | + var sectionName = stationsPoint[index].name + '至' + stationsPoint[index + 1].name; | ||
| 717 | + sectionList.push({sectionName: sectionName, points: sectionArrayList}); | ||
| 718 | + } | ||
| 719 | + f(); | ||
| 720 | + } | ||
| 721 | + transit.search(poiOne, poiTwo); | ||
| 722 | + })(); | ||
| 723 | + }, | ||
| 724 | + | ||
| 725 | + localtionPoint: function (stationNameV) { | ||
| 726 | + // 关闭信息窗口 | ||
| 727 | + mapBValue.closeInfoWindow(); | ||
| 728 | + | ||
| 729 | + WorldsBMap.localSearchFromAdreesToPoint(stationNameV, function (Points) { | ||
| 730 | + | ||
| 731 | + if (Points) { | ||
| 732 | + | ||
| 733 | + var BJwpointsArray = Points.split(' '); | ||
| 734 | + | ||
| 735 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | ||
| 736 | + | ||
| 737 | + var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | ||
| 738 | + | ||
| 739 | + var PanOptions = {noAnimation: true}; | ||
| 740 | + | ||
| 741 | + mapBValue.panTo(stationNameChangePoint, PanOptions); | ||
| 742 | + | ||
| 743 | + mapBValue.panBy(0, -100); | ||
| 744 | + | ||
| 745 | + // 将标注添加到地图中 | ||
| 746 | + mapBValue.addOverlay(marker_stargt2); | ||
| 747 | + | ||
| 748 | + //跳动的动画 | ||
| 749 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | ||
| 750 | + | ||
| 751 | + } | ||
| 752 | + | ||
| 753 | + }); | ||
| 754 | + | ||
| 755 | + }, | ||
| 756 | + | ||
| 757 | + /** 系统规划抓去数据 @param lineNameValue:线路名称;i:方向*/ | ||
| 758 | + getBmapStationNames: function (lineNameValue, i, callback) { | ||
| 759 | + | ||
| 760 | + var busline = new BMap.BusLineSearch(mapBValue, { | ||
| 761 | + | ||
| 762 | + // 设置公交列表查询后的回调函数。参数:rs: BusListResult类型 | ||
| 763 | + onGetBusListComplete: function (BusListResult) { | ||
| 764 | + | ||
| 765 | + // 如果不为空 | ||
| 766 | + if (BusListResult) { | ||
| 767 | + | ||
| 768 | + //获取第一个公交列表显示到map上 | ||
| 769 | + var fstLine = BusListResult.getBusListItem(i); | ||
| 770 | + | ||
| 771 | + /*if(fstLine==undefined){ | ||
| 772 | + | ||
| 773 | + layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 774 | + | ||
| 775 | + layer.closeAll(); | ||
| 776 | + | ||
| 777 | + if(i==0){ | ||
| 778 | + | ||
| 779 | + $('#upToolsMobal').show(); | ||
| 780 | + | ||
| 781 | + }else if(i==1){ | ||
| 782 | + | ||
| 783 | + $('#downToolsMobal').show(); | ||
| 784 | + | ||
| 785 | + } | ||
| 786 | + | ||
| 787 | + return; | ||
| 1059 | }); | 788 | }); |
| 1060 | - label.addEventListener('click', function () { | ||
| 1061 | - var params = {}; | ||
| 1062 | - params.lineId = stationRouteBegin.stationRouteLine; | ||
| 1063 | - params.lineCode = stationRouteBegin.stationRouteLIneCode; | ||
| 1064 | - params.directions = stationRouteBegin.stationRoutedirections; | ||
| 1065 | - params.stationRouteBegin = stationRouteBegin.stationRouteName; | ||
| 1066 | - params.stationRouteFinish = stationRouteFinish.stationRouteName; | 789 | + |
| 790 | + }*/ | ||
| 791 | + | ||
| 792 | + if (fstLine == undefined) { | ||
| 793 | + | ||
| 794 | + | ||
| 795 | + callback && callback(null); | ||
| 796 | + | ||
| 797 | + } | ||
| 798 | + | ||
| 799 | + busline.getBusLine(fstLine); | ||
| 800 | + | ||
| 801 | + } | ||
| 802 | + | ||
| 803 | + }, | ||
| 804 | + | ||
| 805 | + //设置公交线路查询后的回调函数.参数:rs: BusLine类型 | ||
| 806 | + onGetBusLineComplete: function (BusLine) { | ||
| 807 | + | ||
| 808 | + // 如果不为空 | ||
| 809 | + if (BusLine) { | ||
| 810 | + | ||
| 811 | + callback && callback(BusLine); | ||
| 812 | + | ||
| 813 | + } | ||
| 814 | + | ||
| 815 | + } | ||
| 816 | + | ||
| 817 | + }); | ||
| 818 | + | ||
| 819 | + busline.getBusList(lineNameValue); | ||
| 820 | + | ||
| 821 | + }, | ||
| 822 | + // 修改站点 | ||
| 823 | + editStation: function (stationRouteId) { | ||
| 824 | + // $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) { | ||
| 825 | + $.get('edit_select.html', function (m) { | ||
| 826 | + $(pjaxContainer).append(m); | ||
| 827 | + $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap, DrawingManagerObj, GetAjaxData, EditStationObj, LineObj, PublicFunctions, stationArray[stationRouteId]]); | ||
| 828 | + }); | ||
| 829 | + // }); | ||
| 830 | + }, | ||
| 831 | + addBetweenStationRoad: function (stationRouteId) { | ||
| 832 | + // 关闭信息窗口 | ||
| 833 | + mapBValue.closeInfoWindow(); | ||
| 834 | + $.get("/stationroute/findStationRouteInfo", {"id": stationRouteId}, function (route) { | ||
| 835 | + var stationRouteBegin = route[0]; | ||
| 836 | + // 查询下一个站点 | ||
| 837 | + $.get("/stationroute/findDownStationRoute", { | ||
| 838 | + "lineId": stationRouteBegin.stationRouteLine, | ||
| 839 | + "direction": stationRouteBegin.stationRoutedirections, | ||
| 840 | + "stationRouteCode": stationRouteBegin.stationRouteCode | ||
| 841 | + }, function (stationRoute) { | ||
| 842 | + var stationRouteFinish = stationRoute[0]; | ||
| 843 | + | ||
| 844 | + if (stationRouteFinish) { | ||
| 845 | + var pointBegin = stationRouteBegin.stationJwpoints.split(" "); | ||
| 846 | + var pointFinish = stationRouteFinish.stationJwpoints.split(" ") | ||
| 847 | + var sectionList = []; | ||
| 848 | + // 两个站点的坐标 | ||
| 849 | + var poiOne = new BMap.Point(pointBegin[0], pointBegin[1]); | ||
| 850 | + var poiTwo = new BMap.Point(pointFinish[0], pointFinish[1]); | ||
| 851 | + // 路径规划保存按钮 | ||
| 852 | + var label = new BMap.Label("保存路段", { | ||
| 853 | + offset: new BMap.Size(13, -53) | ||
| 854 | + }); | ||
| 855 | + label.setStyle({ | ||
| 856 | + color: '#fff', | ||
| 857 | + background: "url(/pages/base/stationroute/css/img/bg.png)", | ||
| 858 | + border: '0px solid', | ||
| 859 | + textAlign: "center", | ||
| 860 | + height: "28px", | ||
| 861 | + lineHeight: "26px", | ||
| 862 | + width: "80px", | ||
| 863 | + maxWidth: "none" | ||
| 864 | + }); | ||
| 865 | + label.addEventListener('click', function () { | ||
| 866 | + var params = {}; | ||
| 867 | + params.lineId = stationRouteBegin.stationRouteLine; | ||
| 868 | + params.lineCode = stationRouteBegin.stationRouteLIneCode; | ||
| 869 | + params.directions = stationRouteBegin.stationRoutedirections; | ||
| 870 | + params.stationRouteBegin = stationRouteBegin.stationRouteName; | ||
| 871 | + params.stationRouteFinish = stationRouteFinish.stationRouteName; | ||
| 872 | + layer.confirm('确定保存', { | ||
| 873 | + btn : [ '路段调整好了','继续调整','退出'], icon: 3, title:'提示' | ||
| 874 | + ,btn3: function(index, layero){ | ||
| 875 | + PublicFunctions.resjtreeDate(params.lineId,params.directions); | ||
| 876 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 877 | + GetAjaxData.getSectionRouteInfo(params.lineId,params.directions,function(data) { | ||
| 878 | + PublicFunctions.linePanlThree(params.lineId,data,params.directions); | ||
| 879 | + }); | ||
| 880 | + PublicFunctions.editMapStatusRemove(); | ||
| 881 | + } | ||
| 882 | + }, function(index, layero){ | ||
| 883 | + layer.close(index); | ||
| 1067 | params.route = $("#routePlanning").val(); | 884 | params.route = $("#routePlanning").val(); |
| 1068 | - $.get('doublename_road.html', function(m){ | 885 | + $.get('doublename_road.html', function (m) { |
| 1069 | $(pjaxContainer).append(m); | 886 | $(pjaxContainer).append(m); |
| 1070 | - $('#doublename_road_mobal').trigger('doubleNameRoadMobal_show', [params,WorldsBMap,GetAjaxData,PublicFunctions]); | 887 | + $('#doublename_road_mobal').trigger('doubleNameRoadMobal_show', [params, WorldsBMap, GetAjaxData, PublicFunctions]); |
| 1071 | }); | 888 | }); |
| 889 | + PublicFunctions.editMapStatusRemove(); | ||
| 1072 | }); | 890 | }); |
| 1073 | - // 路径规划 | ||
| 1074 | - var transit = new BMap.DrivingRoute(mapBValue, {renderOptions: {map: mapBValue,enableDragging : true},onPolylinesSet: searchPolylinesSet}); | ||
| 1075 | - function searchPolylinesSet(results){ | ||
| 1076 | - if (transit.getStatus() == BMAP_STATUS_SUCCESS){ | ||
| 1077 | - var sectionArrayList = []; | ||
| 1078 | - for (i = 0; i < results.length; i++){ | ||
| 1079 | - sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 1080 | - } | ||
| 1081 | - sectionList = sectionArrayList;//JSON.stringify() | ||
| 1082 | - $("#routePlanning").val(JSON.stringify(sectionArrayList)); | ||
| 1083 | - var pointMap = new Map(); | ||
| 1084 | - pointMap = sectionArrayList[sectionArrayList.length-1]; | ||
| 1085 | - var pointLabel = new BMap.Point(pointMap.lng,pointMap.lat); | ||
| 1086 | - label.enableMassClear(); | ||
| 1087 | - label.setPosition(pointLabel); | ||
| 1088 | - mapBValue.addOverlay(label); | 891 | + }); |
| 892 | + // 路径规划 | ||
| 893 | + var transit = new BMap.DrivingRoute(mapBValue, { | ||
| 894 | + renderOptions: { | ||
| 895 | + map: mapBValue, | ||
| 896 | + enableDragging: true | ||
| 897 | + }, | ||
| 898 | + onPolylinesSet: searchPolylinesSet | ||
| 899 | + }); | ||
| 900 | + | ||
| 901 | + function searchPolylinesSet(results) { | ||
| 902 | + if (transit.getStatus() == BMAP_STATUS_SUCCESS) { | ||
| 903 | + var sectionArrayList = []; | ||
| 904 | + for (i = 0; i < results.length; i++) { | ||
| 905 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 1089 | } | 906 | } |
| 907 | + sectionList = sectionArrayList;//JSON.stringify() | ||
| 908 | + $("#routePlanning").val(JSON.stringify(sectionArrayList)); | ||
| 909 | + var pointMap = new Map(); | ||
| 910 | + pointMap = sectionArrayList[sectionArrayList.length - 1]; | ||
| 911 | + var pointLabel = new BMap.Point(pointMap.lng, pointMap.lat); | ||
| 912 | + label.enableMassClear(); | ||
| 913 | + label.setPosition(pointLabel); | ||
| 914 | + mapBValue.addOverlay(label); | ||
| 1090 | } | 915 | } |
| 1091 | - transit.search(poiOne,poiTwo); | ||
| 1092 | - transit.disableAutoViewport(); | ||
| 1093 | - } else { | ||
| 1094 | - layer.msg("您选择的站点后没有站点了,不能生成站点间路段!") | ||
| 1095 | - } | 916 | + } |
| 917 | + transit.search(poiOne, poiTwo); | ||
| 918 | + transit.disableAutoViewport(); | ||
| 919 | + // 地图编辑状态 | ||
| 920 | + PublicFunctions.editMapStatus(); | ||
| 921 | + } else { | ||
| 922 | + layer.msg("您选择的站点后没有站点了,不能生成站点间路段!") | ||
| 923 | + } | ||
| 1096 | 924 | ||
| 925 | + }); | ||
| 926 | + }); | ||
| 927 | + | ||
| 928 | + }, | ||
| 929 | + // 定位路段 | ||
| 930 | + focusSection: function(sectionRoudId) { | ||
| 931 | + for (var i = 0, p; p = sectionArray[i++];) { | ||
| 932 | + if (p.data.sectionrouteId == sectionRoudId) { | ||
| 933 | + WorldsBMap.openSectionInfoWin(p); | ||
| 934 | + break; | ||
| 935 | + } | ||
| 936 | + } | ||
| 937 | + }, | ||
| 938 | + // 编辑路段 | ||
| 939 | + editSection : function(sectionRoudId) { | ||
| 940 | + layer.confirm('进入编辑状态', { | ||
| 941 | + btn : [ '确定','返回' ], icon: 3, title:'提示' | ||
| 942 | + }, function() { | ||
| 943 | + PublicFunctions.editMapStatus(); | ||
| 944 | + layer.msg('双击保存路段'); | ||
| 945 | + var p; | ||
| 946 | + for (var i = 0; p = sectionArray[i++];) { | ||
| 947 | + if (p.data.sectionrouteId == sectionRoudId) { | ||
| 948 | + mapBValue.closeInfoWindow();//关闭infoWindow | ||
| 949 | + p.enableEditing(); | ||
| 950 | + p.setStrokeColor('blue'); | ||
| 951 | + editPolyline = p; | ||
| 952 | + break; | ||
| 953 | + } | ||
| 954 | + } | ||
| 955 | + p.addEventListener('dblclick', function () { | ||
| 956 | + /** 设置修改路段集合对象为空 */ | ||
| 957 | + editPolyline = ''; | ||
| 958 | + PublicFunctions.editMapStatusRemove(); | ||
| 959 | + $.get('editsection.html', function(m){ | ||
| 960 | + $('body').append(m); | ||
| 961 | + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,p,PublicFunctions]); | ||
| 962 | + }); | ||
| 963 | + }); | ||
| 964 | + }); | ||
| 965 | + }, | ||
| 966 | + // 添加在路段之后 | ||
| 967 | + addSection : function(stecion) { | ||
| 968 | + PublicFunctions.editMapStatus(); | ||
| 969 | + // 把数据填充到模版中 | ||
| 970 | + var addSectionHTML = template('add_draw_polyline-temp'); | ||
| 971 | + $('body .mian-portlet-body').append(addSectionHTML); | ||
| 972 | + //暂停和开始绘制 | ||
| 973 | + $('.draw_polyline_switch>a').on('click', function () { | ||
| 974 | + var t = $(this).text(); | ||
| 975 | + if(t=='暂停绘制'){ | ||
| 976 | + WorldsBMap.exitDrawStatus(); | ||
| 977 | + $(this).text('开始绘制'); | ||
| 978 | + } | ||
| 979 | + else{ | ||
| 980 | + WorldsBMap.openDrawStatus(); | ||
| 981 | + $(this).text('暂停绘制'); | ||
| 982 | + } | ||
| 983 | + }); | ||
| 984 | + // 开启绘制事件 | ||
| 985 | + WorldsBMap.showAddSectionPanel(stecion); | ||
| 986 | + | ||
| 987 | + //取消 | ||
| 988 | + $('#addSectionCancelBtn').on('click', function () { | ||
| 989 | + $('.main_left_panel_m_layer').hide(); | ||
| 990 | + $(this).parents('.buffer_edit_body').parent().remove(); | ||
| 991 | + WorldsBMap.exitDrawStatus(); | ||
| 992 | + PublicFunctions.editMapStatusRemove(); | ||
| 993 | + }); | ||
| 994 | + | ||
| 995 | + //确定 | ||
| 996 | + $('#addSectionSbmintBtn').on('click', function () { | ||
| 997 | + var btn = this; | ||
| 998 | + $('#addSectionSbmintBtn').addClass("disabled"); | ||
| 999 | + var sectionName = $('#sectionNameInput').val(); | ||
| 1000 | + var bsectionVector = $('#bsectionVectorInput').val(); | ||
| 1001 | + var params = {}; | ||
| 1002 | + if(sectionName && bsectionVector) { | ||
| 1003 | + WorldsBMap.exitDrawStatus(); | ||
| 1004 | + GetAjaxData.getSectionCode(function(sectionCode) { | ||
| 1005 | + var lineId = stecion.lineId; | ||
| 1006 | + var dir = stecion.dir; | ||
| 1007 | + params.lineId = lineId; | ||
| 1008 | + params.lineCode = stecion.lineCode; | ||
| 1009 | + params.sectionCode = sectionCode;// 设值路段编码. | ||
| 1010 | + params.sectionName = sectionName; | ||
| 1011 | + params.roadCoding = ''; | ||
| 1012 | + params.dbType = 'b'; | ||
| 1013 | + params.bsectionVector = bsectionVector; | ||
| 1014 | + params.sectionrouteCode = 1; | ||
| 1015 | + params.sectionTime = 0; | ||
| 1016 | + params.sectionDistance = 60; | ||
| 1017 | + params.speedLimit = 0; | ||
| 1018 | + params.versions = stecion.versions; | ||
| 1019 | + params.destroy = 0; | ||
| 1020 | + params.directions = dir; | ||
| 1021 | + params.descriptions = ''; | ||
| 1022 | + GetAjaxData.sectionSave(params, function (result) { | ||
| 1023 | + if(result.status =="SUCCESS"){ | ||
| 1024 | + $('.main_left_panel_m_layer').hide(); | ||
| 1025 | + $(btn).parents('.buffer_edit_body').parent().remove(); | ||
| 1026 | + PublicFunctions.editMapStatusRemove(); | ||
| 1027 | + PublicFunctions.resjtreeDate(lineId,dir); | ||
| 1028 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 1029 | + GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) { | ||
| 1030 | + PublicFunctions.linePanlThree(lineId,data,dir); | ||
| 1031 | + }); | ||
| 1032 | + layer.msg("添加成功!"); | ||
| 1033 | + } else if(result.status =="ERROR") { | ||
| 1034 | + layer.msg("添加失败!"); | ||
| 1035 | + } | ||
| 1036 | + }); | ||
| 1037 | + }); | ||
| 1038 | + } else if(sectionName){ | ||
| 1039 | + layer.msg('请填写路段名字!'); | ||
| 1040 | + } else if(bsectionVector){ | ||
| 1041 | + layer.msg('请填先绘制路段!'); | ||
| 1042 | + } | ||
| 1043 | + setTimeout(function () { | ||
| 1044 | + $("#addSectionSbmintBtn").removeClass("disabled"); | ||
| 1045 | + },1000); | ||
| 1046 | + }); | ||
| 1047 | + }, | ||
| 1048 | + // 添加在路段之后 | ||
| 1049 | + addSectionAfter : function(sectionRoudId) { | ||
| 1050 | + //order = after before; | ||
| 1051 | + var beforeSection; | ||
| 1052 | + // 关闭信息窗口 | ||
| 1053 | + mapBValue.closeInfoWindow(); | ||
| 1054 | + PublicFunctions.editMapStatus(); | ||
| 1055 | + // 把数据填充到模版中 | ||
| 1056 | + var addSectionHTML = template('add_draw_polyline-temp',{ 'id': sectionRoudId}); | ||
| 1057 | + $('body .mian-portlet-body').append(addSectionHTML); | ||
| 1058 | + //暂停和开始绘制 | ||
| 1059 | + $('.draw_polyline_switch>a').on('click', function () { | ||
| 1060 | + var t = $(this).text(); | ||
| 1061 | + if(t=='暂停绘制'){ | ||
| 1062 | + WorldsBMap.exitDrawStatus(); | ||
| 1063 | + $(this).text('开始绘制'); | ||
| 1064 | + } | ||
| 1065 | + else{ | ||
| 1066 | + WorldsBMap.openDrawStatus(); | ||
| 1067 | + $(this).text('暂停绘制'); | ||
| 1068 | + } | ||
| 1069 | + }); | ||
| 1070 | + | ||
| 1071 | + //取消 | ||
| 1072 | + $('#addSectionCancelBtn').on('click', function () { | ||
| 1073 | + $('.main_left_panel_m_layer').hide(); | ||
| 1074 | + $(this).parents('.buffer_edit_body').parent().remove(); | ||
| 1075 | + WorldsBMap.exitDrawStatus(); | ||
| 1076 | + PublicFunctions.editMapStatusRemove(); | ||
| 1077 | + }); | ||
| 1078 | + GetAjaxData.getSectionRouteInfoById(sectionRoudId, function(data){ | ||
| 1079 | + WorldsBMap.showAddSectionPanel(data[0]); | ||
| 1080 | + beforeSection = data[0]; | ||
| 1081 | + }); | ||
| 1082 | + | ||
| 1083 | + //确定 | ||
| 1084 | + $('#addSectionSbmintBtn').on('click', function () { | ||
| 1085 | + var btn = this; | ||
| 1086 | + $('#addSectionSbmintBtn').addClass("disabled"); | ||
| 1087 | + var sectionName = $('#sectionNameInput').val(); | ||
| 1088 | + var params = {}; | ||
| 1089 | + if(sectionName) { | ||
| 1090 | + WorldsBMap.exitDrawStatus(); | ||
| 1091 | + GetAjaxData.getSectionCode(function(sectionCode) { | ||
| 1092 | + var lineId = beforeSection.sectionRouteLine | ||
| 1093 | + var dir = beforeSection.sectionRouteDirections | ||
| 1094 | + params.lineId = lineId; | ||
| 1095 | + params.lineCode = beforeSection.sectionRouteLineCode; | ||
| 1096 | + params.sectionCode = sectionCode;// 设值路段编码. | ||
| 1097 | + params.sectionName = sectionName; | ||
| 1098 | + params.roadCoding = ''; | ||
| 1099 | + params.dbType = 'b'; | ||
| 1100 | + params.bsectionVector = $('#bsectionVectorInput').val(); | ||
| 1101 | + params.sectionrouteCode = beforeSection.sectionRouteCode+"_0"; | ||
| 1102 | + params.sectionTime = 0; | ||
| 1103 | + params.sectionDistance = 60; | ||
| 1104 | + params.speedLimit = 0; | ||
| 1105 | + params.versions = beforeSection.sectionVersion; | ||
| 1106 | + params.destroy = 0; | ||
| 1107 | + params.directions = dir; | ||
| 1108 | + params.descriptions = ''; | ||
| 1109 | + GetAjaxData.sectionSave(params, function (result) { | ||
| 1110 | + if(result.status =="SUCCESS"){ | ||
| 1111 | + $('.main_left_panel_m_layer').hide(); | ||
| 1112 | + $(btn).parents('.buffer_edit_body').parent().remove(); | ||
| 1113 | + PublicFunctions.editMapStatusRemove(); | ||
| 1114 | + PublicFunctions.resjtreeDate(lineId,dir); | ||
| 1115 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 1116 | + GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) { | ||
| 1117 | + PublicFunctions.linePanlThree(lineId,data,dir); | ||
| 1118 | + }); | ||
| 1119 | + layer.msg("添加成功!"); | ||
| 1120 | + } else if(result.status =="ERROR") { | ||
| 1121 | + layer.msg("添加失败!"); | ||
| 1122 | + } | ||
| 1123 | + }); | ||
| 1124 | + }); | ||
| 1125 | + } else { | ||
| 1126 | + layer.msg('请填写路段名字'); | ||
| 1127 | + } | ||
| 1128 | + setTimeout(function () { | ||
| 1129 | + $("#addSectionSbmintBtn").removeClass("disabled"); | ||
| 1130 | + },1000); | ||
| 1131 | + }); | ||
| 1132 | + }, | ||
| 1133 | + // 撤销站点 | ||
| 1134 | + destroyStation : function(stationRouteId,lineId,dir) { | ||
| 1135 | + layer.confirm('你确定要撤销此站点吗?', { | ||
| 1136 | + btn : [ '撤销','返回' ], icon: 3, title:'提示' | ||
| 1137 | + }, function(){ | ||
| 1138 | + $.post('/stationroute/stationRouteIsDestroy',{'stationRouteId':stationRouteId,destroy:'1'},function(resuntDate) { | ||
| 1139 | + if (resuntDate.status == 'SUCCESS') { | ||
| 1140 | + // 弹出添加成功提示消息 | ||
| 1141 | + layer.msg('撤销成功!'); | ||
| 1142 | + } else { | ||
| 1143 | + // 弹出添加失败提示消息 | ||
| 1144 | + layer.msg('撤销失败!'); | ||
| 1145 | + } | ||
| 1146 | + // 刷新左边树 | ||
| 1147 | + PublicFunctions.resjtreeDate(lineId,dir); | ||
| 1148 | + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | ||
| 1149 | + GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) { | ||
| 1150 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | ||
| 1151 | + PublicFunctions.linePanlThree(lineId,data,dir); | ||
| 1152 | + }); | ||
| 1153 | + }); | ||
| 1154 | + }); | ||
| 1155 | + }, | ||
| 1156 | + // 撤销路段 | ||
| 1157 | + destroySection : function(sectionRoudId,lineId,dir) { | ||
| 1158 | + layer.confirm('你确定要撤销此路段吗?', { | ||
| 1159 | + btn : [ '撤销','返回' ], icon: 3, title:'提示' | ||
| 1160 | + }, function(){ | ||
| 1161 | + $.post('/sectionroute/destroy',{'id': sectionRoudId},function(resuntDate) { | ||
| 1162 | + if (resuntDate.status == 'SUCCESS') { | ||
| 1163 | + // 弹出添加成功提示消息 | ||
| 1164 | + layer.msg('撤销成功!'); | ||
| 1165 | + } else { | ||
| 1166 | + // 弹出添加失败提示消息 | ||
| 1167 | + layer.msg('撤销失败!'); | ||
| 1168 | + } | ||
| 1169 | + // 刷新左边树 | ||
| 1170 | + PublicFunctions.resjtreeDate(lineId,dir); | ||
| 1171 | + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | ||
| 1172 | + GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) { | ||
| 1173 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | ||
| 1174 | + PublicFunctions.linePanlThree(lineId,data,dir); | ||
| 1097 | }); | 1175 | }); |
| 1098 | }); | 1176 | }); |
| 1177 | + }); | ||
| 1178 | + }, | ||
| 1179 | + // 打开路段信息窗口 | ||
| 1180 | + openSectionInfoWin : function(p) { | ||
| 1181 | + var section = p.data; | ||
| 1182 | + var width = WorldsBMap.strGetLength(section.sectionName) * 10; | ||
| 1183 | + // 信息窗口参数属性 | ||
| 1184 | + var opts = { | ||
| 1185 | + // 信息窗口宽度 | ||
| 1186 | + width: (width < 200 ? 200 : width), | ||
| 1187 | + // 信息窗口高度 | ||
| 1188 | + height: 150, | ||
| 1189 | + //设置不允许信窗发送短息 | ||
| 1190 | + enableMessage: false, | ||
| 1191 | + //是否开启点击地图关闭信息窗口 | ||
| 1192 | + enableCloseOnClick: false, | ||
| 1193 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 1194 | + enableAutoPan: false | ||
| 1195 | + }; | ||
| 1196 | + var htm = '<span style="color: #ff8355;font-size: 18px;">' + section.sectionName + '</span>' + | ||
| 1197 | + '<span class="help-block" >路段编码:' + section.sectionCode + '</span>' + | ||
| 1198 | + '<span class="help-block" >路段序号:' + section.sectionrouteCode + '</span>' + | ||
| 1199 | + '<span class="help-block" >版本号  :' + section.versions + '</span>' + | ||
| 1200 | + '<div >' + | ||
| 1201 | + '<button class="info_win_btn" id="editStation" onclick="WorldsBMap.editSection(' + section.sectionrouteId + ')">修改</button>' + | ||
| 1202 | + '<button class="info_win_btn" id="addSectionAfter" onclick="WorldsBMap.addSectionAfter('+section.sectionrouteId+')">添加(之后)</button>' + | ||
| 1203 | + '<button class="info_win_btn" id="addBetweenStationRoad" onclick="WorldsBMap.destroySection('+ section.sectionrouteId + ','+section.sectionrouteLine+','+section.sectionrouteDirections+')">撤销</button>' + | ||
| 1204 | + '</div>'; | ||
| 1205 | + | ||
| 1206 | + // 创建信息窗口 | ||
| 1207 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 1208 | + // 切割段折线坐标字符串 | ||
| 1209 | + var sectionStr = section.sectionBsectionVector.substring(11, section.sectionBsectionVector.length - 1); | ||
| 1210 | + // 分割折线坐标字符串 | ||
| 1211 | + var lineArray = sectionStr.split(','); | ||
| 1212 | + var sectionArray = []; | ||
| 1213 | + for (var i = 0; i < lineArray.length; i++) { | ||
| 1214 | + sectionArray.push(new BMap.Point(lineArray[i].split(' ')[0], lineArray[i].split(' ')[1])); | ||
| 1215 | + } | ||
| 1216 | + // 计算中间点 | ||
| 1217 | + var index = parseInt(sectionArray.length / 2); | ||
| 1218 | + var centerPoint = sectionArray[index]; | ||
| 1219 | + //close event | ||
| 1220 | + infoWindow_target.addEventListener('close', function (e) { | ||
| 1221 | + p.setStrokeColor("red"); | ||
| 1222 | + road_win_show_p = null; | ||
| 1223 | + }); | ||
| 1224 | + //open event | ||
| 1225 | + infoWindow_target.addEventListener('open', function (e) { | ||
| 1226 | + p.setStrokeColor("#20bd26"); | ||
| 1227 | + road_win_show_p = p; | ||
| 1228 | + }); | ||
| 1229 | + //开启信息窗口 | ||
| 1230 | + mapBValue.openInfoWindow(infoWindow_target, centerPoint); | ||
| 1231 | + mapBValue.setZoom(18); | ||
| 1232 | + mapBValue.setCenter(centerPoint); | ||
| 1233 | + }, | ||
| 1234 | + /** | ||
| 1235 | + * 绘制新增路段 | ||
| 1236 | + * @param section | ||
| 1237 | + */ | ||
| 1238 | + showAddSectionPanel : function (section) { | ||
| 1239 | + var point; | ||
| 1240 | + if(section){ | ||
| 1241 | + var sectionBsectionVectorStr = section.sectionBsectionVector; | ||
| 1242 | + var line = sectionBsectionVectorStr.substring(11, sectionBsectionVectorStr.length - 1), | ||
| 1243 | + points = line.split(','), | ||
| 1244 | + pointStr = points[points.length-1].split(' '); | ||
| 1245 | + | ||
| 1246 | + point = new BMap.Point(pointStr[0], pointStr[1]); | ||
| 1247 | + } | ||
| 1248 | + | ||
| 1249 | + mapBValue.centerAndZoom(point, 18); | ||
| 1250 | + | ||
| 1251 | + //开启鼠标绘制 | ||
| 1252 | + drawingManager = new BMapLib.DrawingManager(mapBValue, { | ||
| 1253 | + polylineOptions: styleOptions | ||
| 1254 | + }); | ||
| 1255 | + | ||
| 1256 | + drawingManager.open(); | ||
| 1257 | + //drawingManager.enableCalculate(); | ||
| 1258 | + drawingManager.setDrawingMode('polyline'); | ||
| 1259 | + | ||
| 1260 | + //绘制完成 | ||
| 1261 | + drawingManager.addEventListener('polylinecomplete', function (e) { | ||
| 1262 | + console.log('eee', e, e.getPath()); | ||
| 1263 | + drawingManager.close(); | ||
| 1264 | + | ||
| 1265 | + var polyline = new BMap.Polyline(e.getPath(), {strokeWeight: 7, strokeColor: 'blue', strokeOpacity: 0.7}); | ||
| 1266 | + | ||
| 1267 | + mapBValue.removeOverlay(e); | ||
| 1268 | + mapBValue.addOverlay(polyline); | ||
| 1269 | + polyline.enableEditing(); | ||
| 1270 | + | ||
| 1271 | + editPolyline = polyline; | ||
| 1272 | + var sectionData = e.getPath();// 获取折线坐标集合 | ||
| 1273 | + $('#bsectionVectorInput').val(JSON.stringify(sectionData)); | ||
| 1274 | + }); | ||
| 1275 | + }, | ||
| 1276 | + exitDrawStatus : function () { | ||
| 1277 | + if (drawingManager) { | ||
| 1278 | + WorldsBMap.clearOtherOverlay(); | ||
| 1279 | + drawingManager.close(); | ||
| 1280 | + } | ||
| 1281 | + }, | ||
| 1282 | + openDrawStatus : function () { | ||
| 1283 | + if (drawingManager) { | ||
| 1284 | + WorldsBMap.clearOtherOverlay(); | ||
| 1285 | + drawingManager.open(); | ||
| 1286 | + } | ||
| 1287 | + }, | ||
| 1288 | + /** 清楚无需要的覆盖物(非站点/路段数据源)*/ | ||
| 1289 | + clearOtherOverlay : function () { | ||
| 1290 | + var all = mapBValue.getOverlays(); | ||
| 1291 | + for (var i = 0, obj; obj = all[i++];) { | ||
| 1292 | + if (obj.ct_source && obj.ct_source == '1') | ||
| 1293 | + continue; | ||
| 1294 | + mapBValue.removeOverlay(obj); | ||
| 1295 | + } | ||
| 1296 | + }, | ||
| 1297 | + clearMarkAndOverlays: function () { | ||
| 1298 | + // 清楚地图覆盖物 | ||
| 1299 | + mapBValue.clearOverlays(); | ||
| 1300 | + mapBValue.removeOverlay(); | ||
| 1301 | + }, | ||
| 1302 | + clearMark: function () { | ||
| 1303 | + // 清楚地图覆盖物 | ||
| 1304 | + mapBValue.removeOverlay(); | ||
| 1305 | + }, | ||
| 1306 | + strGetLength: function (str) { | ||
| 1307 | + return str.replace(/[\u0391-\uFFE5]/g, "aa").length; //先把中文替换成两个字节的英文,在计算长度 | ||
| 1308 | + } | ||
| 1309 | + } | ||
| 1310 | + | ||
| 1311 | + return Bmap; | ||
| 1099 | 1312 | ||
| 1100 | - }, | ||
| 1101 | - | ||
| 1102 | - clearMarkAndOverlays : function() { | ||
| 1103 | - | ||
| 1104 | - // 清楚地图覆盖物 | ||
| 1105 | - mapBValue.clearOverlays(); | ||
| 1106 | - | ||
| 1107 | - mapBValue.removeOverlay(); | ||
| 1108 | - | ||
| 1109 | - } | ||
| 1110 | - | ||
| 1111 | - } | ||
| 1112 | - | ||
| 1113 | - return Bmap; | ||
| 1114 | - | ||
| 1115 | }(); | 1313 | }(); |
| 1116 | \ No newline at end of file | 1314 | \ No newline at end of file |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
| @@ -22,44 +22,7 @@ var StationTreeData = function(){ | @@ -22,44 +22,7 @@ var StationTreeData = function(){ | ||
| 22 | EditSectionObj.setEitdSection({}); | 22 | EditSectionObj.setEitdSection({}); |
| 23 | 23 | ||
| 24 | } | 24 | } |
| 25 | - | ||
| 26 | - function upIsEidtStauts(shapesTypeT,chaildredType,data) { | ||
| 27 | - | ||
| 28 | - // 关闭弹出层 | ||
| 29 | - layer.closeAll(); | ||
| 30 | - | ||
| 31 | - // 选中的是站点 | ||
| 32 | - if(chaildredType =='station') { | ||
| 33 | - | ||
| 34 | - // 如果是圆 | ||
| 35 | - if(shapesTypeT =='r') { | ||
| 36 | - | ||
| 37 | - // 百度地图画圆 | ||
| 38 | - WorldsBMap.pointsCircle(data); | ||
| 39 | - | ||
| 40 | - // 如果是多边形 | ||
| 41 | - }else if(shapesTypeT == 'd') { | ||
| 42 | - | ||
| 43 | - // 百度地图画多边形 | ||
| 44 | - WorldsBMap.pointsPolygon(data); | ||
| 45 | - | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - // 选中的是路段 | ||
| 49 | - }else if(chaildredType =='section'){ | ||
| 50 | - // 路段矢量坐标点 | ||
| 51 | - var polylineArray = [data]; | ||
| 52 | - // 路段方向 | ||
| 53 | - var dire_ = data.sectionrouteDirections; | ||
| 54 | - // 线路ID | ||
| 55 | - var Line = LineObj.getLineObj(); | ||
| 56 | - /*// 百度地图画路段 | ||
| 57 | - PublicFunctions.linePanlThree(Line.id,polylineArray,dire_);*/ | ||
| 58 | - // 百度地图画路段 | ||
| 59 | - PublicFunctions.treeSectionClick(Line.id,polylineArray,dire_); | ||
| 60 | - } | ||
| 61 | - } | ||
| 62 | - | 25 | + |
| 63 | function TreeOnclickEvent(treeOjb) { | 26 | function TreeOnclickEvent(treeOjb) { |
| 64 | if(treeOjb==null) | 27 | if(treeOjb==null) |
| 65 | return; | 28 | return; |
| @@ -70,64 +33,15 @@ var StationTreeData = function(){ | @@ -70,64 +33,15 @@ var StationTreeData = function(){ | ||
| 70 | } | 33 | } |
| 71 | // 获取数据 | 34 | // 获取数据 |
| 72 | var stationData = treeOjb[0].original; | 35 | var stationData = treeOjb[0].original; |
| 73 | - // 站点范围类型 | ||
| 74 | - var shapesType_ = stationData.stationShapesType; | ||
| 75 | - // 选中的节点类型 | ||
| 76 | - var chaildredType_ = stationData.chaildredType; | ||
| 77 | - // 选中的其它节点 | ||
| 78 | - if(chaildredType_ ==null){ | ||
| 79 | - return; | ||
| 80 | - } | ||
| 81 | - var edtsta = EditStationObj.getEitdStation(); | ||
| 82 | - var edtste = EditSectionObj.getEitdSection(); | ||
| 83 | - if(!$.isEmptyObject(edtsta)){ | ||
| 84 | - var stationName = edtsta.stationStationName; | ||
| 85 | - var txType = edtsta.stationShapesType; | ||
| 86 | - // 是否继续弹出层 | ||
| 87 | - layer.confirm('您正处于站点【'+stationName+'】的编辑状态!是否退出!', { | ||
| 88 | - btn : [ '确认并退出', '返回并继续' ] | ||
| 89 | - }, function(index) { | ||
| 90 | - DrawingManagerObj.closeDrawingManager(); | ||
| 91 | - PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 92 | - // 关闭弹出层 | ||
| 93 | - layer.close(index); | ||
| 94 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 95 | - if(txType=='r'){ | ||
| 96 | - WorldsBMap.pointsCircle(edtsta); | ||
| 97 | - }else if(txType=='d') { | ||
| 98 | - // 百度地图画多边形 | ||
| 99 | - WorldsBMap.pointsPolygon(edtsta); | ||
| 100 | - } | ||
| 101 | - parmasObj(); | ||
| 102 | - },function(){ | ||
| 103 | - // 关闭弹出层 | ||
| 104 | - layer.closeAll(); | ||
| 105 | - return false; | ||
| 106 | - }); | ||
| 107 | - | ||
| 108 | - }else if(!$.isEmptyObject(edtste)) { | ||
| 109 | - var sectionName = edtste.sectionName; | ||
| 110 | - // 是否继续弹出层 | ||
| 111 | - layer.confirm('您正处于路段【'+sectionName+'】的编辑状态!是否退出!', { | ||
| 112 | - btn : [ '确认并退出', '返回并继续' ] | ||
| 113 | - }, function(index) { | ||
| 114 | - // 关闭弹出层 | ||
| 115 | - layer.close(index); | ||
| 116 | - PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 117 | - var polylineArray_ = [edtste]; | ||
| 118 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 119 | - // 百度地图画路段 | ||
| 120 | - PublicFunctions.treeSectionClick(Line.id,polylineArray,dire_); | ||
| 121 | - parmasObj(); | ||
| 122 | - | ||
| 123 | - },function(){ | ||
| 124 | - // 关闭弹出层 | ||
| 125 | - layer.closeAll(); | ||
| 126 | - return false; | ||
| 127 | - }); | ||
| 128 | - }else { | ||
| 129 | - WorldsBMap.clearMarkAndOverlays(); | ||
| 130 | - upIsEidtStauts(shapesType_,chaildredType_,stationData); | 36 | + // 选中的节点类型 |
| 37 | + var chaildredType_ = stationData.chaildredType; | ||
| 38 | + | ||
| 39 | + if(chaildredType_ == "section") { | ||
| 40 | + WorldsBMap.focusSection(stationData.sectionrouteId); | ||
| 41 | + } else if(chaildredType_ == "station") { | ||
| 42 | + WorldsBMap.openStationInfoWin(stationData); | ||
| 43 | + } else if(chaildredType_ == "addSection") { | ||
| 44 | + WorldsBMap.addSection(stationData); | ||
| 131 | } | 45 | } |
| 132 | } | 46 | } |
| 133 | var stationTree = { | 47 | var stationTree = { |
| @@ -251,7 +165,11 @@ var StationTreeData = function(){ | @@ -251,7 +165,11 @@ var StationTreeData = function(){ | ||
| 251 | tree.settings.core.data = treeDateJson; | 165 | tree.settings.core.data = treeDateJson; |
| 252 | // 刷新上行树 | 166 | // 刷新上行树 |
| 253 | tree.refresh(); | 167 | tree.refresh(); |
| 254 | - }, | 168 | + // 展开树 |
| 169 | + setTimeout(function () { | ||
| 170 | + tree.open_all(); | ||
| 171 | + },500); | ||
| 172 | + }, | ||
| 255 | dwonreloadeTree : function (treeDateJson) { | 173 | dwonreloadeTree : function (treeDateJson) { |
| 256 | // 获取下行树 | 174 | // 获取下行树 |
| 257 | var tree = $.jstree.reference('#station_Down_tree'); | 175 | var tree = $.jstree.reference('#station_Down_tree'); |
| @@ -259,6 +177,10 @@ var StationTreeData = function(){ | @@ -259,6 +177,10 @@ var StationTreeData = function(){ | ||
| 259 | tree.settings.core.data = treeDateJson; | 177 | tree.settings.core.data = treeDateJson; |
| 260 | // 刷行下行树 | 178 | // 刷行下行树 |
| 261 | tree.refresh(); | 179 | tree.refresh(); |
| 180 | + // 展开树 | ||
| 181 | + setTimeout(function () { | ||
| 182 | + tree.open_all(); | ||
| 183 | + },500); | ||
| 262 | } | 184 | } |
| 263 | } | 185 | } |
| 264 | 186 |
src/main/resources/static/pages/base/stationroute/list.html
| 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> | 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> |
| 2 | -<div class="portlet-body"> | 2 | +<link rel="stylesheet" href="/assets/plugins/layer-v2.4/layer/skin/layer.css"> |
| 3 | + | ||
| 4 | +<div class="mian-portlet-body"> | ||
| 3 | <!-- 地图 --> | 5 | <!-- 地图 --> |
| 4 | <div id="bmap_basic" class="bmaps"></div> | 6 | <div id="bmap_basic" class="bmaps"></div> |
| 7 | + <!-- 搜索框 --> | ||
| 8 | + | ||
| 9 | + <div class="search_panel"> | ||
| 10 | + <div class="search_input_panel"> | ||
| 11 | + <input class="search_input" type="text" placeholder="输入位置搜索" id="searchInput"> | ||
| 12 | + <span class="fa fa-close fa-lg clear hide" aria-hidden="true"></span > | ||
| 13 | + </div> | ||
| 14 | + <div class="search_button_panel"> | ||
| 15 | + <button class="fa fa-search fa-lg search_button" > | ||
| 16 | + </button > | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;z-index: 199;"></div> | ||
| 5 | <!-- 路径规划路段 --> | 21 | <!-- 路径规划路段 --> |
| 6 | <input class="hand" id="routePlanning" /> | 22 | <input class="hand" id="routePlanning" /> |
| 7 | - <div class="portlet box protlet-box"> | ||
| 8 | - <!-- 左边标题栏 --> | 23 | + <div class="portlet box protlet-box"> |
| 24 | + <div class="protlet-box-layer"></div> | ||
| 25 | + <!-- 左边标题栏 --> | ||
| 9 | <div class="portlet-title" style="background-color:#12527f;"> | 26 | <div class="portlet-title" style="background-color:#12527f;"> |
| 10 | <div class="caption"> | 27 | <div class="caption"> |
| 11 | <!-- 途径站点 --> | 28 | <!-- 途径站点 --> |
| @@ -51,7 +68,7 @@ | @@ -51,7 +68,7 @@ | ||
| 51 | <li> | 68 | <li> |
| 52 | <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a> | 69 | <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a> |
| 53 | </li> | 70 | </li> |
| 54 | - <li class="divider"> </li> | 71 | + <!--<li class="divider"> </li>--> |
| 55 | <!--<li> | 72 | <!--<li> |
| 56 | <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a> | 73 | <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a> |
| 57 | </li>--> | 74 | </li>--> |
| @@ -59,7 +76,11 @@ | @@ -59,7 +76,11 @@ | ||
| 59 | <li> | 76 | <li> |
| 60 | <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a> | 77 | <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a> |
| 61 | </li> | 78 | </li> |
| 62 | - <li class="divider"> </li> | 79 | + <li class="divider"> </li> |
| 80 | + <!--<li> | ||
| 81 | + <a href="javascript:;" id="addUpSection"><i class="fa fa-plus"></i> 添加路段</a> | ||
| 82 | + </li> | ||
| 83 | + <li class="divider"> </li>--> | ||
| 63 | <li> | 84 | <li> |
| 64 | <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> | 85 | <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> |
| 65 | </li> | 86 | </li> |
| @@ -75,10 +96,10 @@ | @@ -75,10 +96,10 @@ | ||
| 75 | <li> | 96 | <li> |
| 76 | <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> | 97 | <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> |
| 77 | </li> | 98 | </li> |
| 78 | - <li class="divider"> </li> | ||
| 79 | - <!-- <li> | ||
| 80 | - <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> | ||
| 81 | - </li> --> | 99 | + <!-- <li class="divider"> </li> |
| 100 | + <!-- <li> | ||
| 101 | + <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> | ||
| 102 | + </li> --> | ||
| 82 | <!-- <li> | 103 | <!-- <li> |
| 83 | <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> | 104 | <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> |
| 84 | </li> --> | 105 | </li> --> |
| @@ -151,7 +172,7 @@ | @@ -151,7 +172,7 @@ | ||
| 151 | <li> | 172 | <li> |
| 152 | <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a> | 173 | <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a> |
| 153 | </li> | 174 | </li> |
| 154 | - <li class="divider"> </li> | 175 | + <!--<li class="divider"> </li>--> |
| 155 | <!--<li> | 176 | <!--<li> |
| 156 | <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a> | 177 | <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a> |
| 157 | </li>--> | 178 | </li>--> |
| @@ -159,7 +180,11 @@ | @@ -159,7 +180,11 @@ | ||
| 159 | <li> | 180 | <li> |
| 160 | <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a> | 181 | <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a> |
| 161 | </li> | 182 | </li> |
| 162 | - <li class="divider"> </li> | 183 | + <li class="divider"> </li> |
| 184 | + <!--<li> | ||
| 185 | + <a href="javascript:;" id="addDownSection"><i class="fa fa-plus"></i> 添加路段</a> | ||
| 186 | + </li> | ||
| 187 | + <li class="divider"> </li>--> | ||
| 163 | <li> | 188 | <li> |
| 164 | <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> | 189 | <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a> |
| 165 | </li> | 190 | </li> |
| @@ -253,4 +278,111 @@ | @@ -253,4 +278,111 @@ | ||
| 253 | <!-- reload事件 --> | 278 | <!-- reload事件 --> |
| 254 | <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script> | 279 | <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script> |
| 255 | <!-- 事件监听 --> | 280 | <!-- 事件监听 --> |
| 256 | -<script src="/pages/base/stationroute/js/stationroute-list-events.js"></script> | ||
| 257 | \ No newline at end of file | 281 | \ No newline at end of file |
| 282 | +<script src="/pages/base/stationroute/js/stationroute-list-events.js"></script> | ||
| 283 | + | ||
| 284 | +<script id="add_draw_polyline-temp" type="text/html"> | ||
| 285 | + <div class="add_road_search_point_wrap "> | ||
| 286 | + <div class="buffer_edit_body" > | ||
| 287 | + <div class="_title">绘制路段</div> | ||
| 288 | + <div class="form-horizontal" id="add_station_form"> | ||
| 289 | + <input type="hidden" value="{{id}}" name="id"> | ||
| 290 | + <input type="hidden" id="bsectionVectorInput"> <!--路段--> | ||
| 291 | + | ||
| 292 | + <div class="form-group"> | ||
| 293 | + <div class="col-md-12"> | ||
| 294 | + <input type="text" class="input-medium" name="sectionName" id="sectionNameInput" placeholder="路段名"> | ||
| 295 | + </div> | ||
| 296 | + </div> | ||
| 297 | + | ||
| 298 | + <div class="form-group"> | ||
| 299 | + <div class="col-md-5"> | ||
| 300 | + <span class="draw_polyline_switch"><a>暂停绘制</a></span> | ||
| 301 | + </div> | ||
| 302 | + <div class="col-md-6 btns"> | ||
| 303 | + <button class="sbmint-btn btn-sm" id="addSectionSbmintBtn">确定</button> | ||
| 304 | + <button class="cancel-btn btn-sm" id="addSectionCancelBtn">取消</button> | ||
| 305 | + </div> | ||
| 306 | + </div> | ||
| 307 | + </div> | ||
| 308 | + </div> | ||
| 309 | + </div> | ||
| 310 | +</script> | ||
| 311 | + | ||
| 312 | +<script type="text/javascript"> | ||
| 313 | + setTimeout(function () { | ||
| 314 | + // 百度地图API功能 | ||
| 315 | + function G(id) { | ||
| 316 | + return document.getElementById(id); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + var myMap = WorldsBMap.getmapBValue(); | ||
| 320 | + | ||
| 321 | + var ac = new BMap.Autocomplete( //建立一个自动完成的对象 | ||
| 322 | + {"input" : "searchInput" | ||
| 323 | + ,"location" : myMap | ||
| 324 | + }); | ||
| 325 | + | ||
| 326 | + ac.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件 | ||
| 327 | + var str = ""; | ||
| 328 | + var _value = e.fromitem.value; | ||
| 329 | + var value = ""; | ||
| 330 | + if (e.fromitem.index > -1) { | ||
| 331 | + value = _value.province + _value.city + _value.district + _value.street + _value.business; | ||
| 332 | + } | ||
| 333 | + str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value; | ||
| 334 | + | ||
| 335 | + value = ""; | ||
| 336 | + if (e.toitem.index > -1) { | ||
| 337 | + _value = e.toitem.value; | ||
| 338 | + value = _value.province + _value.city + _value.district + _value.street + _value.business; | ||
| 339 | + } | ||
| 340 | + str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value; | ||
| 341 | + G("searchResultPanel").innerHTML = str; | ||
| 342 | + }); | ||
| 343 | + | ||
| 344 | + var myValue; | ||
| 345 | + ac.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件 | ||
| 346 | + var _value = e.item.value; | ||
| 347 | + myValue = _value.province + _value.city + _value.district + _value.street + _value.business; | ||
| 348 | + G("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue; | ||
| 349 | + | ||
| 350 | + setPlace(); | ||
| 351 | + }); | ||
| 352 | + | ||
| 353 | + function setPlace(){ | ||
| 354 | + // myMap.clearOverlays(); //清除地图上所有覆盖物 | ||
| 355 | + WorldsBMap.clearOtherOverlay(); | ||
| 356 | + function myFun(){ | ||
| 357 | + var pp = local.getResults().getPoi(0) == undefined? null:local.getResults().getPoi(0).point; | ||
| 358 | + if(pp) { | ||
| 359 | + myMap.centerAndZoom(pp, 20); | ||
| 360 | + myMap.addOverlay(new BMap.Marker(pp)); //添加标注 | ||
| 361 | + } else { | ||
| 362 | + layer.msg('找不到您输入的位置!') | ||
| 363 | + } | ||
| 364 | + } | ||
| 365 | + var local = new BMap.LocalSearch(myMap, { //智能搜索 | ||
| 366 | + onSearchComplete: myFun | ||
| 367 | + }); | ||
| 368 | + local.search(myValue); | ||
| 369 | + } | ||
| 370 | + $("#searchInput").on('input propertychange change', function () { | ||
| 371 | + if($("#searchInput").val() != null && $("#searchInput").val() != "") | ||
| 372 | + $('.search_panel .clear').removeClass('hide'); | ||
| 373 | + else { | ||
| 374 | + WorldsBMap.clearOtherOverlay(); | ||
| 375 | + $('.search_panel .clear').addClass('hide'); | ||
| 376 | + } | ||
| 377 | + }); | ||
| 378 | + | ||
| 379 | + $('.search_panel .clear').on('click',function () { | ||
| 380 | + WorldsBMap.clearOtherOverlay(); | ||
| 381 | + $("#searchInput").val(''); | ||
| 382 | + $("#searchInput").change(); | ||
| 383 | + }); | ||
| 384 | + $('.search_panel .search_button').on('click',function () { | ||
| 385 | + myValue = $("#searchInput").val(); | ||
| 386 | + setPlace(); | ||
| 387 | + }); | ||
| 388 | + },1000); | ||
| 389 | +</script> | ||
| 258 | \ No newline at end of file | 390 | \ No newline at end of file |
src/main/resources/static/pages/base/stationroute/station_tabledate.html
| @@ -56,8 +56,8 @@ | @@ -56,8 +56,8 @@ | ||
| 56 | </div> | 56 | </div> |
| 57 | </div> | 57 | </div> |
| 58 | <div class="modal-footer"> | 58 | <div class="modal-footer"> |
| 59 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 60 | <button type="button" class="btn btn-primary" id="stationTabledatenextButton">确定</button> | 59 | <button type="button" class="btn btn-primary" id="stationTabledatenextButton">确定</button> |
| 60 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 61 | </div> | 61 | </div> |
| 62 | </div> | 62 | </div> |
| 63 | </div> | 63 | </div> |