Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-amap3d
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-amap3d
Commits
608c7c99
Commit
608c7c99
authored
Oct 10, 2018
by
放牛的园子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加ISO路径贴图功能
parent
fa937f8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
0 deletions
+116
-0
AMapPathPolyline.h
lib/ios/AMap3D/maps/AMapPathPolyline.h
+11
-0
AMapPathPolyline.m
lib/ios/AMap3D/maps/AMapPathPolyline.m
+80
-0
AMapPathPolylineManager.m
lib/ios/AMap3D/maps/AMapPathPolylineManager.m
+25
-0
No files found.
lib/ios/AMap3D/maps/AMapPathPolyline.h
0 → 100644
View file @
608c7c99
#import <MAMapKit/MAMapKit.h>
#import "AMapOverlay.h"
#pragma ide diagnostic ignored "OCUnusedPropertyInspection"
@interface
AMapPathPolyline
:
AMapOverlay
@property
(
nonatomic
,
readonly
)
CLLocationCoordinate2D
coordinate
;
@property
(
nonatomic
,
readonly
)
MAMapRect
boundingMapRect
;
@end
lib/ios/AMap3D/maps/AMapPathPolyline.m
0 → 100644
View file @
608c7c99
#import "AMapPathPolyline.h"
#import "Coordinate.h"
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
@implementation
AMapPathPolyline
{
MAMultiPolyline
*
_polyline
;
MAMultiTexturePolylineRenderer
*
_renderer
;
NSArray
_images
;
CGFloat
_width
;
UIColor
*
_color
;
NSArray
*
_colors
;
BOOL
_dashed
;
BOOL
_gradient
;
}
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
_polyline
=
[
MAMultiPolyline
polylineWithCoordinates
:
nil
count
:
0
drawStyleIndexes
:
nil
];
}
return
self
;
}
-
(
void
)
setCoordinates
:
(
NSArray
<
Coordinate
*>
*
)
coordinates
{
CLLocationCoordinate2D
coords
[
coordinates
.
count
];
for
(
NSUInteger
i
=
0
;
i
<
coordinates
.
count
;
i
++
)
{
coords
[
i
]
=
coordinates
[
i
].
coordinate
;
}
[
_polyline
setPolylineWithCoordinates
:
coords
count
:
coordinates
.
count
];
}
-
(
void
)
setWidth
:
(
CGFloat
)
width
{
_width
=
width
;
_renderer
.
lineWidth
=
width
;
}
-
(
void
)
setDashed
:
(
BOOL
)
dashed
{
_dashed
=
dashed
;
_renderer
.
lineDash
=
dashed
;
}
-
(
void
)
setGradient
:
(
BOOL
)
gradient
{
_gradient
=
gradient
;
_renderer
.
gradient
=
gradient
;
}
-
(
CLLocationCoordinate2D
)
coordinate
{
return
_polyline
.
coordinate
;
}
-
(
MAMapRect
)
boundingMapRect
{
return
_polyline
.
boundingMapRect
;
}
-
(
void
)
setImages
:
(
NSArray
<
NSString
*>
*
)
names
{
NSMutableArray
*
images
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSUInteger
index
=
0
;
index
<
names
.
count
;
index
++
)
{
[
images
addObject
:[
UIImage
imageNamed
:
names
[
index
]]];
}
_images
=
images
;
}
-
(
MAOverlayRenderer
*
)
renderer
{
if
(
_color
==
nil
)
{
_color
=
UIColor
.
blackColor
;
}
if
(
_renderer
==
nil
)
{
_renderer
=
[[
MAMultiTexturePolylineRenderer
alloc
]
initWithMultiPolyline
:
_polyline
];
_renderer
.
lineWidth
=
_width
;
//_renderer.lineDash = _dashed;
//_renderer.gradient = _gradient;
[
_renderer
loadStrokeTextureImages
:
_images
];
}
return
_renderer
;
}
@end
lib/ios/AMap3D/maps/AMapPathPolylineManager.m
0 → 100644
View file @
608c7c99
#import <MAMapKit/MAMapView.h>
#import <React/RCTViewManager.h>
#import "AMapPathPolyline.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface
AMapPathPolylineManager
:
RCTViewManager
@end
@implementation
AMapPathPolylineManager
{
}
RCT_EXPORT_MODULE
()
-
(
UIView
*
)
view
{
return
[
AMapPathPolyline
new
];
}
RCT_EXPORT_VIEW_PROPERTY
(
coordinates
,
CoordinateArray
)
RCT_EXPORT_VIEW_PROPERTY
(
width
,
CGFloat
)
RCT_EXPORT_VIEW_PROPERTY
(
dashed
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
gradient
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
images
,
NSArray
)
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment