我正在与一些我无法控制的事情作斗争
我有一个带有透明切片的切片源,我想将其添加到底图(打开的街道地图)之上,但它不能正常工作
// setup a base map
baseMapView = [[RMMapView alloc]initWithFrame: CGRectMake(0, 0, self.view.frame.size.width - self.view.frame.origin.x, self.view.frame.size.height - self.view.frame.origin.y) ];
[baseMapView setBackgroundColor:[UIColor blackColor]];
[baseMapView setDelegate:self];
[baseMapView setDeceleration:YES];
[[baseMapView contents] setTileSource:[[[RMOpenStreetMapSource alloc] init] autorelease]];
[self.view addSubview: baseMapView];
// markings in transparent png
markerMapView = [[RMMapView alloc]initWithFrame: CGRectMake(0, 0, self.view.frame.size.width - self.view.frame.origin.x, self.view.frame.size.height - self.view.frame.origin.y) ];
[markerMapView setBackgroundColor:[UIColor redColor]];
[markerMapView setAlpha: 0.5];
[markerMapView setOpaque:NO];
[markerMapView setDelegate:self];
[markerMapView setDeceleration:YES];
LLOpenSeaMapSource *tileSource = [[LLOpenSeaMapSource alloc] init];
tileSource.baseURL = @"http://tiles.luky.nl/mark";
[[markerMapView contents] setTileSource: tileSource];
[self.view addSubview: markerMapView];图像是透明的png瓷砖。然而,结果并不像我预期的那样:

请注意,我发布的代码片段是经过一些拉扯之后的,我首先将背景设置为clearColor,而不是红色,但正如您所看到的,它无论如何都是灰色的:-(
发布于 2012-07-21 20:22:26
看起来你用的是branch route-me/route-me分支。AFAIK,当前项目没有为多个地图源设置。你可能想看看route-me/alpstein分支或者mapbox fork,它们都支持多个tile源。由于mapbox正在做的工作,他们正在更频繁地获得更新和添加的功能。从route-me/route-me到这两个分支都不是即插即用替代。
顺便说一句,你真的需要一个新的磁贴源码吗,或者你可以用RMMarkers做你正在做的事情吗?
https://stackoverflow.com/questions/9130317
复制相似问题