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
Bald Mountain
16 years ago
Commit
b0a78be83a476c750fddafb8b2925b1cdb4fc650
1 parent
9d68e417
Changes for setting frame size. Some bug fixes
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
8 deletions
MapView/ApplicationSupport/MapViewViewController.m
MapView/Map/RMMapContents.m
MapView/Map/RMMapView.h
MapView/Map/RMMapView.m
MapView/Map/RMMercatorToScreenProjection.h
MapView/Map/RMMercatorToScreenProjection.m
MapView/Map/RMTileImage.m
MapView/Map/RMTileImageSet.h
MapView/Map/RMTileImageSet.m
MapView/ApplicationSupport/MapViewViewController.m
View file @
b0a78be
...
...
@@ -137,7 +137,7 @@
[
marker
setTextLabel
:
@"Hello"
];
[
markerManager
addMarker
:
marker
AtLatLong
:[[
mapView
contents
]
mapCenter
]];
[
marker
release
];
NSLog
(
@"Center: Lat: %lf Lon: %lf"
,
[
mapView
centerCoordinates
].
latitude
,
[
mapView
centerCoordinates
]
.
longitude
);
NSLog
(
@"Center: Lat: %lf Lon: %lf"
,
mapView
.
contents
.
mapCenter
.
latitude
,
mapView
.
contents
.
mapCenter
.
longitude
);
// What did this do?
// [mapView setZoomBounds:0.0 maxZoom:17.0];
...
...
MapView/Map/RMMapContents.m
View file @
b0a78be
...
...
@@ -120,6 +120,7 @@
-
(
void
)
dealloc
{
[
imagesOnScreen
cancelLoading
];
[
self
setRenderer
:
nil
];
[
imagesOnScreen
release
];
[
tileLoader
release
];
...
...
MapView/Map/RMMapView.h
View file @
b0a78be
...
...
@@ -65,5 +65,6 @@ typedef struct {
-
(
RMLatLongBounds
)
getScreenCoordinateBounds
;
-
(
void
)
didReceiveMemoryWarning
;
@end
...
...
MapView/Map/RMMapView.m
View file @
b0a78be
...
...
@@ -24,7 +24,6 @@
-
(
void
)
stopDeceleration
;
@end
@implementation
RMMapView
(
Internal
)
BOOL
delegateHasBeforeMapMove
;
BOOL
delegateHasAfterMapMove
;
...
...
@@ -43,9 +42,13 @@
@implementation
RMMapView
@synthesize
decelerationFactor
;
-
(
RMMarkerManager
*
)
markerManager
{
return
contents
.
markerManager
;
}
-
(
void
)
initValues
:
(
CLLocationCoordinate2D
)
latlong
{
if
(
round
(
latlong
.
latitude
)
!=
0
&&
round
(
latlong
.
longitude
)
!=
0
)
{
contents
=
[[
RMMapContents
alloc
]
initForView
:
self
WithLocation
:
latlong
];
...
...
@@ -487,5 +490,25 @@
}
}
-
(
void
)
didReceiveMemoryWarning
{
CLLocationCoordinate2D
coord
=
contents
.
mapCenter
;
[
contents
release
];
[
self
initValues
:
coord
];
}
-
(
void
)
setFrame
:
(
CGRect
)
frame
{
CGRect
r
=
self
.
frame
;
[
super
setFrame
:
frame
];
// only change if the frame changes AND there is contents
if
(
!
CGRectEqualToRect
(
r
,
frame
)
&&
contents
)
{
CLLocationCoordinate2D
coord
=
contents
.
mapCenter
;
float
zoom
=
contents
.
zoom
;
[
contents
release
];
[
self
initValues
:
coord
];
contents
.
zoom
=
zoom
;
}
}
@end
...
...
MapView/Map/RMMercatorToScreenProjection.h
View file @
b0a78be
...
...
@@ -62,6 +62,7 @@
-
(
void
)
setXYBounds
:
(
RMXYRect
)
bounds
;
-
(
RMXYPoint
)
XYCenter
;
-
(
void
)
setXYCenter
:
(
RMXYPoint
)
aPoint
;
-
(
void
)
setScreenBounds
:(
CGRect
)
rect
;
-
(
CGRect
)
screenBounds
;
@property
(
assign
,
readwrite
)
float
scale
;
...
...
MapView/Map/RMMercatorToScreenProjection.m
View file @
b0a78be
...
...
@@ -206,6 +206,11 @@
origin
.
y
-=
screenBounds
.
size
.
height
*
scale
/
2
;
}
-
(
void
)
setScreenBounds
:
(
CGRect
)
rect
;
{
screenBounds
=
rect
;
}
-
(
CGRect
)
screenBounds
{
return
screenBounds
;
...
...
MapView/Map/RMTileImage.m
View file @
b0a78be
...
...
@@ -69,10 +69,10 @@ NSString * const RMMapImageLoadingCancelledNotification = @"MapImageLoadingCance
// if (image)
// CGImageRelease(image);
[
image
release
];
[
layer
release
];
[
dataPending
release
];
[
lastUsedTime
release
];
[
image
release
];
image
=
nil
;
[
layer
release
];
layer
=
nil
;
[
dataPending
release
];
dataPending
=
nil
;
[
lastUsedTime
release
];
lastUsedTime
=
nil
;
[
super
dealloc
];
}
...
...
MapView/Map/RMTileImageSet.h
View file @
b0a78be
...
...
@@ -57,6 +57,8 @@
-
(
void
)
printDebuggingInformation
;
-
(
void
)
cancelLoading
;
@property
(
assign
,
nonatomic
,
readwrite
)
id
delegate
;
@property
(
retain
,
nonatomic
,
readwrite
)
id
<
RMTileSource
>
tileSource
;
@end
...
...
MapView/Map/RMTileImageSet.m
View file @
b0a78be
...
...
@@ -93,7 +93,8 @@
{
NSArray
*
imagelist
=
[
images
allObjects
];
for
(
RMTileImage
*
img
in
imagelist
)
{
for
(
int
i
=
0
;
i
<
[
images
countForObject
:
img
];
i
++
)
NSInteger
count
=
[
images
countForObject
:
img
];
for
(
int
i
=
0
;
i
<
count
;
i
++
)
[
self
removeTile
:
img
.
tile
];
}
}
...
...
@@ -275,4 +276,13 @@
NSLog
(
@"Biggest seam right: %f down: %f"
,
biggestSeamRight
,
biggestSeamDown
);
}
-
(
void
)
cancelLoading
{
for
(
RMTileImage
*
image
in
images
)
{
[
image
cancelLoading
];
}
}
@end
...
...
Please
register
or
login
to post a comment