如何用route-me创建透明层

时间:2012-02-03 14:36:06

标签: objective-c ios map overlay route-me

我正在努力解决一些我无法解决问题的事情

我有一个带有透明图块的图块源,我想在基本地图上添加(打开街道地图),但它不能正常工作

// 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图块。然而,结果并不像我预期的那样:

Alas not very useful as an overlay 请注意,我发布的片段是在一些头发拉动之后,我开始将背景设置为clearColor而不是红色,但是你可以看到它仍然是灰色的: - (

1 个答案:

答案 0 :(得分:1)

看起来你正在使用直接路由我/路由我分支。 AFAIK,当前项目未设置为多个地图源。您可能需要查看route-me/alpstein分叉或mapbox fork,它们都支持多个磁贴源。由于mapbox正在进行的工作,他们正在更频繁地添加更新和功能。从路由我/路线我到这些分支中的任何一个都不是插件和播放替代品。

顺便说一下,你真的需要一个新的瓷砖来源吗,或者你可以做你正在做的RMMarkers吗?

相关问题