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
c7ab4f9f
Commit
c7ab4f9f
authored
Oct 14, 2018
by
放牛的园子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成路径贴图功能,贴图图片需要放入images.xcassets
parent
cea0c23e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
AMapPathPolyline.m
lib/ios/AMap3D/maps/AMapPathPolyline.m
+20
-22
AMapPathPolylineManager.m
lib/ios/AMap3D/maps/AMapPathPolylineManager.m
+1
-1
No files found.
lib/ios/AMap3D/maps/AMapPathPolyline.m
View file @
c7ab4f9f
...
...
@@ -4,10 +4,10 @@
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
@implementation
AMapPathPolyline
{
MA
Multi
Polyline
*
_polyline
;
MA
MultiTexture
PolylineRenderer
*
_renderer
;
MAPolyline
*
_polyline
;
MAPolylineRenderer
*
_renderer
;
NSArray
_images
;
UIImage
*
_image
;
CGFloat
_width
;
UIColor
*
_color
;
NSArray
*
_colors
;
...
...
@@ -17,7 +17,7 @@
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
_polyline
=
[
MA
MultiPolyline
polylineWithCoordinates
:
nil
count
:
0
drawStyleIndexes
:
nil
];
_polyline
=
[
MA
Polyline
polylineWithCoordinates
:
nil
count
:
0
];
}
return
self
;
...
...
@@ -37,14 +37,9 @@
_renderer
.
lineWidth
=
width
;
}
-
(
void
)
setDashed
:
(
BOOL
)
dashed
{
_dashed
=
dashed
;
_renderer
.
lineDash
=
dashed
;
}
-
(
void
)
setGradient
:
(
BOOL
)
gradient
{
_gradient
=
gradient
;
_renderer
.
gradient
=
gradient
;
-
(
void
)
setColor
:
(
UIColor
*
)
color
{
_color
=
color
;
_renderer
.
strokeColor
=
color
;
}
-
(
CLLocationCoordinate2D
)
coordinate
{
...
...
@@ -55,12 +50,12 @@
return
_polyline
.
boundingMapRect
;
}
-
(
void
)
setImage
s
:
(
NSArray
<
NSString
*>
*
)
names
{
NSMutableArray
*
images
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSUInteger
index
=
0
;
index
<
names
.
count
;
index
++
)
{
[
images
addObject
:[
UIImage
imageNamed
:
names
[
index
]]
];
}
_images
=
images
;
-
(
void
)
setImage
:
(
NSString
*
)
name
{
_image
=
[
UIImage
imageNamed
:
name
];
//UIImage *temp = [UIImage imageNamed:@"path8"
];
//_renderer.strokeTextureImages = _images;
//[_polyline setDrawStyleIndexes:@[@(1),@(2)]]
;
}
-
(
MAOverlayRenderer
*
)
renderer
{
...
...
@@ -68,11 +63,14 @@
_color
=
UIColor
.
blackColor
;
}
if
(
_renderer
==
nil
)
{
_renderer
=
[[
MA
MultiTexturePolylineRenderer
alloc
]
initWithMulti
Polyline
:
_polyline
];
_renderer
=
[[
MA
PolylineRenderer
alloc
]
initWith
Polyline
:
_polyline
];
_renderer
.
lineWidth
=
_width
;
//_renderer.lineDash = _dashed;
//_renderer.gradient = _gradient;
[
_renderer
loadStrokeTextureImages
:
_images
];
_renderer
.
strokeColor
=
_color
;
//[_renderer loadTexture:[UIImage imageNamed:@"path8"]];
if
(
_image
!=
nil
){
[
_renderer
loadStrokeTextureImage
:
_image
];
}
//_renderer.strokeTextureImages = _images;
}
return
_renderer
;
}
...
...
lib/ios/AMap3D/maps/AMapPathPolylineManager.m
View file @
c7ab4f9f
...
...
@@ -20,6 +20,6 @@ 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
(
image
s
,
NSArray
)
RCT_EXPORT_VIEW_PROPERTY
(
image
,
NSString
)
@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