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

Added wrappers for route tile APIs #913

Merged
merged 2 commits into from
Nov 6, 2018

Conversation

devotaaabel
Copy link
Contributor

@devotaaabel devotaaabel commented Oct 31, 2018

Closes #912.

This PR adds a new services module, services-route-tiles, which includes the following endpoint wrapper classes:

  • MapboxRouteTiles
  • MapboxRouteTileVersions.

Please see the route tiles API readme for explanation of the two endpoints.

I'm currently trying to add more meaningful tests, specifically to test the json conversion.

@devotaaabel devotaaabel self-assigned this Oct 31, 2018
@devotaaabel devotaaabel changed the title [WIP] Added wrappers for route tile APIs Added wrappers for route tile APIs Nov 2, 2018
@devotaaabel devotaaabel force-pushed the devota-add-route-tiles-service branch 3 times, most recently from ea1541b to 86d491f Compare November 2, 2018 18:46
Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

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

@devotaaabel this looks great overall, just a couple typos 👍

I know you mentioned you're still working through some tests - we should add some that ensure the response model are properly generated. We do this with the Directions API to ensure everything is being deserialized correctly.

Going to leave the final approval to @osana

@devotaaabel devotaaabel force-pushed the devota-add-route-tiles-service branch 5 times, most recently from d1ce2b1 to 3c7de52 Compare November 5, 2018 20:26
Copy link
Contributor

@osana osana left a comment

Choose a reason for hiding this comment

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

Looks pretty good.
Once the test passes I fine with it to be pushed.
Serialization if makes sense could be ticketed separately

* {@link MapboxRouteTiles.Builder}.
*
* @param userAgent the user agent
* @param coordinates a string value of the min and max longitude and latitude
Copy link
Contributor

Choose a reason for hiding this comment

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

we should specify the order and what separator is used

* @since 4.1.0
*/
@AutoValue
public abstract class RouteTileVersionsResponse {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe it should implement Serializable

Copy link
Contributor Author

@devotaaabel devotaaabel Nov 5, 2018

Choose a reason for hiding this comment

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

@osana in what case would it make sense to implement serializable? The gson TypeAdapterFactory should take care of the conversion to this object from the json response, right?

Copy link
Contributor

@osana osana Nov 6, 2018

Choose a reason for hiding this comment

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

@devotaaabel thoughout mapbox-java services we support the use of serialize() and deserialize() and serialize()

It can be ticketed and fixed in another pr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ticketed here: #917

* @return this builder for chaining options together
* @since 4.1.0
*/
public abstract Builder boundingBox(@NonNull BoundingBox boundingBox);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have a version that take (minLon, minLat, maxLon, maxLat)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@osana a bounding box can be created with BoundingBox.fromLngLats, is that sufficient?

Copy link
Contributor

@osana osana Nov 6, 2018

Choose a reason for hiding this comment

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

I think it is a helper method so that users did not have to deal with it

I do not have a strong preference about it. Either way is fine.

One big question will be what happens over date line!

@devotaaabel devotaaabel force-pushed the devota-add-route-tiles-service branch 2 times, most recently from 5d03217 to b0fecfa Compare November 5, 2018 22:28
@devotaaabel devotaaabel merged commit d67f1e9 into master Nov 6, 2018
@devotaaabel devotaaabel deleted the devota-add-route-tiles-service branch November 6, 2018 20:06
@osana osana mentioned this pull request Nov 12, 2018
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants