|
@@ -119,8 +119,14 @@ public class MapViewDrawing extends MapView implements Drawing {
|
119
|
119
|
*/
|
120
|
120
|
private class MapViewMarkerOverlay extends MapViewOverlay implements MarkerOverlay {
|
121
|
121
|
|
122
|
|
- public MapViewMarkerOverlay(Marker marker, Color color) {
|
123
|
|
- super(new Layer[] { marker }, color);
|
|
122
|
+ private final AlphaMode alphaMode;
|
|
123
|
+ private Color innerColor;
|
|
124
|
+
|
|
125
|
+ public MapViewMarkerOverlay(Marker marker, Color outer, Color innerColor,
|
|
126
|
+ AlphaMode alphaMode) {
|
|
127
|
+ super(new Layer[] { marker }, outer);
|
|
128
|
+ this.innerColor = innerColor;
|
|
129
|
+ this.alphaMode = alphaMode;
|
124
|
130
|
}
|
125
|
131
|
|
126
|
132
|
@Override
|
|
@@ -131,10 +137,11 @@ public class MapViewDrawing extends MapView implements Drawing {
|
131
|
137
|
}
|
132
|
138
|
|
133
|
139
|
@Override
|
134
|
|
- public void setColor(Color color) {
|
|
140
|
+ public void setColor(Color outer) {
|
|
141
|
+ this.innerColor = this.innerColor.equals(this.color) ? outer : this.innerColor;
|
135
|
142
|
super.setColor(color);
|
136
|
143
|
MarkerAutoScaling marker = (MarkerAutoScaling) super.layers[0];
|
137
|
|
- marker.setImage(MarkerUtils.getMarkerForColor(color));
|
|
144
|
+ marker.setImage(MarkerUtils.getMarkerForColor(color, this.innerColor, this.alphaMode));
|
138
|
145
|
}
|
139
|
146
|
|
140
|
147
|
@Override
|
|
@@ -167,8 +174,10 @@ public class MapViewDrawing extends MapView implements Drawing {
|
167
|
174
|
public void setColor(Color color) {
|
168
|
175
|
super.setColor(color);
|
169
|
176
|
((PolylineAutoScaling) this.layers[0]).setColor(color);
|
170
|
|
- ((MarkerAutoScaling) this.layers[1]).setImage(MarkerUtils.getMarkerForColor(color));
|
171
|
|
- ((MarkerAutoScaling) this.layers[2]).setImage(MarkerUtils.getMarkerForColor(color));
|
|
177
|
+ ((MarkerAutoScaling) this.layers[1])
|
|
178
|
+ .setImage(MarkerUtils.getMarkerForColor(color, color, AlphaMode.TRANSPARENT));
|
|
179
|
+ ((MarkerAutoScaling) this.layers[2])
|
|
180
|
+ .setImage(MarkerUtils.getMarkerForColor(color, color, AlphaMode.TRANSPARENT));
|
172
|
181
|
}
|
173
|
182
|
|
174
|
183
|
}
|
|
@@ -351,14 +360,16 @@ public class MapViewDrawing extends MapView implements Drawing {
|
351
|
360
|
this.drawingClickListeners.remove(listener);
|
352
|
361
|
}
|
353
|
362
|
|
354
|
|
- protected MarkerAutoScaling createMarker(Point point, Color color) {
|
355
|
|
- Image image = MarkerUtils.getMarkerForColor(color);
|
|
363
|
+ protected MarkerAutoScaling createMarker(Point point, Color outer, Color inner,
|
|
364
|
+ AlphaMode mode) {
|
|
365
|
+ Image image = MarkerUtils.getMarkerForColor(outer, inner, mode);
|
356
|
366
|
return new MarkerAutoScaling(convertPoint(point), image);
|
357
|
367
|
}
|
358
|
368
|
|
359
|
369
|
@Override
|
360
|
|
- public MarkerOverlay drawMarker(Point point, Color color) {
|
361
|
|
- return new MapViewMarkerOverlay(createMarker(point, color), color);
|
|
370
|
+ public MarkerOverlay drawMarker(Point point, Color outer, Color inner, AlphaMode mode) {
|
|
371
|
+ return new MapViewMarkerOverlay(createMarker(point, outer, inner, mode), outer, inner,
|
|
372
|
+ mode);
|
362
|
373
|
}
|
363
|
374
|
|
364
|
375
|
@Override
|
|
@@ -421,10 +432,10 @@ public class MapViewDrawing extends MapView implements Drawing {
|
421
|
432
|
line.addAll(points);
|
422
|
433
|
PathOverlay overlay = null;
|
423
|
434
|
if (markers) {
|
424
|
|
- MarkerAutoScaling origin = createMarker(path.getOrigin().getPoint(),
|
425
|
|
- DEFAULT_PATH_COLOR),
|
426
|
|
- destination = createMarker(path.getDestination().getPoint(),
|
427
|
|
- DEFAULT_PATH_COLOR);
|
|
435
|
+ MarkerAutoScaling origin = createMarker(path.getOrigin().getPoint(), DEFAULT_PATH_COLOR,
|
|
436
|
+ DEFAULT_PATH_COLOR, AlphaMode.TRANSPARENT),
|
|
437
|
+ destination = createMarker(path.getDestination().getPoint(), DEFAULT_PATH_COLOR,
|
|
438
|
+ DEFAULT_PATH_COLOR, AlphaMode.TRANSPARENT);
|
428
|
439
|
overlay = new MapViewPathOverlay(line, origin, destination);
|
429
|
440
|
}
|
430
|
441
|
else {
|