-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make Annotation objects immutable #2546
Comments
@ljbade Sounds good. How about just commenting them out? |
@bleege I'm not a huge fan of commenting code out. core/iOS seem to avoid commented code but we are getting it scattered in Android. I think correct fix here is to make them package private so the |
@ljbade Can you help me understand how making them package private so that |
@bleege I mean immutable in the "public API". in #2551 you say we should prefer to use |
@bleege I also noticed that some of the annotation object expose properties from Google Maps API we don't support in core. These should be made private. |
Fixing up a few other things I noticed:
|
Hmm looks like MapView needs to be able to set the ID field on the objects. We might have to implement #2538 |
Moving this to 2.2.0 as I don't think we have enough time to make all these changes. It is looking like the next version will include a number of refactors anyhow. @bleege Do you agree? |
On second thought now that we have #2631 I might as well roll a fix for that into this branch. |
Remove unimplemented properties. Make annotations immutable. Correct defintions of equals() and hasCode(). Change anchor U/V to int. Move .alpha to MultiPoint and anchor() to PolylineOptions and PolygonOptions. Make InfoWindow classes package private. Add setOnInfoWindowClickListener and remove old method from Marker. JavaDoc internal methods with "Do not use." Refactor showInfoWindow() to remove need for exposing internal method. Make select/deselectMarker public. Add getSelectedMarker. Fix bug where you couldn't reselect a closed info window. Fixes #2546 Fixes #2631 Fixes #2448
This branch ended up being quite a bit of work. Full details in the PR. |
@ljbade This is a LARGE change and rushing it doesn't make sense. Let's put this back into |
Make unimplemented properties package private. Make annotations object properties immutable. Make InfoWindow and Circle classes package private. Remove no longer needed casts from Options classes. Added a few missing get/add methods to annotations classes for consistency. Mininal version of #2546 suitable for v2.1.0 release.
Further work could be to make setId/getId, set/getMapView etc private by directly accessing them in JNI where needed. To do this nativeAddMarker could be refactored to take a MarkerOptions and return a Marker. |
Going to need to remove anchor per #2652 in this 2.2.0 PR. |
Make unimplemented properties package private. Make annotations object properties immutable. Make InfoWindow and Circle classes package private. Remove no longer needed casts from Options classes. Added a few missing get/add methods to annotations classes for consistency. Mininal version of #2546 suitable for v2.1.0 release.
Make unimplemented properties package private. Make annotations object properties immutable. Make InfoWindow and Circle classes package private. Remove no longer needed casts from Options classes. Added a few missing get/add methods to annotations classes for consistency. Mininal version of #2546 suitable for v2.1.0 release.
Remove unimplemented properties. Correct defintions of equals() and hasCode(). Add setOnInfoWindowClickListener and remove old method from Marker. Refactor showInfoWindow() to remove need for exposing internal method. Make select/deselectMarker public. Add getSelectedMarker. Fix bug where you couldn't reselect a closed info window. Add empty constructor to LatLng and LatLngZoom. Fixes #2546 Fixes #2631 Fixes #2448
Make unimplemented properties package private. Make annotations object properties immutable. Make InfoWindow and Circle classes package private. Remove no longer needed casts from Options classes. Added a few missing get/add methods to annotations classes for consistency. Mininal version of mapbox#2546 suitable for v2.1.0 release.
Remove unimplemented properties. Correct defintions of equals() and hasCode(). Add setOnInfoWindowClickListener and remove old method from Marker. Refactor showInfoWindow() to remove need for exposing internal method. Make select/deselectMarker public. Add getSelectedMarker. Fix bug where you couldn't reselect a closed info window. Add empty constructor to LatLng and LatLngZoom. Fixes mapbox#2546 Fixes mapbox#2631 Fixes mapbox#2448
In the various annotation objects (
Marker
etc) we have a number ofset...
functions. These need to be removed so that they are immutable for the moment.Main reason is the expected behaviour from developers is that for example
Marker.setColor()
will change the existing marker's colour. Instead nothing happens.Full support for mutable annotations is not in the core layer at this stage. Even on iOS you can't update existing markers.
@bleege I think this is good candidate for 2.1.0
The text was updated successfully, but these errors were encountered: