美文网首页
百度地图杂记

百度地图杂记

作者: LX2014 | 来源:发表于2017-06-19 17:04 被阅读6次

正在做一个百度地图的功能,先记录一些发现的点,后续完善整理

1,在路径规划demo中,有下面一段代码:

- (BMKAnnotationView *)mapView:(BMKMapView *)view viewForAnnotation:(id <BMKAnnotation>)annotation
{
    if ([annotation isKindOfClass:[RouteAnnotation class]]) {
        return [(RouteAnnotation*)annotation getRouteAnnotationView:view];
    }
    return nil;
}

这个方法可以获取annotation对应起点终点过程点的view数据。这个设计模式,是通过数据来获取对应的UI。在RouteAnnotation 的实例方法:-(void)getRouteAnnotationView:方法中封装了根据type属性获取不同节点的不同图片和不同的点击效果。

相关文章

网友评论

      本文标题:百度地图杂记

      本文链接:https://www.haomeiwen.com/subject/wuxnqxtx.html