Commit c0ba4855 authored by 7c00's avatar 7c00

优化 ios overlays

parent 98e00e02
...@@ -49,11 +49,13 @@ ...@@ -49,11 +49,13 @@
if (_strokeColor == nil) { if (_strokeColor == nil) {
_strokeColor = UIColor.blackColor; _strokeColor = UIColor.blackColor;
} }
_circle = [MACircle circleWithCenterCoordinate:_coordinate radius:_radius]; if (_renderer == nil) {
_renderer = [[MACircleRenderer alloc] initWithCircle:_circle]; _circle = [MACircle circleWithCenterCoordinate:_coordinate radius:_radius];
_renderer.lineWidth = _strokeWidth; _renderer = [[MACircleRenderer alloc] initWithCircle:_circle];
_renderer.strokeColor = _strokeColor; _renderer.lineWidth = _strokeWidth;
_renderer.fillColor = _fillColor; _renderer.strokeColor = _strokeColor;
_renderer.fillColor = _fillColor;
}
return _renderer; return _renderer;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#pragma ide diagnostic ignored "OCUnusedClassInspection" #pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface AMapCircleManager : RCTViewManager <MAMapViewDelegate> @interface AMapCircleManager : RCTViewManager
@end @end
@implementation AMapCircleManager { @implementation AMapCircleManager {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#pragma ide diagnostic ignored "OCUnusedClassInspection" #pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface AMapMarkerManager : RCTViewManager <MAMapViewDelegate> @interface AMapMarkerManager : RCTViewManager
@end @end
@implementation AMapMarkerManager { @implementation AMapMarkerManager {
......
...@@ -46,10 +46,12 @@ ...@@ -46,10 +46,12 @@
if (_strokeColor == nil) { if (_strokeColor == nil) {
_strokeColor = UIColor.blackColor; _strokeColor = UIColor.blackColor;
} }
_renderer = [[MAPolygonRenderer alloc] initWithPolygon:_polygon]; if (_renderer == nil) {
_renderer.lineWidth = _strokeWidth; _renderer = [[MAPolygonRenderer alloc] initWithPolygon:_polygon];
_renderer.strokeColor = _strokeColor; _renderer.lineWidth = _strokeWidth;
_renderer.fillColor = _fillColor; _renderer.strokeColor = _strokeColor;
_renderer.fillColor = _fillColor;
}
return _renderer; return _renderer;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#pragma ide diagnostic ignored "OCUnusedClassInspection" #pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface AMapPolygonManager : RCTViewManager <MAMapViewDelegate> @interface AMapPolygonManager : RCTViewManager
@end @end
@implementation AMapPolygonManager { @implementation AMapPolygonManager {
......
...@@ -94,13 +94,14 @@ ...@@ -94,13 +94,14 @@
if (_color == nil) { if (_color == nil) {
_color = UIColor.blackColor; _color = UIColor.blackColor;
} }
if (_renderer == nil) {
_renderer = [[MAMultiColoredPolylineRenderer alloc] initWithMultiPolyline:_polyline]; _renderer = [[MAMultiColoredPolylineRenderer alloc] initWithMultiPolyline:_polyline];
_renderer.lineWidth = _width; _renderer.lineWidth = _width;
_renderer.strokeColor = _color; _renderer.strokeColor = _color;
_renderer.strokeColors = _colors; _renderer.strokeColors = _colors;
_renderer.lineDash = _dashed; _renderer.lineDash = _dashed;
_renderer.gradient = _gradient; _renderer.gradient = _gradient;
}
return _renderer; return _renderer;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#pragma ide diagnostic ignored "OCUnusedClassInspection" #pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface AMapPolylineManager : RCTViewManager <MAMapViewDelegate> @interface AMapPolylineManager : RCTViewManager
@end @end
@implementation AMapPolylineManager { @implementation AMapPolylineManager {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment