【问题标题】:Objective C: Can I charge a fee for my app if I am using Forward GeoCoding (Google API)?目标 C:如果我使用 Forward GeoCoding (Google API),我可以为我的应用程序收费吗?
【发布时间】:2011-05-09 04:20:11
【问题描述】:

在我的应用程序中,我打算使用转发地理编码来允许用户在搜索栏中输入地址,然后在地图上放置一个标记。

我可以仔细检查以下方法是否适用于我打算做的事情吗?

-(CLLocationCoordinate2D) addressLocation {
    NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
                       [searchBar.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    //NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];
    NSError* error;
    NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString] encoding:NSASCIIStringEncoding error:&error];
    NSArray *listItems = [locationString componentsSeparatedByString:@","];

    double latitude = 0.0;
    double longitude = 0.0;

    if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) {
        latitude = [[listItems objectAtIndex:2] doubleValue];
        longitude = [[listItems objectAtIndex:3] doubleValue];
    }
    else {
        //Show error
    }
    CLLocationCoordinate2D location;
    location.latitude = latitude;
    location.longitude = longitude;

    return location;
}

我将调用上述方法来获取纬度和经度,然后在地图上相应地添加注释。我需要为此注册一个 APIKey 吗?如果是,我应该在哪里包含它,在这种情况下我仍然可以为我的应用收取费用吗?

谢谢!

郑和

【问题讨论】:

    标签: objective-c ios mapkit geocoding


    【解决方案1】:

    虽然反向地理编码包含在 api 中,但普通地理编码不包含,并且需要 Google 的许可。遗憾的是,我可以告诉你这也不便宜,每年大约 8000 英镑以上,具体取决于数量。

    另一种方法是使用免费的地理编码服务,只需 google 一下,您就会找到一些。其他地图服务提供商(例如 CloudMade)也可以以很少的成本做类似的事情...CloudMade

    【讨论】:

    • 您好,谢谢!但是地理编码部分不是应用程序的核心是否重要?另外,当用户想问路时,我调用了 map.app?我给 google 写了个便条,但不确定他们是否会回复...
    猜你喜欢
    • 2018-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 1970-01-01
    • 2011-08-16
    • 2017-01-11
    相关资源
    最近更新 更多