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
Justin R. Miller
13 years ago
Commit
60458aee4230f757db90a6b4a1995b2b8b25d577
1 parent
4cfb5cbd
better tile notifications on mail queue & with tile reference hashes
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
MapView/Map/RMAbstractWebMapSource.m
MapView/Map/RMMBTilesTileSource.m
MapView/Map/RMAbstractWebMapSource.m
View file @
60458ae
...
...
@@ -61,7 +61,10 @@
if
(
image
)
return
image
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRequested
object
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
(
void
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRequested
object
:[
NSNumber
numberWithUnsignedLongLong
:
RMTileKey
(
tile
)]];
});
[
tileCache
retain
];
...
...
@@ -93,12 +96,12 @@
if
(
tileData
)
{
dispatch_sync
(
dispatch_get_main_queue
(),
^
(
void
)
@synchronized
(
self
)
{
// safely put into collection array in proper order
//
[
tilesData
replaceObjectAtIndex
:
u
withObject
:
tileData
];
}
)
;
};
}
});
}
...
...
@@ -135,7 +138,10 @@
[
tileCache
release
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRetrieved
object
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
(
void
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRetrieved
object
:[
NSNumber
numberWithUnsignedLongLong
:
RMTileKey
(
tile
)]];
});
if
(
!
image
)
return
[
RMTileImage
errorTile
];
...
...
MapView/Map/RMMBTilesTileSource.m
View file @
60458ae
...
...
@@ -96,6 +96,11 @@
NSInteger
x
=
tile
.
x
;
NSInteger
y
=
pow
(
2
,
zoom
)
-
tile
.
y
-
1
;
dispatch_async
(
dispatch_get_main_queue
(),
^
(
void
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRequested
object
:[
NSNumber
numberWithUnsignedLongLong
:
RMTileKey
(
tile
)]];
});
__block
UIImage
*
image
;
[
queue
inDatabase
:
^
(
FMDatabase
*
db
)
...
...
@@ -120,6 +125,11 @@
[
results
close
]
;
}];
dispatch_async
(
dispatch_get_main_queue
(),
^
(
void
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
RMTileRetrieved
object
:[
NSNumber
numberWithUnsignedLongLong
:
RMTileKey
(
tile
)]];
});
return
image
;
}
...
...
Please
register
or
login
to post a comment