I wants to draw polyline for walk like google map app in ios using google maps ios sdk. For more clear understanding i am uploading image that is from google map app(ios.)
请问如何实现虚线折线效果?如果是这样,我认为 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
}
}
您可以将其转换为一个简单的递归函数,它应该为您提供与您正在寻找的内容类似的内容。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)