Skip to content

Commit e8f6bb8

Browse files
committed
add Polyline.miterLimit
document default values for Polyline properties Buddy: Paul
1 parent 11908b9 commit e8f6bb8

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/private/WRLDPolyline.mm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ - (instancetype)initWithCoordinates:(CLLocationCoordinate2D *)coords
5959

6060
_color = [UIColor blackColor];
6161
_lineWidth = 10.0f;
62+
_miterLimit = 10.0f;
6263
_elevation = 0;
6364
_elevationMode = WRLDElevationMode::WRLDElevationModeHeightAboveGround;
6465
_indoorMapId = indoorMapId;
@@ -100,6 +101,16 @@ - (void)setLineWidth:(CGFloat)lineWidth
100101
m_pPolylineApi->SetThickness(m_polylineId, static_cast<float>(_lineWidth));
101102
}
102103

104+
- (void)setMiterLimit:(CGFloat)miterLimit
105+
{
106+
_miterLimit = miterLimit;
107+
if (![self nativeCreated])
108+
{
109+
return;
110+
}
111+
m_pPolylineApi->SetMiterLimit(m_polylineId, static_cast<float>(_miterLimit));
112+
}
113+
103114
- (void)setScalesWithMap:(Boolean)scalesWithMap
104115
{
105116
_scalesWithMap = scalesWithMap;
@@ -188,6 +199,7 @@ - (void)createNative:(Eegeo::Api::EegeoMapApi&) mapApi
188199
.SetCoordinates(m_coords)
189200
.SetFillColor([self _getColor])
190201
.SetThickness(static_cast<float>(_lineWidth))
202+
.SetMiterLimit(static_cast<float>(_miterLimit))
191203
.SetShouldScaleWithMap(_scalesWithMap)
192204
.SetElevationMode(elevationMode)
193205
.SetElevation(_elevation)

src/public/WRLDPolyline.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,35 @@ NS_ASSUME_NONNULL_BEGIN
3939
onFloor:(NSInteger)floorId;
4040

4141

42-
/// The color of the polyline.
42+
/// The color of the polyline. The default value is opaque black.
4343
@property (nonatomic, copy) UIColor* color;
4444

45-
/// The thickness in pixels of the polyline.
45+
/// The thickness in pixels of the polyline. The default value is 10.
4646
@property (nonatomic) CGFloat lineWidth;
4747

48+
/*! A value used to limit the extent of spikes where line segments join at small
49+
(acute) angles. The value of miterLimit represents the maximum ratio between the
50+
length of the miter join diagonal, and lineWidth. The default value is 10, which
51+
results in clamping of the miter diagonal when the join angle is less than
52+
approximately 11 degrees.
53+
*/
54+
@property (nonatomic) CGFloat miterLimit;
55+
4856
/// If YES, line width scales with perspective as the map viewpoint zooms in and out (default NO)
4957
@property (nonatomic) Boolean scalesWithMap;
5058

51-
/// The height of the polyline above either the ground, or sea-level, depending on the elevationMode property.
59+
/*! The height of the polyline above either the ground, or sea-level, depending on the elevationMode property.
60+
The default value is 0
61+
*/
5262
@property (nonatomic) CLLocationDistance elevation;
5363

5464
/*!
5565
Specifies how the elevation property of this polyline is interpreted:
5666
5767
- `WRLDElevationModeHeightAboveSeaLevel`: The elevation is an absolute altitude above mean sea level, in meters.
5868
- `WRLDElevationModeHeightAboveGround`: The elevation is a height relative to the map's terrain, in meters.
69+
70+
The default value is WRLDElevationModeHeightAboveGround
5971
*/
6072
@property (nonatomic) WRLDElevationMode elevationMode;
6173

0 commit comments

Comments
 (0)