Skip to content

feat(ktx): GeoJson and Kml KTX #628

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

Merged
merged 5 commits into from
Feb 25, 2020
Merged

Conversation

arriolac
Copy link
Contributor

@arriolac arriolac commented Feb 19, 2020

Took a pass in the geojson and kml packages to see what we can make Kotlin friendly. The only method I could find that we can improve is the constructor for GeoJsonLayer and KmlLayer.

Before:

GeoJsonLayer layer = new GeoJsonLayer(map, geoJsonFile, null, polygonManager, null, groundOverlayManager);

After:

val layer = GeoJsonLayer(
    map = map,
    geoJsonFile = geoJsonFile,
    polygonManager = polygonManager,
    groundOverlayManager = groundOverlayManager
)

Other changes:

  • making all extension functions and properties in the kx library inline to avoid overhead of new memory allocations when using the ktx aliases vs. using the method/properties directly
  • Added @ColorInt annotations in geojson classes where I found it to be helpful
  • Added @RawRes annotation in kml class
  • Noticed an improvement that we can make in KmlLayer. Issue filed here Allow passing in a Context instead of a FragmentActivity when constructing KmlLayer #629

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 19, 2020
@codecov
Copy link

codecov bot commented Feb 20, 2020

Codecov Report

Merging #628 into android-maps-utils-ktx will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           android-maps-utils-ktx     #628   +/-   ##
=======================================================
  Coverage                   18.99%   18.99%           
=======================================================
  Files                          71       71           
  Lines                        4037     4037           
  Branches                      606      606           
=======================================================
  Hits                          767      767           
  Misses                       3238     3238           
  Partials                       32       32           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5c3b89...fa1f839. Read the comment docs.

@arriolac arriolac changed the title feat(ktx): GeoJson KTX feat(ktx): GeoJson and Kml KTX Feb 20, 2020
@arriolac arriolac requested a review from barbeau February 20, 2020 21:34
Copy link
Collaborator

@barbeau barbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, but I think it would make sense to merge #631 first and then update this to match the new KmlLayer constructor signature before merging this PR.

inline fun kmlLayer(
map: GoogleMap,
@RawRes resourceId: Int,
activity: FragmentActivity,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest merging #631 and then update this to take in a Context and adding the cache parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated fa1f839

@arriolac arriolac merged commit 1ecfabd into android-maps-utils-ktx Feb 25, 2020
@arriolac arriolac deleted the chris/ktx/geojson branch February 25, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants