tabsong / tracking Goto Github PK
View Code? Open in Web Editor NEW基于高德地图 iOS SDK 的轨迹回放 库
基于高德地图 iOS SDK 的轨迹回放 库
你好,你的经纬度文件,GuGoing.tracking。里面的数据是什么样的呢?我现在如果要把经纬度数据存储的话可以直接存储成数组格式么?
我如此生成CLLocationCoordinate2D结构体,并添加到OC数组对象中
CLLocationCoordinate2D coor = CLLocationCoordinate2DMake([[dict objectForKey:@"latitude"] floatValue], [[dict objectForKey:@"longtitude"] floatValue]);
[coordinates addObject:[NSValue value:&coor withObjCType:@encode(CLLocationCoordinate2D)]];
再将NSArray强转成CLLocationCoordinate2D *传入tracking对象中,并不能开始绘制路径,而且,地图页面会卡死,猜测是位置点数组的原因,麻烦lz帮忙解决
按照Demo我如此生成了tracking对象
trackingRoute_ = [[Tracking alloc] initWithCoordinates:theCoordinates count:cnt];
trackingRoute_.delegate = self;
trackingRoute_.mapView = mapView_;
trackingRoute_.duration = 5.0f;
trackingRoute_.edgeInsets = UIEdgeInsetsMake(50, 50, 50, 50);
[trackingRoute_ execute];
并且在annotationView的代理方法中生成了annotationview
if (annotation == trackingRoute_.annotation)
{
static NSString *trackingReuseIndetifier = @"trackingReuseIndetifier";
MAAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:trackingReuseIndetifier];
if (annotationView == nil)
{
annotationView = [[MAAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:trackingReuseIndetifier];
}
annotationView.canShowCallout = NO;
annotationView.image = [UIImage imageNamed:IMG_NAME_TRACKING_ANNOTATION];
return annotationView;
}
但是在轨迹执行过程中,这个ball并不会跟着轨迹走,而是在绘制完成之后才静态的出现。
So 问题来了,如何是ball跟随轨迹运动?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.