Tag: 叠加

计算贴图时,如果在“叠加”贴图集之外的情况下显示在MapRect中

我正在研究一个使用MKOverlay视图的应用程序,将我自己的自定义地图放在Google底图上。 我一直在使用苹果公司出色的TileMap示例代码(来自WWDC 2010)作为指导。 我的问题 – 当“overzoomed”到比我生成的tile组更深的细节级别时,代码不显示任何内容,因为在计算的Z级没有可用的tile。 我想要的行为 – 当“超越”应用程序应该不断放大最深的瓷砖水平。 覆盖层变得模糊是一种很好的用户体验 – 覆盖层消失是一个非常糟糕的体验。 这里是返回要绘制的瓷砖的代码 – 我需要弄清楚如何修改这个来限制Z-深度,而不会破坏为叠加瓷砖计算的框架的缩放比例。 有什么想法吗??? – (NSArray *)tilesInMapRect:(MKMapRect)rect zoomScale:(MKZoomScale)scale { NSInteger z = zoomScaleToZoomLevel(scale); // PROBLEM: I need to find a way to cap z at my maximum tile directory depth. // Number of tiles wide or high (but not wide * high) NSInteger […]

与MapKit ios的渐变折线

我试图使用覆盖(MKOverlay)跟踪MKMapView上的路线。 但是,根据目前的速度,如果颜色正在改变(例如,如果用户从65英里/小时到30英里/小时的速度从绿色变为橙色),则我想在跟踪路线时使用具有渐变的耐克应用程序。 以下是我想要的截图: 所以,每隔20米,我就使用以下方法从旧坐标到新坐标添加覆盖图: // Create ac array of points. MKMapPoint *pointsArray = malloc(sizeof(CLLocationCoordinate2D) * 2); // Create 2 points. MKMapPoint startPoint = MKMapPointForCoordinate(CLLocationCoordinate2DMake(oldLatitude, oldLongitude)); MKMapPoint endPoint = MKMapPointForCoordinate(CLLocationCoordinate2DMake(newLatitude, newLongitude)); // Fill the array. pointsArray[0] = startPoint; pointsArray[1] = endPoint; // Erase polyline and polyline view if not nil. if (self.routeLine != nil) self.routeLine = […]