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
38946966e3e088a184ef5ea47d05a8677fad46cd
1 parent
ad007a59
o Added the missing cluster marker anchor point in the MarkerMurder sample app
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
samples/MapTestbed/Classes/MapTestbedAppDelegate.m
samples/MarkerMurder/Classes/MainViewController.m
samples/MapTestbed/Classes/MapTestbedAppDelegate.m
View file @
3894696
...
...
@@ -48,11 +48,9 @@
UIImage
*
xMarkerImage
=
[
UIImage
imageNamed
:
@"marker-X.png"
];
// if we zoom with bounds after the paths are created, nothing is displayed on the map
CLLocationCoordinate2D
northeast
,
southwest
;
northeast
.
latitude
=
48
.
885875363989435
f
;
northeast
.
longitude
=
2
.
338285446166992
f
;
southwest
.
latitude
=
48
.
860406466081656
f
;
southwest
.
longitude
=
2
.
2885894775390625
;
CLLocationCoordinate2D
northeast
=
CLLocationCoordinate2DMake
(
48
.
885875363989435
f
,
2
.
338285446166992
f
),
southwest
=
CLLocationCoordinate2DMake
(
48
.
860406466081656
f
,
2
.
2885894775390625
);
[
mapView
zoomWithLatitudeLongitudeBoundsSouthWest
:
southwest
northEast
:
northeast
animated
:
NO
];
CLLocation
*
one
,
*
two
,
*
three
,
*
four
;
...
...
@@ -61,7 +59,7 @@
three
=
[[[
CLLocation
alloc
]
initWithLatitude
:
48
.
87351371451778
f
longitude
:
2
.
2948551177978516
f
]
autorelease
];
four
=
[[[
CLLocation
alloc
]
initWithLatitude
:
48
.
86600492029781
f
longitude
:
2
.
3194026947021484
f
]
autorelease
];
NSArray
*
linePoints
=
[
NSArray
arrayWithObjects
:
one
,
two
,
three
,
four
,
nil
];
// draw a green path south down an avenue and southeast on Champs-Elysees
RMAnnotation
*
pathAnnotation
=
[
RMAnnotation
annotationWithMapView
:
mapView
coordinate
:
one
.
coordinate
andTitle
:
nil
];
pathAnnotation
.
annotationType
=
@"path"
;
...
...
samples/MarkerMurder/Classes/MainViewController.m
View file @
3894696
...
...
@@ -47,15 +47,16 @@
UIImage
*
blueMarkerImage
=
[
UIImage
imageNamed
:
@"marker-blue.png"
];
markerPosition
.
latitude
=
center
.
latitude
-
((
kNumberRows
-
1
)
/
2
.
0
*
kSpacing
);
int
i
,
j
;
for
(
i
=
0
;
i
<
kNumberRows
;
i
++
)
for
(
int
i
=
0
;
i
<
kNumberRows
;
i
++
)
{
markerPosition
.
longitude
=
center
.
longitude
-
((
kNumberColumns
-
1
)
/
2
.
0
*
kSpacing
);
for
(
j
=
0
;
j
<
kNumberColumns
;
j
++
)
for
(
int
j
=
0
;
j
<
kNumberColumns
;
j
++
)
{
markerPosition
.
longitude
+=
kSpacing
;
NSLog
(
@"Add marker @ {%f,%f}
"
,
markerPosition
.
longitude
,
markerPosition
.
latitude
);
NSLog
(
@"Add marker @ {%f,%f}
= {%f,%f}"
,
markerPosition
.
longitude
,
markerPosition
.
latitude
,
[
mapView
coordinateToProjectedPoint
:
markerPosition
].
x
,
[
mapView
coordinateToProjectedPoint
:
markerPosition
].
y
);
RMAnnotation
*
annotation
=
[
RMAnnotation
annotationWithMapView
:
mapView
coordinate
:
markerPosition
andTitle
:[
NSString
stringWithFormat
:
@"%4.1f"
,
markerPosition
.
longitude
]];
...
...
@@ -170,7 +171,7 @@
if
([
annotation
.
annotationType
isEqualToString
:
kRMClusterAnnotationTypeName
])
{
marker
=
[[[
RMMarker
alloc
]
initWithUIImage
:[
UIImage
imageNamed
:
@"marker-blue.png"
]
anchorPoint
:
annotation
.
anchorPoint
]
autorelease
];
marker
=
[[[
RMMarker
alloc
]
initWithUIImage
:[
UIImage
imageNamed
:
@"marker-blue.png"
]
anchorPoint
:
CGPointMake
(
0
.
5
,
1
.
0
)
]
autorelease
];
if
(
annotation
.
title
)
[(
RMMarker
*
)
marker
changeLabelUsingText
:
annotation
.
title
];
}
...
...
Please
register
or
login
to post a comment