Toggle navigation
Toggle navigation
This project
Loading...
Sign in
尹诚
/
Mapbox-iOS-SDK
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Thomas Rasch
13 years ago
Commit
c576a4ba552796fd0caf2a23a80ba911962a15fd
1 parent
f5085877
o Added methods to hide/show individual tilesource layers
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
MapView/Map/RMMapView.h
MapView/Map/RMMapView.m
samples/MarkerMurder/Classes/MainViewController.m
MapView/Map/RMMapView.h
View file @
c576a4b
...
...
@@ -242,6 +242,9 @@ typedef enum {
-
(
void
)
moveTileSourceAtIndex
:(
NSUInteger
)
fromIndex
toIndex
:(
NSUInteger
)
toIndex
;
-
(
void
)
setHidden
:(
BOOL
)
isHidden
forTileSource
:(
id
<
RMTileSource
>
)
tileSource
;
-
(
void
)
setHidden
:(
BOOL
)
isHidden
forTileSourceAtIndex
:(
NSUInteger
)
index
;
#pragma mark - Cache
/// Clear all images from the #tileSource's caching system.
...
...
MapView/Map/RMMapView.m
View file @
c576a4b
...
...
@@ -1479,6 +1479,30 @@
[
self
setCenterProjectedPoint
:
centerPoint
animated
:
NO
];
}
-
(
void
)
setHidden
:
(
BOOL
)
isHidden
forTileSource
:
(
id
<
RMTileSource
>
)
tileSource
{
NSArray
*
tileSources
=
[
self
tileSources
];
for
(
NSUInteger
i
=
0
;
i
<
[
tileSources
count
];
++
i
)
{
id
<
RMTileSource
>
currentTileSource
=
[
tileSources
objectAtIndex
:
i
];
if
(
tileSource
==
currentTileSource
)
{
[
self
setHidden
:
isHidden
forTileSourceAtIndex
:
i
];
break
;
}
}
}
-
(
void
)
setHidden
:
(
BOOL
)
isHidden
forTileSourceAtIndex
:
(
NSUInteger
)
index
{
if
(
index
>=
[
_tiledLayersSuperview
.
subviews
count
])
return
;
((
RMMapTiledLayerView
*
)[
_tiledLayersSuperview
.
subviews
objectAtIndex
:
index
]).
hidden
=
isHidden
;
}
#pragma mark - Properties
-
(
UIView
*
)
backgroundView
...
...
samples/MarkerMurder/Classes/MainViewController.m
View file @
c576a4b
...
...
@@ -9,6 +9,7 @@
#import "MainView.h"
#import "RMOpenStreetMapSource.h"
#import "RMOpenSeaMapLayer.h"
#import "RMMapView.h"
#import "RMMarker.h"
#import "RMCircle.h"
...
...
@@ -111,6 +112,22 @@
[
self
updateInfo
];
[
self
performSelector
:
@selector
(
addMarkers
)
withObject
:
nil
afterDelay
:
0
.
5
];
// double delayInSeconds = 5.0;
// dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
// dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// [mapView addTileSource:[[[RMOpenSeaMapLayer alloc] init] autorelease]];
//
// dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
// dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// [mapView setHidden:YES forTileSourceAtIndex:1];
//
// dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
// dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// [mapView setHidden:NO forTileSourceAtIndex:1];
// });
// });
// });
}
-
(
void
)
didReceiveMemoryWarning
...
...
Please
register
or
login
to post a comment