You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
In the various annotation objects (Marker etc) we have a number of set... 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.
@ljbade Can you help me understand how making them package private so that MarkerOptions can still use them solves this issue? I'm just confused as the original recommendation was "These need to be removed so that they are immutable for the moment."
@bleege I mean immutable in the "public API". in #2551 you say we should prefer to use set methods over field access. Package private means MarkerOptions can use them to create the Marker object, but once we return the Marker object to the end developer, they can't make any further changes to the object.
@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.
Activity
bleege commentedon Oct 7, 2015
@ljbade Sounds good. How about just commenting them out?
ljbade commentedon Oct 8, 2015
@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
MarkerOptionsclass can still use set.bleege commentedon Oct 8, 2015
@ljbade Can you help me understand how making them package private so that
MarkerOptionscan still use them solves this issue? I'm just confused as the original recommendation was "These need to be removed so that they are immutable for the moment."ljbade commentedon Oct 8, 2015
@bleege I mean immutable in the "public API". in #2551 you say we should prefer to use
setmethods over field access. Package private meansMarkerOptionscan use them to create theMarkerobject, but once we return theMarkerobject to the end developer, they can't make any further changes to the object.ljbade commentedon Oct 8, 2015
@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.
ljbade commentedon Oct 8, 2015
Fixing up a few other things I noticed:
Marker,PolygonPolylineasfinal.Annotation,AnnotationOptions,MultiPointandMultiPointOptionsconstructorsprotected.CircleandCircleOptionsto package private as they are currently unimplemented in native layerMarker,PolygonPolylineconstructors package private - only way to create these should be via MapView.ljbade commentedon Oct 8, 2015
Hmm looks like MapView needs to be able to set the ID field on the objects. We might have to implement #2538
ljbade commentedon Oct 8, 2015
Current WIP is in https://github.com/mapbox/mapbox-gl-native/tree/2546-fix-annotations
10 remaining items
ljbade commentedon Oct 17, 2015
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.
ljbade commentedon Oct 17, 2015
Going to need to remove anchor per #2652 in this 2.2.0 PR.
[android] Tidy up annotations API
[android] Tidy up annotations API
[android] Refactor annotations API
[android] Tidy up annotations API
[android] Refactor annotations API