首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用route-me创建透明层

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

Stack Overflow用户
提问于 2012-02-03 22:36:06
回答 1查看 804关注 0票数 1

我正在与一些我无法控制的事情作斗争

我有一个带有透明切片的切片源,我想将其添加到底图(打开的街道地图)之上,但它不能正常工作

代码语言:javascript
复制
// 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,而不是红色,但正如您所看到的,它无论如何都是灰色的:-(

EN

回答 1

Stack Overflow用户

发布于 2012-07-21 20:22:26

看起来你用的是branch route-me/route-me分支。AFAIK,当前项目没有为多个地图源设置。你可能想看看route-me/alpstein分支或者mapbox fork,它们都支持多个tile源。由于mapbox正在做的工作,他们正在更频繁地获得更新和添加的功能。从route-me/route-me到这两个分支都不是即插即用替代。

顺便说一句,你真的需要一个新的磁贴源码吗,或者你可以用RMMarkers做你正在做的事情吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9130317

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档