修改语音播报
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.navinfo.collect.library.data.entity
|
||||
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
@@ -45,4 +43,10 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
||||
* 长度(米)
|
||||
*/
|
||||
var length: Double = 0.000,
|
||||
|
||||
/**
|
||||
* 这条link是不是参与到路径计算中
|
||||
*/
|
||||
var isNavi: Boolean = true
|
||||
|
||||
) : RealmObject()
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.navinfo.collect.library.data.entity
|
||||
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
open class NavInfo @JvmOverloads constructor(
|
||||
@PrimaryKey
|
||||
var id: Int = 0,
|
||||
/**
|
||||
* 起点link
|
||||
*/
|
||||
var naviStartLinkId: String = "",
|
||||
|
||||
/**
|
||||
* 终点link
|
||||
*/
|
||||
var naviEndLinkId: String = "",
|
||||
|
||||
/**
|
||||
* 起点NodeId
|
||||
*/
|
||||
var naviStartNode: String = "",
|
||||
|
||||
var naviEndNode: String = "",
|
||||
|
||||
) : RealmObject() {
|
||||
}
|
||||
@@ -69,8 +69,11 @@ open class TaskBean @JvmOverloads constructor(
|
||||
var message: String = "",
|
||||
@Ignore
|
||||
var errMsg: String = "",
|
||||
var color: Int = 0xFF00AA
|
||||
) : RealmObject() {
|
||||
var color: Int = 0xFF00AA,
|
||||
|
||||
var navInfo: NavInfo? = null,
|
||||
|
||||
) : RealmObject() {
|
||||
fun getDownLoadUrl(): String {
|
||||
return "${Constant.SERVER_ADDRESS}devcp/downFile?fileStr=$id"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ package com.navinfo.collect.library.map
|
||||
import org.oscim.core.GeoPoint
|
||||
|
||||
interface OnGeoPointClickListener : BaseClickListener {
|
||||
fun onMapClick(tag: String, point: GeoPoint)
|
||||
fun onMapClick(tag: String, point: GeoPoint, other: String = "")
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import com.navinfo.collect.library.R
|
||||
@@ -12,6 +13,7 @@ import com.navinfo.collect.library.data.entity.NoteBean
|
||||
import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.collect.library.map.BaseClickListener
|
||||
import com.navinfo.collect.library.map.NIMapView
|
||||
import com.navinfo.collect.library.map.OnGeoPointClickListener
|
||||
import com.navinfo.collect.library.map.cluster.ClusterMarkerItem
|
||||
import com.navinfo.collect.library.map.cluster.ClusterMarkerRenderer
|
||||
import com.navinfo.collect.library.map.layers.MyItemizedLayer
|
||||
@@ -37,7 +39,7 @@ import java.util.*
|
||||
/**
|
||||
* marker 操作
|
||||
*/
|
||||
class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
class MarkHandler(val context: AppCompatActivity, mapView: NIMapView) :
|
||||
BaseHandler(context, mapView) {
|
||||
|
||||
/**
|
||||
@@ -73,6 +75,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
*/
|
||||
private val canvas: org.oscim.backend.canvas.Canvas = CanvasAdapter.newCanvas()
|
||||
|
||||
private var mStartEndMarkerLayer: ItemizedLayer? = null
|
||||
|
||||
/**
|
||||
* 默认marker图层
|
||||
*/
|
||||
@@ -995,6 +999,68 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
fun removeNaviMarkerLayer() {
|
||||
if (mStartEndMarkerLayer != null) {
|
||||
removeLayer(mStartEndMarkerLayer!!)
|
||||
mStartEndMarkerLayer = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示选择起点 终点
|
||||
*/
|
||||
fun showNaviStartOrEndLayer(sNodePoint: GeoPoint, eNodePoint: GeoPoint, sNodeId: String, eNodeId: String, bStart: Boolean) {
|
||||
removeNaviMarkerLayer()
|
||||
if (mStartEndMarkerLayer == null) {
|
||||
val mDefaultBitmap = if(bStart) {
|
||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.drawable.navi_set_start_point))
|
||||
}else{
|
||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.drawable.navi_set_end_point))
|
||||
}
|
||||
// mDefaultBitmap.scaleTo(150, 150)
|
||||
val markerSymbol = MarkerSymbol(
|
||||
mDefaultBitmap,
|
||||
MarkerSymbol.HotspotPlace.BOTTOM_CENTER
|
||||
)
|
||||
mStartEndMarkerLayer = ItemizedLayer(
|
||||
mMapView.vtmMap,
|
||||
markerSymbol,
|
||||
)
|
||||
addLayer(mStartEndMarkerLayer!!, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||
mStartEndMarkerLayer!!.setOnItemGestureListener(object : OnItemGestureListener<MarkerInterface> {
|
||||
override fun onItemSingleTapUp(index: Int, item: MarkerInterface): Boolean {
|
||||
val tag = mMapView.listenerTagList.last()
|
||||
val listenerList = mMapView.listenerList[tag]
|
||||
if (listenerList != null) {
|
||||
for (listener in listenerList) {
|
||||
if (listener is OnGeoPointClickListener) {
|
||||
listener.onMapClick(tag, item.point, (item as MarkerItem).title)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onItemLongPress(index: Int, item: MarkerInterface): Boolean {
|
||||
return true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
mStartEndMarkerLayer!!.removeAllItems()
|
||||
}
|
||||
mStartEndMarkerLayer!!.addItem(MarkerItem(sNodeId, "", sNodePoint))
|
||||
mStartEndMarkerLayer!!.addItem(MarkerItem(eNodeId, "", eNodePoint))
|
||||
}
|
||||
|
||||
fun clearNaviStartPoint() {
|
||||
if (mStartEndMarkerLayer != null) {
|
||||
removeLayer(mStartEndMarkerLayer!!)
|
||||
mStartEndMarkerLayer = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface OnQsRecordItemClickListener : BaseClickListener {
|
||||
|
||||
@@ -1531,7 +1531,6 @@ public class GeometryTools {
|
||||
Geometry buffer = BufferOp.bufferOp(lineString1, distLeft, parameters1);
|
||||
Geometry buffer2 = BufferOp.bufferOp(lineString1, -distRight, parameters1);
|
||||
String bufferWkt = buffer.union(buffer2).toString();
|
||||
Log.e("qj", bufferWkt);
|
||||
return bufferWkt;
|
||||
}
|
||||
return "";
|
||||
@@ -1611,13 +1610,13 @@ public class GeometryTools {
|
||||
if (renderEntity.getId().equals(renderEntityTemp.getId())) {
|
||||
listReslut.add(renderEntityTemp);
|
||||
count++;
|
||||
Log.e("qj", "====计算间距" + count);
|
||||
// Log.e("qj", "====计算间距" + count);
|
||||
calcMap.put(renderEntityTemp.getId(), renderEntityTemp);
|
||||
} else {
|
||||
GeoPoint geoPoint = createGeoPoint(renderEntity.getGeometry());
|
||||
GeoPoint geoPoint1 = createGeoPoint(renderEntityTemp.getGeometry());
|
||||
double dis = getDistance(geoPoint.getLatitude(), geoPoint.getLongitude(), geoPoint1.getLatitude(), geoPoint1.getLongitude());
|
||||
Log.e("qj", "====计算间距" + dis);
|
||||
// Log.e("qj", "====计算间距" + dis);
|
||||
if (geoPoint != null && geoPoint1 != null && dis <= disance) {
|
||||
//只取第一个坐标
|
||||
renderEntityTemp.setGeometry(renderEntity.getGeometry());
|
||||
@@ -1633,7 +1632,7 @@ public class GeometryTools {
|
||||
}
|
||||
}
|
||||
|
||||
Log.e("qj", listReslut.size()+"==判断后=="+list.size()+"==="+calcMap.size());
|
||||
// Log.e("qj", listReslut.size()+"==判断后=="+list.size()+"==="+calcMap.size());
|
||||
|
||||
return listReslut;
|
||||
}
|
||||
|
||||
BIN
collect-library/src/main/res/drawable/navi_set_end_point.png
Normal file
BIN
collect-library/src/main/res/drawable/navi_set_end_point.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
collect-library/src/main/res/drawable/navi_set_start_point.png
Normal file
BIN
collect-library/src/main/res/drawable/navi_set_start_point.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user