使用了百度地图的SDK,定位图片一直是蓝色的小圆点,很不喜欢,想换成自定义的图片,在网上搜罗了一大通,找到了解决的方案。

  写下如下代码:

//定位图层自定义样式参数
    BMKLocationViewDisplayParam *displayParam = [BMKLocationViewDisplayParam new];
    displayParam.isRotateAngleValid =YES;
    displayParam.isAccuracyCircleShow =YES;
    displayParam.locationViewImgName = @"icon_map_location";
    displayParam.locationViewOffsetX =0;
    displayParam.locationViewOffsetY =0;
    
    [_mapView updateLocationViewWithParam:displayParam];

 

locationViewImgName后面是你想要换成的图片的名字。重点来了,要把你的图片存放的位置放在mapapi.bundle/images文件下就可以实现替换功能了。

  

posted on 2016-06-16 22:24  steer  阅读(2993)  评论(0编辑  收藏  举报