【发布时间】:2012-02-03 14:36:05
【问题描述】:
我正在努力解决我无法解决的问题
我有一个带有透明图块的图块源,我想将它添加到基本地图(打开的街道地图)上,但它无法正常工作
// 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 瓷砖。然而结果并不像我预期的那样:
请注意,我发布的 sn-p 是在拉了一些头发之后,我首先将背景设置为 clearColor 而不是红色,但你可以看到它无论如何都是灰色的:-(
【问题讨论】:
标签: objective-c ios map overlay route-me