Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/ui/activity/map/MainViewModel.kt app/src/main/java/com/navinfo/omqs/ui/fragment/tasklist/TaskViewModel.kt
@@ -1560,7 +1560,7 @@
|
||||
<m k="qi_table">
|
||||
<!--车道数-->
|
||||
<m v="OMDB_LANE_NUM">
|
||||
<m k="laneNum">
|
||||
<!-- <m k="laneNum">
|
||||
<m v="1">
|
||||
<line stroke="#545D6C" width="3" />
|
||||
</m>
|
||||
@@ -1597,7 +1597,7 @@
|
||||
<m v="12">
|
||||
<line stroke="#545D6C" width="36" />
|
||||
</m>
|
||||
</m>
|
||||
</m>-->
|
||||
</m>
|
||||
<!-- 道路线 -->
|
||||
<m v="OMDB_RD_LINK">
|
||||
@@ -1698,11 +1698,57 @@
|
||||
</m>
|
||||
<!--车道中心线-->
|
||||
<m v="OMDB_LANE_LINK_LG">
|
||||
<line dasharray="35,35" stroke="#ecf0f1" width="0.1" />
|
||||
</m>
|
||||
<!-- <m k="eLaneNodePid">
|
||||
<line dasharray="35,35" stroke="#ecf0f1" width="0.1" />
|
||||
</m>-->
|
||||
<m k="width">
|
||||
<line stroke="#545D6C" width="3" />
|
||||
</m>
|
||||
</m>0
|
||||
<!-- 道路边界类型 -->
|
||||
<m v="OMDB_RDBOUND_BOUNDARYTYPE">
|
||||
<line stroke="#ffffff" width="0.1" />
|
||||
<outline-layer id="boundaryType" stroke="#fcba5a" width="0.2" />
|
||||
<m k="boundaryType" v="0">
|
||||
<!--不应用-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="12" repeat-start="12" symbol-height="16" symbol-width="16" src="assets:omdb/icon_2083_0.svg" />
|
||||
</m>
|
||||
<m k="boundaryType" v="1">
|
||||
<!--无标线无可区分边界-->
|
||||
<line dasharray="10,2,2,2,2,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||
</m>
|
||||
<m k="boundaryType" v="2">
|
||||
<!--标线-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
</m>
|
||||
<m k="boundaryType" v="3">
|
||||
<!--路牙-->
|
||||
<line dasharray="10,4" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||
</m>
|
||||
<m k="boundaryType" v="4">
|
||||
<!--护栏-->
|
||||
<line dasharray="10,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2"/>
|
||||
</m>
|
||||
<m k="boundaryType" v="5">
|
||||
<!--墙-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<line dasharray="10,5" stroke="#fcba5a" width="0.5" />
|
||||
</m>
|
||||
<m k="boundaryType" v="6">
|
||||
<!--道路面铺设边缘-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="32" repeat-start="0" symbol-height="32" src="assets:omdb/icon_2083_6.svg" />
|
||||
</m>
|
||||
<m k="boundaryType" v="7">
|
||||
<!--虚拟三角岛-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<line src="assets:omdb/icon_2083_7_1.svg" symbol-height="12" symbol-width="12" symbol-percent="20" width="1" />
|
||||
</m>
|
||||
<m k="boundaryType" v="9">
|
||||
<!--杆状障碍物-->
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="16" repeat-start="12" symbol-height="24" symbol-width="8" src="assets:omdb/icon_2083_9.svg" />
|
||||
</m>
|
||||
</m>
|
||||
<!-- 车道边界类型 -->
|
||||
<m v="OMDB_LANE_MARK_BOUNDARYTYPE">
|
||||
@@ -1770,6 +1816,22 @@
|
||||
</m>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
<!--隧道-->
|
||||
<m v="OMDB_TUNNEL">
|
||||
<m k="formOfWay">
|
||||
<line dasharray="0.2,0.2" stroke="#d4237a" width="0.2" />
|
||||
</m>
|
||||
<m k="type" v="s_2_p">
|
||||
<symbol repeat="false" repeat-start="0" rotate="false"
|
||||
src="assets:omdb/icon_2202_0.svg" symbol-height="32" symbol-width="32"></symbol>
|
||||
</m>
|
||||
<m k="type" v="e_2_p">
|
||||
<symbol repeat="false" repeat-start="0" rotate="false"
|
||||
src="assets:omdb/icon_2202_1.svg" symbol-height="32" symbol-width="32"></symbol>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
<!--道路方向-->
|
||||
<m v="OMDB_LINK_DIRECT">
|
||||
<m k="direct">
|
||||
@@ -1803,6 +1865,7 @@
|
||||
<line use="s2e" />
|
||||
</m>
|
||||
</m>
|
||||
|
||||
<!--电子眼-->
|
||||
<m v="OMDB_ELECTRONICEYE">
|
||||
<!-- <m k="angle">-->
|
||||
|
||||
1
collect-library/src/main/assets/omdb/icon_2083_0.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689041545166" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="30665" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512.005117 958.708971C265.683035 958.708971 65.290005 758.316965 65.290005 511.99386c0-246.310825 200.39303-446.703855 446.715111-446.703855 246.310825 0 446.703855 200.39303 446.703855 446.703855C958.708971 758.316965 758.316965 958.708971 512.005117 958.708971zM512.005117 169.716356c-188.738595 0-342.289784 153.545048-342.289784 342.277504 0 188.738595 153.551188 342.289784 342.289784 342.289784 188.733479 0 342.278527-153.551188 342.278527-342.289784C854.283644 323.261405 700.738595 169.716356 512.005117 169.716356z" p-id="30666" fill="#fcba5a"></path></svg>
|
||||
|
After Width: | Height: | Size: 900 B |
13
collect-library/src/main/assets/omdb/icon_2083_6.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="58.142" viewBox="0 0 4 58.142">
|
||||
<defs>
|
||||
<style>.a{fill:none;stroke:#ebb972;stroke-width:4px;}.b{opacity:0.001;}</style>
|
||||
</defs>
|
||||
<g transform="translate(-401.035 -35.964)">
|
||||
<g transform="translate(313.535 166.535) rotate(-90)">
|
||||
<line class="a" x2="29.071" transform="translate(101.5 89.5)" />
|
||||
</g>
|
||||
<g class="b" transform="translate(313.535 195.605) rotate(-90)">
|
||||
<line class="a" x2="29.071" transform="translate(101.5 89.5)" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 580 B |
10
collect-library/src/main/assets/omdb/icon_2083_7.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<defs>
|
||||
<style>.e{fill:#fcba5a;}</style>
|
||||
</defs>
|
||||
<g id="c">
|
||||
<path id="d" class="e"
|
||||
d="M31.9,0l-14.3,23.2-1.6,2.6-1.6-2.6L0,0h0V6.1L14.1,28.9l1.9,3.1h0s1.9-3.1,1.9-3.1L32,6V0h0Z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 365 B |
8
collect-library/src/main/assets/omdb/icon_2083_7_1.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<defs>
|
||||
<style>.a{fill:#fcba5a;}</style>
|
||||
</defs>
|
||||
<path class="a"
|
||||
d="M31.94,0,17.6,23.21l-1.62,2.622L14.4,23.274.021,0H0V6.084L14.09,28.891l1.869,3.094.024.015,1.888-3.109L32,6.021V0Z"
|
||||
transform="translate(0 0)" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 339 B |
6
collect-library/src/main/assets/omdb/icon_2083_9.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="48" viewBox="0 0 15 48">
|
||||
<defs>
|
||||
<style>.a{fill:#ebb972;}</style>
|
||||
</defs>
|
||||
<rect class="a" width="15" height="48" rx="7.5" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 209 B |
18
collect-library/src/main/assets/omdb/icon_2202_0.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">
|
||||
<defs>
|
||||
<style>
|
||||
.a{fill:#fceaa0;stroke:#1b23b4;stroke-width:3px;}.b{fill:#1b23b4;}.c{stroke:none;}.d{fill:none;}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(-126 -381)">
|
||||
<g transform="translate(9304 7585)">
|
||||
<g class="a" transform="translate(-9178 -7204)">
|
||||
<circle class="c" cx="40" cy="40" r="40" />
|
||||
<circle class="d" cx="40" cy="40" r="38.5" />
|
||||
</g>
|
||||
</g>
|
||||
<path class="b"
|
||||
d="M257.043,173.635V146.2c0-9.344-8.378-16.918-18.708-16.918s-18.712,7.574-18.712,16.918v27.436H214.94V145.378c0-11.808,10.6-21.378,23.684-21.378s23.683,9.57,23.683,21.378v28.257Zm-18.13-42.773c13.594-.133,16.377,13.195,16.377,13.195v29.579H254.7l-9.934-14.271V144.584s-.436-4.223-5.851-4.223-6.431,4.223-6.431,4.223v14.779l-10.2,14.271h-.913V144.06S223.714,131.009,238.913,130.861Zm5.049,28.5,10.159,14.271h-31.21l10.159-14.272h10.893Zm0,0"
|
||||
transform="translate(-72.624 269.184)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
collect-library/src/main/assets/omdb/icon_2202_1.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80"><defs><style>.a{fill:#1b23b4;stroke:#fceaa0;stroke-width:3px;}.b{fill:#fceaa0;}.c{stroke:none;}.d{fill:none;}</style></defs><g transform="translate(-268 -381)"><g transform="translate(9446 7585)"><g class="a" transform="translate(-9178 -7204)"><circle class="c" cx="40" cy="40" r="40"/><circle class="d" cx="40" cy="40" r="38.5"/></g></g><path class="b" d="M257.043,173.635V146.2c0-9.344-8.378-16.918-18.708-16.918s-18.712,7.574-18.712,16.918v27.436H214.94V145.378c0-11.808,10.6-21.378,23.684-21.378s23.683,9.57,23.683,21.378v28.257Zm-18.13-42.773c13.594-.133,16.377,13.195,16.377,13.195v29.579H254.7l-9.934-14.271V144.584s-.436-4.223-5.851-4.223-6.431,4.223-6.431,4.223v14.779l-10.2,14.271h-.913V144.06S223.714,131.009,238.913,130.861Zm5.049,28.5,10.159,14.271h-31.21l10.159-14.272h10.893Zm0,0" transform="translate(69.376 269.184)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 928 B |
@@ -46,4 +46,7 @@ public interface INiLocationDao {
|
||||
|
||||
@Query("SELECT * FROM niLocation")
|
||||
List<NiLocation> findAll();
|
||||
|
||||
@Query("SELECT * FROM niLocation where taskId =:taskId")
|
||||
List<NiLocation> findToTaskIdAll(String taskId);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ public class NiLocation extends Feature{
|
||||
private String groupId;
|
||||
@ColumnInfo(name = "timeStamp")
|
||||
private String timeStamp;
|
||||
@ColumnInfo(name = "media")
|
||||
private int media;
|
||||
@ColumnInfo(name = "taskId")
|
||||
private String taskId;
|
||||
|
||||
private boolean isAccouracy;
|
||||
private boolean isSpeed;
|
||||
@@ -318,4 +322,20 @@ public class NiLocation extends Feature{
|
||||
public void setTimeStamp(String timeStamp) {
|
||||
this.timeStamp = timeStamp;
|
||||
}
|
||||
|
||||
public int getMedia() {
|
||||
return media;
|
||||
}
|
||||
|
||||
public void setMedia(int media) {
|
||||
this.media = media;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelTileLoaderHook;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.renderer.GLViewport;
|
||||
import org.oscim.scalebar.MapScaleBarLayer;
|
||||
import org.oscim.theme.IRenderTheme;
|
||||
import org.oscim.theme.ThemeLoader;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
@@ -198,6 +199,11 @@ public final class NIMapView extends RelativeLayout {
|
||||
*/
|
||||
private OnMapTouchListener touchListener;
|
||||
|
||||
/**
|
||||
* 比例尺控件
|
||||
*/
|
||||
private MapScaleBarLayer mapScaleBarLayer;
|
||||
|
||||
public NIMapView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
@@ -252,7 +258,7 @@ public final class NIMapView extends RelativeLayout {
|
||||
|
||||
// 增加比例尺图层
|
||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
||||
naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 5);
|
||||
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 5);
|
||||
|
||||
// if (gridLayer == null) {
|
||||
// gridLayer = new TileGridLayer(getVtmMap());
|
||||
@@ -878,6 +884,21 @@ public final class NIMapView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置比例尺位置
|
||||
* @param position
|
||||
* @param xOffset
|
||||
* @param yOffset
|
||||
*/
|
||||
public void setScaleBarLayer(GLViewport.Position position, int xOffset, int yOffset){
|
||||
if(mapScaleBarLayer!=null&&mapView.map().layers().contains(mapScaleBarLayer)){
|
||||
mapView.map().layers().remove(mapScaleBarLayer);
|
||||
mapScaleBarLayer = null;
|
||||
}
|
||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
||||
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, xOffset, yOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否显示缩放控件
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.navinfo.collect.library.map.handler
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
@@ -8,6 +9,8 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.navinfo.collect.library.R
|
||||
import com.navinfo.collect.library.data.dao.impl.TraceDataBase
|
||||
import com.navinfo.collect.library.data.entity.NiLocation
|
||||
import com.navinfo.collect.library.data.entity.NoteBean
|
||||
import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.collect.library.map.NIMapView
|
||||
@@ -30,11 +33,19 @@ import org.oscim.backend.CanvasAdapter
|
||||
import org.oscim.backend.canvas.Bitmap
|
||||
import org.oscim.backend.canvas.Paint
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.layers.marker.*
|
||||
import org.oscim.layers.marker.ItemizedLayer
|
||||
import org.oscim.layers.marker.ItemizedLayer.OnItemGestureListener
|
||||
import org.oscim.layers.vector.geometries.*
|
||||
import org.oscim.layers.marker.MarkerInterface
|
||||
import org.oscim.layers.marker.MarkerItem
|
||||
import org.oscim.layers.marker.MarkerRendererFactory
|
||||
import org.oscim.layers.marker.MarkerSymbol
|
||||
import org.oscim.layers.vector.geometries.Drawable
|
||||
import org.oscim.layers.vector.geometries.LineDrawable
|
||||
import org.oscim.layers.vector.geometries.PointDrawable
|
||||
import org.oscim.layers.vector.geometries.PolygonDrawable
|
||||
import org.oscim.layers.vector.geometries.Style
|
||||
import org.oscim.map.Map
|
||||
import java.util.*
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* marker 操作
|
||||
@@ -42,7 +53,6 @@ import java.util.*
|
||||
class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
BaseHandler(context, mapView) {
|
||||
|
||||
|
||||
/**
|
||||
* 默认文字颜色
|
||||
*/
|
||||
@@ -98,6 +108,10 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
layer
|
||||
}
|
||||
|
||||
private var niLocationBitmap: Bitmap? = null
|
||||
private var niLocationBitmap1: Bitmap? = null
|
||||
private var niLocationBitmap2: Bitmap? = null
|
||||
private var niLocationBitmap3: Bitmap? = null
|
||||
|
||||
/**
|
||||
* 评测数据marker 图层
|
||||
@@ -140,6 +154,61 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
layer
|
||||
}
|
||||
|
||||
/**
|
||||
* 评测数据marker 图层
|
||||
*/
|
||||
private val niLocationItemizedLayer: MyItemizedLayer by lazy {
|
||||
|
||||
niLocationBitmap =
|
||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.mipmap.icon_gps))
|
||||
niLocationBitmap1 =
|
||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.mipmap.icon_gps_1))
|
||||
niLocationBitmap2 =
|
||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.mipmap.icon_nilocation))
|
||||
niLocationBitmap3 = AndroidBitmap(
|
||||
BitmapFactory.decodeResource(
|
||||
context.resources,
|
||||
R.mipmap.icon_nilocation_1
|
||||
)
|
||||
)
|
||||
|
||||
val layer = MyItemizedLayer(
|
||||
mMapView.vtmMap,
|
||||
mutableListOf(),
|
||||
markerRendererFactory,
|
||||
object : MyItemizedLayer.OnItemGestureListener {
|
||||
override fun onItemSingleTapUp(
|
||||
list: MutableList<Int>,
|
||||
nearest: Int
|
||||
): Boolean {
|
||||
itemListener?.let {
|
||||
val idList = mutableListOf<NiLocation>()
|
||||
if (list.size == 0) {
|
||||
} else {
|
||||
for (i in list) {
|
||||
val markerInterface: MarkerInterface =
|
||||
niLocationItemizedLayer.itemList[i]
|
||||
if (markerInterface is MarkerItem) {
|
||||
idList.add(markerInterface.uid as NiLocation)
|
||||
}
|
||||
}
|
||||
it.onNiLocationList(idList.distinct().toMutableList())
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onItemLongPress(
|
||||
list: MutableList<Int>?,
|
||||
nearest: Int
|
||||
): Boolean {
|
||||
return true
|
||||
}
|
||||
})
|
||||
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||
layer
|
||||
}
|
||||
|
||||
/**
|
||||
* 便签线图层
|
||||
*/
|
||||
@@ -212,9 +281,6 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
org.oscim.backend.canvas.Color.BLUE
|
||||
)
|
||||
) {
|
||||
// override fun getClusterBitmap(size: Int): Bitmap? {
|
||||
// return super.getclusterbitmap(size)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,6 +299,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||
if (e == Map.SCALE_EVENT) {
|
||||
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -402,6 +469,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 添加质检数据marker
|
||||
*/
|
||||
@@ -445,53 +513,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
when (geometry.geometryType.uppercase(Locale.getDefault())) {
|
||||
"POINT" -> geoPoint =
|
||||
GeoPoint(geometry.coordinate.y, geometry.coordinate.x)
|
||||
// "LINESTRING" -> {
|
||||
// val lineString = geometry as LineString
|
||||
// if (lineString != null && lineString.coordinates.size > 0) {
|
||||
// geoPoint = GeoPoint(
|
||||
// lineString.coordinates[0].y,
|
||||
// lineString.coordinates[0].x
|
||||
// )
|
||||
// }
|
||||
// val drawableLine: Drawable =
|
||||
// convertGeometry2Drawable(geometry, lineStyle)
|
||||
// if (drawableLine != null) {
|
||||
// dataVectorLayer.add(drawableLine)
|
||||
// }
|
||||
// }
|
||||
// "POLYGON" -> {
|
||||
// val polygon = geometry as Polygon
|
||||
// if (polygon != null && polygon.coordinates.size > 0) {
|
||||
// geoPoint = GeoPoint(
|
||||
// polygon.coordinates[0].y,
|
||||
// polygon.coordinates[0].x
|
||||
// )
|
||||
// }
|
||||
// val drawablePolygon: Drawable =
|
||||
// convertGeometry2Drawable(geometry, polygonStyle)
|
||||
// if (drawablePolygon != null) {
|
||||
// dataVectorLayer.add(drawablePolygon)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (geoPoint != null) {
|
||||
|
||||
val geoMarkerItem: MarkerItem
|
||||
// if (item.getType() === 1) {
|
||||
geoMarkerItem = ClusterMarkerItem(
|
||||
1, item.id, item.description, geoPoint
|
||||
)
|
||||
// } else {
|
||||
// geoMarkerItem = MarkerItem(
|
||||
// ePointTemp.getType(),
|
||||
// ePointTemp.getId(),
|
||||
// ePointTemp.getStyleText(),
|
||||
// geoPoint
|
||||
// )
|
||||
// }
|
||||
val markerSymbol =
|
||||
MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.CENTER)
|
||||
|
||||
geoMarkerItem = ClusterMarkerItem(1, item.id, item.description, geoPoint)
|
||||
|
||||
val markerSymbol = MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.CENTER)
|
||||
|
||||
geoMarkerItem.marker = markerSymbol
|
||||
|
||||
qsRecordItemizedLayer.itemList.add(geoMarkerItem)
|
||||
}
|
||||
}
|
||||
@@ -499,6 +532,64 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
qsRecordItemizedLayer.populate()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加质检数据marker
|
||||
*/
|
||||
public suspend fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
||||
|
||||
var itemizedLayer: ItemizedLayer? = null
|
||||
|
||||
val direction: Double = niLocation.direction
|
||||
|
||||
val geoMarkerItem: MarkerItem = ClusterMarkerItem(
|
||||
niLocation,
|
||||
niLocation.id,
|
||||
niLocation.time,
|
||||
GeoPoint(niLocation.latitude, niLocation.longitude)
|
||||
)
|
||||
|
||||
//角度
|
||||
when (niLocation.media) {
|
||||
0 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap2, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
itemizedLayer = niLocationItemizedLayer
|
||||
}
|
||||
|
||||
1 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
val symbolLidarTemp =
|
||||
MarkerSymbol(niLocationBitmap1, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolLidarTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap3, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
itemizedLayer = niLocationItemizedLayer
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
itemizedLayer!!.update()
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文字和图片拼装,文字换行
|
||||
@@ -709,9 +800,19 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
bitmap
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除轨迹图层
|
||||
*/
|
||||
fun clearNiLocationLayer() {
|
||||
niLocationItemizedLayer.removeAllItems()
|
||||
niLocationItemizedLayer.update()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface OnQsRecordItemClickListener {
|
||||
fun onQsRecordList(list: MutableList<String>)
|
||||
fun onNoteList(list: MutableList<String>)
|
||||
fun onNiLocationList(list: MutableList<NiLocation>)
|
||||
}
|
||||
|
||||
@@ -115,10 +115,13 @@ public class MyItemizedLayer extends ItemizedLayer {
|
||||
// it = this.mMarkerRenderer.mDefaultMarker;
|
||||
}
|
||||
|
||||
if (it.isInside(dx, dy)) {// && this.mTmpPoint.y > insideY) {
|
||||
// insideY = this.mTmpPoint.y;
|
||||
inside = i;
|
||||
list.add(i);
|
||||
try{
|
||||
if (it.isInside(dx, dy)) {
|
||||
inside = i;
|
||||
list.add(i);
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
if (inside < 0) {
|
||||
|
||||
BIN
collect-library/src/main/res/mipmap-xxhdpi/icon_gps.png
Normal file
|
After Width: | Height: | Size: 401 B |
BIN
collect-library/src/main/res/mipmap-xxhdpi/icon_gps_1.png
Normal file
|
After Width: | Height: | Size: 377 B |
BIN
collect-library/src/main/res/mipmap-xxhdpi/icon_nilocation.png
Normal file
|
After Width: | Height: | Size: 492 B |
BIN
collect-library/src/main/res/mipmap-xxhdpi/icon_nilocation_1.png
Normal file
|
After Width: | Height: | Size: 611 B |