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
66e8625a0e71d70cf57e8eaa944cdbe437649e13
1 parent
4fcfaa3a
o Fixed -(double)scaleDenominator for devices with and without retina displays
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
MapView/Map/RMMapView.m
MapView/Map/RMMapView.m
View file @
66e8625
...
...
@@ -47,7 +47,6 @@
#pragma mark --- begin constants ----
#define kiPhoneMilimeteresPerPixel .1543
#define kZoomRectPixelBuffer 150.0
#define kDefaultInitialLatitude 47.56
...
...
@@ -1332,13 +1331,26 @@
return
metersPerPixel
/
screenScale
;
}
// From http://stackoverflow.com/questions/610193/calculating-pixel-size-on-an-iphone
#define kiPhone3MillimeteresPerPixel 0.1558282
#define kiPhone4MillimetersPerPixel (0.0779 * 2.0)
#define iPad1MillimetersPerPixel 0.1924
#define iPad3MillimetersPerPixel (0.09621 * 2.0)
-
(
double
)
scaleDenominator
{
double
routemeMetersPerPixel
=
metersPerPixel
;
double
iphoneMillimetersPerPixel
=
kiPhoneMilimeteresPerPixel
;
double
truescaleDenominator
=
routemeMetersPerPixel
/
(
0
.
001
*
iphoneMillimetersPerPixel
);
double
iphoneMillimetersPerPixel
;
BOOL
deviceIsIPhone
=
([[
UIDevice
currentDevice
]
userInterfaceIdiom
]
==
UIUserInterfaceIdiomPhone
);
BOOL
deviceHasRetinaDisplay
=
(
screenScale
>
1
.
0
);
if
(
deviceHasRetinaDisplay
)
iphoneMillimetersPerPixel
=
(
deviceIsIPhone
?
kiPhone4MillimetersPerPixel
:
iPad3MillimetersPerPixel
);
else
iphoneMillimetersPerPixel
=
(
deviceIsIPhone
?
kiPhone3MillimeteresPerPixel
:
iPad1MillimetersPerPixel
);
return
truescaleDenominator
;
return
((
metersPerPixel
*
1000
.
0
)
/
iphoneMillimetersPerPixel
)
;
}
-
(
void
)
setMinZoom
:
(
float
)
newMinZoom
...
...
Please
register
or
login
to post a comment