繁体   English   中英

如何使用route-me创建透明层

[英]How to create transparent layer with 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图块。 但是结果却不是我所期望的:

las作为叠加不是很有用 请注意,我发布的代码段是在拔头发后开始的,我首先将背景设置为clearColor而不是红色,但是无论如何您都可以看到它是灰色的:-(

好像您使用的是route-me / route-me分支一样。 AFAIK,当前项目未针对多个地图源设置。 您可能想查看route-me / alpstein分支或mapbox分支 ,它们都支持多个图块源。 由于mapbox正在做的工作,他们越来越频繁地更新和添加功能。 从route-me / route-me到这两个分支中的任何一个,都不是即插即用的替代品。

顺便说一句,您是否真的需要一个新的图块源,或者您可以使用RMMarkers做您正在做的事情?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM