车辆监控地图部分

This commit is contained in:
DDIsFriend
2023-12-22 17:59:33 +08:00
parent 11d838906f
commit 652f3145a8
71 changed files with 9317 additions and 8464 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -77,6 +77,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)dd_mapView:(MAMapView *)mapView didFailLoadTerrainWithError:(NSError *)error;
/**
* @brief 地图将要发生缩放时调用此接口
* @param mapView 地图view
* @param wasUserAction 标识是否是用户动作
*/
- (void)dd_mapView:(MAMapView *)mapView mapWillZoomByUser:(BOOL)wasUserAction;
/**
* @brief 地图缩放结束后调用此接口
* @param mapView 地图view
* @param wasUserAction 标识是否是用户动作
*/
- (void)dd_mapView:(MAMapView *)mapView mapDidZoomByUser:(BOOL)wasUserAction;
/**
* @brief 在地图View将要启动定位时会调用此函数
* @param mapView 地图View

View File

@@ -89,6 +89,18 @@
}
}
- (void)mapView:(MAMapView *)mapView mapWillZoomByUser:(BOOL)wasUserAction {
if ([self.delegate respondsToSelector:@selector(dd_mapView:mapWillZoomByUser:)]) {
[self.delegate dd_mapView:mapView mapWillZoomByUser:wasUserAction];
}
}
- (void)mapView:(MAMapView *)mapView mapDidZoomByUser:(BOOL)wasUserAction {
if ([self.delegate respondsToSelector:@selector(dd_mapView:mapDidZoomByUser:)]) {
[self.delegate dd_mapView:mapView mapDidZoomByUser:wasUserAction];
}
}
// MARK: <Locate>
- (void)mapViewWillStartLocatingUser:(MAMapView *)mapView{
if ([self.delegate respondsToSelector:@selector(dd_mapViewWillStartLocatingUser:)]) {

View File

@@ -28,6 +28,17 @@
///各个点权重设置取值1-55最大。权重为5则不对此点做抽稀。格式为{weight:indices}
@property (nonatomic, strong) NSDictionary<NSNumber*, NSArray*> *pointsWeight;
///当前在手动拖动进度条
@property (nonatomic, assign) BOOL isManualSlider;
/// 当前轨迹绘制进程
@property (nonatomic, copy) void(^renderProgressHandler)(CGFloat progress);
/**
* @brief 指定车辆当前位置
*/
- (void)specifyVehicleLocation:(CGFloat)value;
/**
* @brief 重置为初始状态
*/
@@ -49,6 +60,11 @@
*/
- (BOOL)setWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger)count;
/**
* @brief 获取所有的点数
*/
- (NSInteger)getOrigPointCount;
/**
* @brief 获取当前car所在位置点索引
*/

View File

@@ -86,6 +86,14 @@ typedef struct MATraceReplayPoint MATraceReplayPoint;
_readyForDrawing = NO;
}
- (void)specifyVehicleLocation:(CGFloat)value {
self.isPaused = YES;
NSInteger locationIndex = (NSInteger)(_origPointCount - 1) * value;
_carIndexInOrigArray = locationIndex;
_multiPolyline.drawStyleIndexes = nil;
_readyForDrawing = NO;
}
- (BOOL)setWithPoints:(MAMapPoint *)points count:(NSInteger)count {
if(points == NULL || count <= 0) {
if (_origMapPoints != NULL) {
@@ -214,6 +222,10 @@ typedef struct MATraceReplayPoint MATraceReplayPoint;
[self recalculateMapPoints];
}
- (NSInteger)getOrigPointCount {
return _origPointCount;
}
- (NSInteger)getOrigPointIndexOfCar {
return _carIndexInOrigArray;
}
@@ -352,19 +364,19 @@ typedef struct MATraceReplayPoint MATraceReplayPoint;
}
_reducedPointIndexOfCar = ret;
//polylinedrawIndex
if(_carIndexInOrigArray == 0) {
_multiPolyline.drawStyleIndexes = nil;
//patchline
[_patchLine setPolylineWithPoints:NULL count:0];
} else {
// //polylinedrawIndex
// if(_carIndexInOrigArray == 0) {
// _multiPolyline.drawStyleIndexes = nil;
// //patchline
// [_patchLine setPolylineWithPoints:NULL count:0];
// } else {
_multiPolyline.drawStyleIndexes = @[@(_reducedPointIndexOfCar + 1)];
//patchline
_patchLinePoints[0] = _carMapPoint;
_patchLinePoints[1] = p2;
[_patchLine setPolylineWithPoints:_patchLinePoints count:2];
}
// }
}
if(!_readyForDrawing) {

View File

@@ -53,7 +53,7 @@ typedef struct _MADrawPoint {
_patchLineRender = [[MAPolylineRenderer alloc] initWithPolyline:[traceOverlay getPatchPolyline]];
_patchLineRender.strokeColor = _proxyRender.strokeColors.lastObject;
_carImage = [UIImage dd_imageNamed:@"DDMAMap/my_location" bundleName:@"DDMAMapKit_Private" aClass:[self class]];
_carImage = [UIImage dd_imageNamed:@"car_xingshi" bundleName:@"DDMAMapKit_Private" aClass:[self class]];
}
return self;
@@ -80,6 +80,12 @@ typedef struct _MADrawPoint {
[traceOverlay drawStepWithTime:curTime - _prevTime zoomLevel:zoomLevel];
_prevTime = curTime;
}
if (!traceOverlay.isManualSlider) {
if (traceOverlay.renderProgressHandler) {
traceOverlay.renderProgressHandler((CGFloat)[traceOverlay getOrigPointIndexOfCar] / [traceOverlay getOrigPointCount]);
}
}
if(self.carImage && [traceOverlay getMultiPolyline].pointCount > 0) {
[_proxyRender glRender];
@@ -131,6 +137,7 @@ typedef struct _MADrawPoint {
- (void)reset {
_prevTime = 0;
[self setNeedsUpdate];
}
- (void)renderCarImage {

View File

@@ -87,6 +87,9 @@ NS_ASSUME_NONNULL_BEGIN
- (void)queryTrackDistanceWith:(long long)startTime endTime:(long long)endTime trackID:(nullable NSString *)trackID;
@property (nonatomic, copy,nullable)void(^queryTrackDistanceOnDone)(AMapTrackQueryTrackDistanceRequest *request,AMapTrackQueryTrackDistanceResponse *response);
// 查询轨迹的历史轨迹点
- (void)queryTrackInfoWithTrackID:(NSString *)trackID startTime:(long long)startTime endTime:(long long)endTime pageIndex:(NSInteger)index;
@property (nonatomic, copy, nullable)void(^queryTrackInfoOnDone)(AMapTrackQueryTrackInfoRequest *request,AMapTrackQueryTrackInfoResponse *response);
@end
NS_ASSUME_NONNULL_END

View File

@@ -134,6 +134,11 @@
DDLog(@"--------------------------------LBS查询距离失败--------------------------------");
}
if ([request isKindOfClass:[AMapTrackQueryTrackInfoRequest class]]) {
//
DDLog(@"--------------------------------LBS查询历史轨迹点位数据失败--------------------------------");
}
if (self.queryFailWithErrorOnDone) {
self.queryFailWithErrorOnDone(error, request);
}
@@ -289,13 +294,33 @@
- (void)onQueryTrackDistanceDone:(AMapTrackQueryTrackDistanceRequest *)request response:(AMapTrackQueryTrackDistanceResponse *)response
{
//
NSLog(@"--------------------------------onQueryTrackDistanceDone%@--------------------------------", response.formattedDescription);
DDLog(@"--------------------------------onQueryTrackDistanceDone%@--------------------------------", response.formattedDescription);
if (self.queryTrackDistanceOnDone != nil) {
DDLog(@"--------------------------------当前猎鹰查询distance:%lu--------------------------------",(unsigned long)response.distance);
self.queryTrackDistanceOnDone(request, response);
}
}
- (void)queryTrackInfoWithTrackID:(NSString *)trackID startTime:(long long)startTime endTime:(long long)endTime pageIndex:(NSInteger)index {
AMapTrackQueryTrackInfoRequest *request = [[AMapTrackQueryTrackInfoRequest alloc] init];
request.serviceID = self.trackManager.serviceID;
request.terminalID = self.terminalID;
request.startTime = startTime;
request.endTime = endTime;
request.trackID = trackID;
request.recoupMode = AMapTrackRecoupModeDriving;
request.recoupGap = 10000;
request.pageSize = 999;
request.pageIndex = index;
[self.trackManager AMapTrackQueryTrackInfo:request];
}
- (void)onQueryTrackInfoDone:(AMapTrackQueryTrackInfoRequest *)request response:(AMapTrackQueryTrackInfoResponse *)response {
if (self.queryTrackInfoOnDone != nil) {
self.queryTrackInfoOnDone(request, response);
}
}
- (void)changeGatherAndPackTimeInterval:(NSInteger)gatherTimeInterval packTimeInterval:(NSInteger)packTimeInterval{
[self.trackManager changeGatherAndPackTimeInterval:gatherTimeInterval packTimeInterval:packTimeInterval];
}