-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit foci boundary enhancements #339
Conversation
Rkareko
commented
May 19, 2020
•
edited
Loading
edited
- Add onFeatureLongClick listener
- Allow drawing of multipolygons
Pull Request Test Coverage Report for Build 1654
💛 - Coveralls |
void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable String... layerIds); | ||
|
||
/** | ||
* Sets an {@link OnFeatureClickListener} which will be fired when a feature on the map in either of the {@code layerIds} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change documentation here to link to OnFeatureLongClickListener
@@ -188,6 +189,25 @@ | |||
*/ | |||
void setOnFeatureClickListener(@NonNull OnFeatureClickListener onFeatureClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds); | |||
|
|||
/** | |||
* Sets an {@link OnFeatureClickListener} which will be fired when a feature on the map in either of the {@code layerIds} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change documentation here to link to OnFeatureLongClickListener
|
||
/** | ||
* Called when a features(s) is long clicked on the map and adheres to params passed in | ||
* {@link io.ona.kujaku.views.KujakuMapView#setOnFeatureClickListener(OnFeatureClickListener, String...)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change documentation here to link to setOnFeatureLongClickListener
/** | ||
* Called when a features(s) is long clicked on the map and adheres to params passed in | ||
* {@link io.ona.kujaku.views.KujakuMapView#setOnFeatureClickListener(OnFeatureClickListener, String...)} | ||
* or {@link io.ona.kujaku.views.KujakuMapView#setOnFeatureClickListener(OnFeatureClickListener, com.mapbox.mapboxsdk.style.expressions.Expression, String...)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change documentation here to link to setOnFeatureLongClickListener
MultiPolygon multiPolygon = (MultiPolygon) geometry; | ||
for (List<List<Point>> polygonCoordinates : multiPolygon.coordinates()) { | ||
List<Point> points = polygonCoordinates.get(0); | ||
this.startDrawingPoints(points); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an issue to improve this later? A multipolygon contains holes or can show a feature that is made of of multiple scattered polygons. In case you want to edit the boundary of Mombasa which is part of the Kenya boundary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the link #340
* | ||
* @param features | ||
*/ | ||
void onFeatureLongClick(List<Feature> features); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annotate List<Feature> features
to indicate that it does not provide nonNull i.e. add @NonNull
annotation
@Override | ||
public void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds) { | ||
this.onFeatureLongClickListener = onFeatureLongClickListener; | ||
this.featureClickLayerIdFilters = layerIds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting layerIds to this.featureClickLayerIdFilters
will override the layerIds
passed for the OnClickListener
This will also override the featureClickExpressionFilter
. Add separate variables to holds this and update the #onMapLongClick
to use the new variables
Use different variables for layerIdFilters and expresionfilters