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
5e7c4826
Commit
5e7c4826
authored
Sep 03, 2017
by
7c00
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现 ios 海量点图层(MultiPoint)
parent
682c4685
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
3 deletions
+97
-3
Contents.json
...ios/RNAMap3D/Images.xcassets/point.imageset/Contents.json
+22
-0
point.png
...ple/ios/RNAMap3D/Images.xcassets/point.imageset/point.png
+0
-0
AMapHeatMap.h
ios/AMapHeatMap.h
+0
-2
AMapHeatMap.m
ios/AMapHeatMap.m
+0
-1
AMapMultiPoint.h
ios/AMapMultiPoint.h
+7
-0
AMapMultiPoint.m
ios/AMapMultiPoint.m
+38
-0
AMapMultiPointManager.m
ios/AMapMultiPointManager.m
+23
-0
RCTConvert+AMapView.m
ios/RCTConvert+AMapView.m
+7
-0
No files found.
example/ios/RNAMap3D/Images.xcassets/point.imageset/Contents.json
0 → 100644
View file @
5e7c4826
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"point.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
example/ios/RNAMap3D/Images.xcassets/point.imageset/point.png
0 → 100644
View file @
5e7c4826
4.84 KB
ios/AMapHeatMap.h
View file @
5e7c4826
#import <MAMapKit/MAMapKit.h>
#import "AMapModel.h"
#pragma ide diagnostic ignored "OCUnusedPropertyInspection"
@interface
AMapHeatMap
:
AMapModel
@end
ios/AMapHeatMap.m
View file @
5e7c4826
#import "AMapHeatMap.h"
#import "Coordinate.h"
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
...
...
ios/AMapMultiPoint.h
0 → 100644
View file @
5e7c4826
#import <React/RCTComponent.h>
#import <MAMapKit/MAMapKit.h>
#import "AMapModel.h"
@interface
AMapMultiPoint
:
AMapModel
<
MAMultiPointOverlayRendererDelegate
>
@property
(
nonatomic
,
copy
)
RCTBubblingEventBlock
onItemPress
;
@end
ios/AMapMultiPoint.m
0 → 100644
View file @
5e7c4826
#import "AMapMultiPoint.h"
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
@implementation
AMapMultiPoint
{
NSArray
<
MAMultiPointItem
*>
*
_items
;
MAMultiPointOverlayRenderer
*
_renderer
;
MAMultiPointOverlay
*
_overlay
;
UIImage
*
_image
;
}
-
(
void
)
setPoints
:
(
NSArray
<
MAMultiPointItem
*>
*
)
points
{
_items
=
points
;
}
-
(
void
)
setImage
:
(
NSString
*
)
name
{
_image
=
[
UIImage
imageNamed
:
name
];
}
-
(
MAOverlayRenderer
*
)
renderer
{
if
(
_renderer
==
nil
)
{
_overlay
=
[[
MAMultiPointOverlay
alloc
]
initWithMultiPointItems
:
_items
];
_renderer
=
[[
MAMultiPointOverlayRenderer
alloc
]
initWithMultiPointOverlay
:
_overlay
];
_renderer
.
delegate
=
self
;
if
(
_image
!=
nil
)
{
_renderer
.
icon
=
_image
;
}
}
return
_renderer
;
}
-
(
void
)
multiPointOverlayRenderer
:
(
MAMultiPointOverlayRenderer
*
)
renderer
didItemTapped
:
(
MAMultiPointItem
*
)
item
{
self
.
onItemPress
(@{
@"index"
:
@
([
_items
indexOfObject
:
item
]),
});
}
@end
ios/AMapMultiPointManager.m
0 → 100644
View file @
5e7c4826
#import <MAMapKit/MAMapView.h>
#import <React/RCTViewManager.h>
#import "AMapMultiPoint.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface
AMapMultiPointManager
:
RCTViewManager
@end
@implementation
AMapMultiPointManager
{
}
RCT_EXPORT_MODULE
()
-
(
UIView
*
)
view
{
return
[
AMapMultiPoint
new
];
}
RCT_EXPORT_VIEW_PROPERTY
(
points
,
MAMultiPointItemArray
)
RCT_EXPORT_VIEW_PROPERTY
(
image
,
NSString
)
RCT_EXPORT_VIEW_PROPERTY
(
onItemPress
,
RCTBubblingEventBlock
)
@end
ios/RCTConvert+AMapView.m
View file @
5e7c4826
...
...
@@ -31,6 +31,12 @@ RCT_ENUM_CONVERTER(MAPinAnnotationColor, (@{
return
node
;
}
+
(
MAMultiPointItem
*
)
MAMultiPointItem
:
(
id
)
json
{
MAMultiPointItem
*
item
=
[
MAMultiPointItem
new
];
item
.
coordinate
=
[
self
CLLocationCoordinate2D
:
json
];
return
item
;
}
+
(
MACoordinateRegion
)
MACoordinateRegion
:
(
id
)
json
{
return
MACoordinateRegionMake
(
[
self
CLLocationCoordinate2D
:
json
],
...
...
@@ -47,6 +53,7 @@ RCT_ENUM_CONVERTER(MAPinAnnotationColor, (@{
RCT_ARRAY_CONVERTER
(
Coordinate
)
RCT_ARRAY_CONVERTER
(
MAHeatMapNode
)
RCT_ARRAY_CONVERTER
(
MAMultiPointItem
)
RCT_ARRAY_CONVERTER
(
AMapNaviPoint
)
@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