我目前正在开发一款使用自定义TileSource在Google地图上显示数据的应用.我以*.png图像的形式获取这些数据,并且我正在使用URLTileProvider.
一切都运作良好,但我现在正试图使TileLayer透明化,或者至少部分透明化.目标是,图层是可见的,但底层的Google地图仍然可以通过.不知怎的,我被卡住了,因为我不知道如何实现这一目标.
如果有人能向我提示正确的方向,或者告诉我Google Maps API V2 for Android是否真的不支持此功能,我会非常乐于助人.
我需要你的帮助,因为我无法理解这一点.我在iOS中使用Mantle和CoreData.
我的关系定义如下:
帖子1:N评论
当我从我的REST服务中提取数据时,我创建了一个Mantle对象帖子,其中包含一个NSMutableArray of Comments.这完美无瑕.
然后我将其存储在Core Data中,这是我不知道我是否正确行事的地方.
[MTLManagedObjectAdapter managedObjectFromModel:post insertingIntoContext:[self getManagedObjectContext] error:&error];
Run Code Online (Sandbox Code Playgroud)
所以我这样做是为了将我的帖子对象存储到Core Data中.核心数据模型具有称为"post_has_comments"的关系,这是一种级联的一对多关系.所以在对象帖子上我有"posts_has_comments" - >级联,在我的对象"评论"上我与"Nullify"有一对一的关系.
Afaik,Core Data将其视为NSSet.我试图放入的是一个NSMutableArray,因为Mantle会照顾这个(至少那是它的源代码中的快速看起来告诉我的).
不幸的是,当我从Core Data获取对象时
Post* post = [MTLManagedObjectAdapter modelOfClass:Post.class fromManagedObject:[[self fetchedResultsController] objectAtIndexPath:indexPath] error:nil];
Run Code Online (Sandbox Code Playgroud)
对post对象的属性注释是一个空的NSSet,并且在事先插入事物时我遇到了一些错误.我得到的错误:
Core Data: annotation: repairing missing delete propagation for to-many relationship post_has_comments on object [...]
Run Code Online (Sandbox Code Playgroud)
我被卡住了 - 也许我错过了一些巨大的东西?
My Post Class实现以下静态方法:
+ (NSDictionary *)managedObjectKeysByPropertyKey {
return @{
@"post_id" : @"id",
@"comments" : @"post_has_comments"
};
}
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"post_id" : @"id",
};
}
+ (NSDictionary …Run Code Online (Sandbox Code Playgroud)