Skip to content
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

Merged
merged 12 commits into from
Jul 22, 2020
Merged

Conversation

Rkareko
Copy link
Contributor

@Rkareko Rkareko commented May 19, 2020

  • Add onFeatureLongClick listener
  • Allow drawing of multipolygons

@Rkareko Rkareko requested a review from ekigamba May 19, 2020 15:24
@coveralls
Copy link

coveralls commented May 19, 2020

Pull Request Test Coverage Report for Build 1654

  • 8 of 18 (44.44%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 53.121%

Changes Missing Coverage Covered Lines Changed/Added Lines %
library/src/main/java/io/ona/kujaku/views/KujakuMapView.java 0 10 0.0%
Totals Coverage Status
Change from base Build 1645: 0.02%
Covered Lines: 3123
Relevant Lines: 5879

💛 - 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}
Copy link
Contributor

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}
Copy link
Contributor

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...)}
Copy link
Contributor

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...)}
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor Author

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);
Copy link
Contributor

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;
Copy link
Contributor

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
@Rkareko Rkareko self-assigned this Jul 22, 2020
@Rkareko Rkareko merged commit 61823dc into master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants