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
338a88c475e646b2d320d453cd26ba8476e501c0
1 parent
479ad3fb
o Set the contentScaleFactor for the map tiled layer before every view update (s…
…hould fix #33 and #34)
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
MapView/Map/RMMapTiledLayerView.m
MapView/Map/RMMapView.m
samples/SampleMap/Classes/MainViewController.m
MapView/Map/RMMapTiledLayerView.m
View file @
338a88c
...
...
@@ -79,9 +79,10 @@
[
super
dealloc
];
}
-
(
void
)
layoutSubviews
-
(
void
)
setNeedsDisplay
{
self
.
contentScaleFactor
=
1
.
0
f
;
[
super
setNeedsDisplay
];
}
-
(
void
)
drawRect
:
(
CGRect
)
rect
...
...
MapView/Map/RMMapView.m
View file @
338a88c
...
...
@@ -1342,7 +1342,15 @@
adjustTilesForRetinaDisplay
=
doAdjustTilesForRetinaDisplay
;
[
self
createMapView
];
// Not so good: this replicates functionality from createMapView
int
tileSideLength
=
[[
self
tileSource
]
tileSideLength
];
if
(
adjustTilesForRetinaDisplay
&&
screenScale
>
1
.
0
)
((
CATiledLayer
*
)
tiledLayerView
.
layer
).
tileSize
=
CGSizeMake
(
tileSideLength
*
2
.
0
,
tileSideLength
*
2
.
0
);
else
((
CATiledLayer
*
)
tiledLayerView
.
layer
).
tileSize
=
CGSizeMake
(
tileSideLength
,
tileSideLength
);
[
self
setCenterCoordinate
:
self
.
centerCoordinate
animated
:
NO
];
}
-
(
RMProjection
*
)
projection
...
...
samples/SampleMap/Classes/MainViewController.m
View file @
338a88c
...
...
@@ -27,11 +27,13 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
mapView
.
delegate
=
self
;
/* -- Uncomment to constrain view
[mapView setConstraintsSW:((CLLocationCoordinate2D){-33.942221,150.996094})
NE:((CLLocationCoordinate2D){-33.771157,151.32019})]; */
// [mapView setConstraintsSouthWest:CLLocationCoordinate2DMake(47.0, 10.0)
// northEeast:CLLocationCoordinate2DMake(48.0, 11.0)];
mapView
.
centerCoordinate
=
CLLocationCoordinate2DMake
(
47
.
56
,
10
.
22
);
// mapView.adjustTilesForRetinaDisplay = YES;
mapView
.
delegate
=
self
;
[
self
updateInfo
];
}
...
...
Please
register
or
login
to post a comment