【问题标题】:How to create transparent layer with route-me如何使用 route-me 创建透明层
【发布时间】: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


    【解决方案1】:

    看起来您正在使用直接 route-me/route-me 分支。 AFAIK,当前项目没有为多个地图源设置。您可能想查看route-me/alpstein fork 或mapbox fork,它们都支持多个平铺源。由于 mapbox 所做的工作,他们正在更频繁地获得更新和添加功能。从 route-me/route-me 到这些分支中的任何一个,它都不是即插即用的替代品。

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

    【讨论】:

    • 我会解决它,但会查看您对下一个版本的建议。标记不起作用,我想吃两张地图
    猜你喜欢
    • 1970-01-01
    • 2013-05-07
    • 2018-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-28
    • 2010-10-09
    相关资源
    最近更新 更多