2012-02-03 65 views
1

林的東西,我不能讓我的頭以防萬一如何使用路由我

我有,我想在底圖上添加透明的瓷磚瓷磚源奮力打造透明層(開放街道地圖)但它不工作,因爲它應該

// 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

看起來像你正在使用直線路線我路線我的分支AFAIK,目前的項目沒有設置爲多個地圖來源你可能想看看route-me/alpstein分叉或mapbox fork,它們均支持多瓦的來源,因爲那mapbox是幹什麼的,他們所得到更新和功能的工作增加了很多更頻繁的,它不是一個即插即用的代換從路線-ME /路由我到這些分支。

順便說一句,你真的需要一個新的瓷磚源,或者你可以做你與RMMarkers做什麼?

+0

我工作圍繞它,但會看你的建議下一個版本。標記將無法正常工作,我想吃晚飯實行兩個地圖 – CocoaChris 2013-07-16 07:03:52