【问题标题】:Google Map Kit, draw polylines for walk like google map ios谷歌地图工具包,像谷歌地图ios一样为步行绘制折线
【发布时间】:2014-12-18 06:38:28
【问题描述】:

我想使用 google maps ios sdk 在 ios 中像 google map app 一样绘制多段线。为了更清楚地理解我正在上传来自谷歌地图应用程序(ios。)的图像

【问题讨论】:

标签: ios google-maps-sdk-ios


【解决方案1】:

你是问如何实现虚线折线效果?如果是这样,我认为 SDK 不支持。

您可以使用 GMSCircles 手动创建类似的效果。

    for(int x = 0; x < [self.path count]; x++)
    {
        CLLocationCoordinate2D coord = [self.path coordinateAtIndex:x];

        //draw circle coord
        GMSCircle *circle = [GMSCircle circleWithPosition:coord radius:20];
        circle.fillColor = [UIColor blueColor];
        circle.strokeColor = [UIColor blackColor];
        circle.strokeWidth = 2;

        circle.map = mapView;
    }

要使这个看起来像原始示例,您可能需要在线上添加额外的点,以使圆圈均匀分布。为此,您可以这样做。

    for(all the points in the path)
    {
        if(the distance from pointA to pointB is > some distance)
        {
            centerPtr = center point of pointA and pointB
            insert centerPt in path
        }
    }

你可以把它变成一个简单的递归函数,它应该给你类似于你正在寻找的东西。

【讨论】:

    猜你喜欢
    • 2016-05-14
    • 2014-03-19
    • 2013-07-02
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 2018-03-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多