Browse Source

百度地图

bihuisong 1 year ago
parent
commit
d0e8d0591c

+ 2 - 1
songhua-system/src/main/java/com/songhua/system/service/impl/CruiseShipMappingServiceImpl.java

@@ -81,7 +81,7 @@ public class CruiseShipMappingServiceImpl implements ICruiseShipMappingService
         return cruiseShipMappingMapper.deleteCruiseShipMappingById(id);
     }
 
-    private List<String> color = Arrays.asList("white", "ivory", "lightyellow", "yellow", "snow", "floralwhite","red","blue","orange","wheat","lightgreen");
+    private List<String> color = Arrays.asList("red","white", "ivory", "lightyellow", "yellow", "snow", "floralwhite","blue","orange","wheat","lightgreen");
     @Override
     public List<Map<String, Object>> getShipRouteData() {
         List<Map<String, Object>> combinedData = new ArrayList<>();
@@ -98,6 +98,7 @@ public class CruiseShipMappingServiceImpl implements ICruiseShipMappingService
                 map.put("lat", lat[j]);
                 data1.add(map);
             }
+            data.put("id", recentLocations.get(i).getId());
             data.put("polylinePath",data1);
             data.put("color", color.get(i));
             data.put("shipName", recentLocations.get(i).getShipName());

+ 1 - 0
songhua-system/src/main/resources/mapper/system/CruiseShipMappingMapper.xml

@@ -84,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getShipRouteData" parameterType="CruiseShipMapping" resultMap="CruiseShipMappingResult">
         SELECT
+            b.id,
             b.ship_name AS shipName,
             b.ship_type as shipType,
             b.length_overall as lengthOverall,

+ 2 - 1
songhua-ui/public/index.html

@@ -8,7 +8,8 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
-	  <style>
+    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=Qog1nZtgKesJwIoEFpbMke5QvfSkHsnj"></script>
+    <style>
     html,
     body,
     #app {

BIN
songhua-ui/src/assets/images/ship.png


File diff suppressed because it is too large
+ 150 - 97
songhua-ui/src/views/index/index.vue