我想在mapbox中添加模糊效果.第一次加载地图时,时间只显示地图中的当前位置其他地图是蓝色.
当我将用户位置移动到另一个位置时,地图上的其他位置清晰.另外在特定位置显示注释,请参见屏幕截图
帮助我如何实现这一点
在这里,我将实现一些代码
- (CGPoint)convertLatLongCoord:(CGPoint)latLong {
CGSize screenSize = [UIScreen mainScreen].applicationFrame.size];
CGFloat SCALE = MIN(screenSize.width, screenSize.height) / (2.0 * EARTH_RADIUS);
CGFloat OFFSET = MIN(screenSize.width, screenSize.height) / 2.0;
CGFloat x = EARTH_RADIUS * cos(latLong.x) * cos(latLong.y) * SCALE + OFFSET;
CGFloat y = EARTH_RADIUS * cos(latLong.x) * sin(latLong.y) * SCALE + OFFSET;
return CGPointMake(x, y);
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
{
NSLog(@"data=%f",self.mapview.userLocation.coordinate.latitude);
CLLocation *currentLoc=[locations objectAtIndex:0];
_coordinate=currentLoc.coordinate;
CGPoint latLong = {_coordinate.latitude, _coordinate.longitude};
oldcord = [self convertLatLongCoord:latLong];
NSLog(@"Cartesian Coordinate: (%f, %f)",oldcord.x, …Run Code Online (Sandbox Code Playgroud)