3 Star 1 Fork 0

Sirius / XGMapRelatedOperations

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

#XGMapRelatedOperations 高德地图显示模式,放大,缩小,集成讯飞语音输入并绘制路线

项目的功能:

1️⃣对用户的位置进行跟踪定位;

2️⃣实现了高德地图的几种展示 ;

3️⃣通过地图中的经纬度和比例的系数来实现对地图的放大和缩小;

4️⃣实现对地图中的大头针的自定义;

5️⃣以动画的方式来返回到用户原来定位的位置;

6️⃣点击“航拍”按钮可以使地图进入航拍的模式;

7️⃣集成“讯飞语音”的中的语音听写功能来实现用户的输入(也可支持手动输入哦);

8️⃣通过点击“导航”按钮来实现用户的定位和输入的位置之间的路线绘制功能; 当再次点击“导航”或者“语音输入”按钮时会对以前的路线进行清除;

2016/11/23

9️⃣增加路线详情查看及距离展示页面

2016/12/5

🔟修复了点击地图缩小按钮时出现的bug

实现导航路线绘制代码:

-(void)startNav{

if (nil != _polyLineMutable) {
    [_map removeOverlays:_polyLineMutable];
    [_polyLineMutable removeAllObjects];
}
[_addressField resignFirstResponder];
MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init];
request.source = [MKMapItem mapItemForCurrentLocation];
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:_addressField.text completionHandler:^(NSArray<clplacemark *=""> * _Nullable placemarks, NSError * _Nullable error) {

    if (placemarks.count == 0 || error) {
        return ;
    }
    CLPlacemark *clPm = placemarks.lastObject;
    MKPlacemark *pm = [[MKPlacemark alloc] initWithPlacemark:clPm];
    request.destination = [[MKMapItem alloc] initWithPlacemark:pm];
    MKDirections *direction = [[MKDirections alloc] initWithRequest:request];
    [direction calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse * _Nullable response, NSError * _Nullable error) {
        for (MKRoute *route in response.routes) {
            for (MKRouteStep *step in route.steps) {
                NSLog(@"%@", step.instructions);
            }
            [_map addOverlay:route.polyline];
            [_polyLineMutable addObject:route.polyline];
        }
    }];
}];
}
The MIT License (MIT) Copyright (c) 2016 一个老兵 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

对地图的各种展示模式的使用、以及其他特有的属性、对用户的位置进行跟踪定位、集成讯飞语音的输入并实现对线路的绘制和删除以及对地图的放大和缩小功能 展开 收起
Objective-C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/xiao66guo/XGMapRelatedOperations.git
git@gitee.com:xiao66guo/XGMapRelatedOperations.git
xiao66guo
XGMapRelatedOperations
XGMapRelatedOperations
master

搜索帮助