@@ -23,45 +23,19 @@ public class <%- camelize(type) %> extends Annotation {
2323<% if (type === " symbol" ) { -% >
2424 // public static final String Z_INDEX = "z-index";
2525< % } - %>
26- private final <% - camelize (type) %> Manager <% - type %> Manager;
27-
28- /**
29- * Create a <% - type %> .
30- *
31- * @param manager the <% - type %> manager created and managing the <% - type %>
32- * @param id the id of the <% - type %>
33- */
34- <% - camelize (type) %> (<% - camelize (type) %> Manager manager, long id) {
35- super(id);
36- this.<% - type %> Manager = manager;
37- <% if (type === " symbol" ) { -% >
38- // this.jsonObject.addProperty(Z_INDEX, 0);
39- < % } - %>
40- }
41-
4226 /**
4327 * Create a <% - type %> .
4428 *
45- * @param manager the <% - type %> manager created and managing the <% - type %>
4629 * @param id the id of the <% - type %>
4730 * @param jsonObject the features of the annotation
4831 * @param geometry the geometry of the annotation
4932 */
50- <% - camelize (type) %> (<% - camelize (type) %> Manager manager, long id, JsonObject jsonObject, Geometry geometry) {
33+ <% - camelize (type) %> (long id, JsonObject jsonObject, Geometry geometry) {
5134 super(id, jsonObject, geometry);
52- this.<% - type %> Manager = manager;
5335<% if (type === " symbol" ) { -% >
5436 // this.jsonObject.addProperty(Z_INDEX, 0);
5537< % } - %>
5638 }
57-
58- /**
59- * Called to update the underlying data source.
60- */
61- @Override
62- public void update() {
63- <% - type %> Manager.updateSource();
64- }
6539<% if (type === " circle" || type === " symbol" ) { -% >
6640
6741 /**
@@ -70,20 +44,7 @@ public class <%- camelize(type) %> extends Annotation {
7044 * @param latLng the location of the <%- type %> in a longitude and latitude pair
7145 */
7246 public void setLatLng (LatLng latLng ) {
73- setLatLng (latLng, true );
74- }
75-
76- /**
77- * Set the LatLng of the <%- type %>, which represents the location of the <%- type %> on the map
78- *
79- * @param latLng the location of the <%- type %> in a longitude and latitude pair
80- * @param updateSource flag to indicate the source instantly
81- */
82- public void setLatLng (LatLng latLng , boolean updateSource ) {
8347 geometry = Point .fromLngLat (latLng .getLongitude (), latLng .getLatitude ());
84- if (updateSource) {
85- < %- type % > Manager .updateSource ();
86- }
8748 }
8849< % } else if (type === " line" ) { -% >
8950
@@ -93,24 +54,11 @@ public class <%- camelize(type) %> extends Annotation {
9354 * @param latLngs a list of the locations of the line in a longitude and latitude pairs
9455 */
9556 public void setLatLngs (List < LatLng > latLngs ) {
96- setLatLngs (latLngs, true );
97- }
98-
99- /**
100- * Set a list of LatLng for the line, which represents the locations of the line on the map
101- *
102- * @param latLngs a list of the locations of the line in a longitude and latitude pairs
103- * @param updateSource flag to indicate the source instantly
104- */
105- public void setLatLngs (List < LatLng > latLngs , boolean updateSource ) {
10657 List< Point > points = new ArrayList <> ();
10758 for (LatLng latLng : latLngs) {
10859 points .add (Point .fromLngLat (latLng .getLongitude (), latLng .getLatitude ()));
10960 }
11061 geometry = LineString .fromLngLats (points);
111- if (updateSource) {
112- lineManager .updateSource ();
113- }
11462 }
11563< % } else { -% >
11664
@@ -120,16 +68,6 @@ public class <%- camelize(type) %> extends Annotation {
12068 * @param latLngs a list of a lists of the locations of the line in a longitude and latitude pairs
12169 */
12270 public void setLatLngs (List < List < LatLng >> latLngs ) {
123- setLatLngs (latLngs, true );
124- }
125-
126- /**
127- * Set a list of lists of LatLng for the fill, which represents the locations of the fill on the map
128- *
129- * @param latLngs a list of a lists of the locations of the line in a longitude and latitude pairs
130- * @param updateSource flag to indicate the source instantly
131- */
132- public void setLatLngs (List < List < LatLng >> latLngs , boolean updateSource ) {
13371 List< List< Point >> points = new ArrayList <> ();
13472 for (List< LatLng> innerLatLngs : latLngs) {
13573 List< Point > innerList = new ArrayList <> ();
@@ -139,9 +77,6 @@ public class <%- camelize(type) %> extends Annotation {
13977 points .add (innerList);
14078 }
14179 geometry = Polygon .fromLngLats (points);
142- if (updateSource) {
143- fillManager .updateSource ();
144- }
14580 }
14681< % } - %>
14782<% if (type === " symbol" ) { -% >
@@ -201,7 +136,6 @@ public class <%- camelize(type) %> extends Annotation {
201136 jsonArray .add (element);
202137 }
203138 jsonObject .add (" <%-property.name %>" , jsonArray);
204- < %- type % > Manager .updateSource ();
205139 }
206140
207141< % } else { -% >
@@ -221,7 +155,6 @@ public class <%- camelize(type) %> extends Annotation {
221155 */
222156 public void set< %- camelize (property .name ) % > (< %- propertyTypeAnnotation (property) % >< %- iff (() => propertyTypeAnnotation (property), " " ) % >< %- propertyType (property) % > value) {
223157 jsonObject .addProperty (" <%- property.name %>" , value);
224- < %- type % > Manager .updateSource ();
225158 }
226159
227160< % } -% >
0 commit comments