blob: a76238fdcb96097f43f4a8fd79ddf6e75b239fe7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
package com.mapbox.mapboxsdk.annotations;
import com.mapbox.mapboxsdk.geometry.LatLng;
import java.util.ArrayList;
import java.util.List;
/**
* Multipoint is an abstract annotation for combining geographical locations.
*/
public abstract class MultiPoint extends Annotation {
private List<LatLng> points;
private float alpha = 1.0f;
protected MultiPoint() {
super();
points = new ArrayList<>();
}
/**
* Returns a copy of the points.
*
* @return points - as a copy
*/
public List<LatLng> getPoints() {
return new ArrayList<>(points);
}
/**
* Sets the points of this polyline. This method will take a copy
* of the points, so further mutations to points will have no effect
* on this polyline.
*
* @param points the points of the polyline
*/
public void setPoints(List<LatLng> points) {
this.points = new ArrayList<>(points);
update();
}
public void addPoint(LatLng point) {
points.add(point);
update();
}
public float getAlpha() {
return alpha;
}
public void setAlpha(float alpha) {
this.alpha = alpha;
update();
}
abstract void update();
}
|