objective-c - 路由我 : Location & Screen Position

标签 objective-c ios xcode dictionary route-me

我在我的 map View 上画了一堆标记。 所有对象的位置信息(纬度和经度)都存储在一个数组中。 为了优化性能,我不想绘制 ALL 标记。我只想在我目前看到的区域分配标记。但我从 Route Me API 获得的关于位置/屏幕的唯一信息是:

center.latitude;
center.longitude;

但是这个值只返回我整个 map 的中心,我想看到实际 View 的中心位置(纬度和经度)。我也可以获取 GPS 位置,但不能获取屏幕的中心位置。您认为有一种简单的方法可以获取这些信息吗?

这是我实现的一部分:

UIImage* object = [UIImage imageNamed:@"object.png"];
CLLocationCoordinate2D buoyLocation;   
    NSString* templatString;
    NSString* templongString;

   for (int i =0; i<(myArray.count); i=i+2)

            {

            templongString = [myArray objectAtIndex:i];
            templatString = [myarray objectAtIndex:i+1];

            objectLocation.latitude  = [templatString floatValue];
            objectLocation.longitude  = [templongString floatValue];


            myMarker = [[RMMarker alloc] initWithUIImage:object anchorPoint:CGPointMake(xspec, yspec)]; //0.5 1.0            
            [markerManager1 addMarker:myMarker AtLatLong:objectLocation];


         }

最佳答案

看看 RMMapContents 中的 latitudeLongitudeBoundingBoxForScreen| .

再见!

-- 兰迪

关于objective-c - 路由我 : Location & Screen Position,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7091208/

相关文章:

iphone - 貌似是小错误 "Expected expression"但是找不到解决方法

objective-c - 我怎样才能让我的 setter 设置?

ios - 给分段控制带来阴影

iphone - Facebook 安装的参数不返回数据

xcode - firebase_messaging : no notifications coming through

objective-c - 从一个 NSMutableArray 中删除包含在另一个数组中的元素

objective-c - 继承在模拟器上工作,但在 Iphone 上不行!

ios - 如何定位一个SCNNode来覆盖整个SCNView?

ios - 如何确保 uiview 在不同的 ipad 中看起来相同而不使用约束

ios - XCode 5.1 -> Xcode 方案在另一台机器上不可见