iOS 高德地图搜索结果大头针显示
伊谢尔伦
伊谢尔伦 2017-04-17 13:30:58
[iOS讨论组]

在页面上添加了搜索代码,模拟器上面显示出来搜索结果,但是地图与搜索结果相对于要出现在上面的大头针却没有显示出来,这是什么原因,

设置搜索的代码;
_searchMapView = [[AMapSearchAPI alloc] initWithSearchKey:[MAMapServices sharedServices].apiKey Delegate:self];
AMapInputTipsSearchRequest *tipsRequest= [[AMapInputTipsSearchRequest alloc] init];
tipsRequest.keywords = searchKeyWord;
tipsRequest.searchType = AMapSearchType_InputTips;
tipsRequest.city = @[@"北京"];
if ([kCurentLanguage isEqualToString:@"en"]) {
_searchMapView.language = AMapSearchLanguage_en;
}
else if ([kCurentLanguage isEqualToString:@"zh-Hans"]) {
_searchMapView.language = AMapSearchLanguage_zh_CN;
}
//发起输入提示搜索
[_searchMapView AMapInputTipsSearch: tipsRequest];
实现搜索结果的回调:
 //实现输入提示的回调函数
-(void)onInputTipsSearchDone:(AMapInputTipsSearchRequest*)request response:(AMapInputTipsSearchResponse *)response
{
    if(response.tips.count == 0) {
        return;
    }
    else {
        if (_selecedIndex == 0) {
            _addAttractionsDataArray = [self resultArray:response.tips];
            [_acttractionsTableView reloadData];
        }
        else if (_selecedIndex == 1) {
            _addStayDataArray = [self resultArray:response.tips];
            [_stayTableView reloadData];
        }
        else if (_selecedIndex == 2) {
            _addEatDataArray = [self resultArray:response.tips];
            [_eatTableView reloadData];
        }
    }
}
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号