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

Traffic Plugin #6

Merged
merged 1 commit into from
Apr 11, 2017
Merged

Traffic Plugin #6

merged 1 commit into from
Apr 11, 2017

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Apr 7, 2017

ezgif com-video-to-gif 15

Closes #4

@tobrun tobrun added this to the v0.1 milestone Apr 7, 2017
@tobrun tobrun self-assigned this Apr 7, 2017
@tobrun
Copy link
Member Author

tobrun commented Apr 10, 2017

@zugaldia I found the remaining issue (not having filters setup).
I did a cleanup and added javadoc. Ready for review.

@tobrun tobrun changed the title WIP Traffic Plugin Traffic Plugin Apr 10, 2017
Copy link
Contributor

@ericrwolfe ericrwolfe left a comment

Choose a reason for hiding this comment

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

I'll leave the final approval up to @zugaldia, but at a high level everything looks great to me.

Traffic.java looks simple to use by itself and straightforward to customize should someone need to.

Should we update the repo's readme with installation instructions and a short code snippet around usage, or will this get out of hand as we add more plugins? Are there better ways to deal with this on Android?

@tobrun
Copy link
Member Author

tobrun commented Apr 11, 2017

Should we update the repo's readme with installation instructions and a short code snippet around usage, or will this get out of hand as we add more plugins? Are there better ways to deal with this on Android?

My suggestion would be to add README.md to each separate plugin. @zugaldia started created an overview README.md where we could link the different plugin pages.

@tobrun tobrun added the feature label Apr 11, 2017
@@ -20,11 +20,19 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
Copy link
Member

Choose a reason for hiding this comment

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

Is this line necessary at all?

}
}

private boolean requiresLocationPermission(String name, String category) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's simply remove it?


<!-- Categories -->
<string name="category">category</string>
<string name="category_runtime_styling">Runtime Styling</string>
Copy link
Member

Choose a reason for hiding this comment

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

Let's call it Navigation in preparation for #12.

<string name="title_traffic">Traffic Plugin</string>

<!-- Descriptions -->
<string name="description_traffic">Add Traffic layer to any Mapbox basemap.</string>
Copy link
Member

Choose a reason for hiding this comment

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

nit: traffic

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
Copy link
Member

Choose a reason for hiding this comment

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

Remove too?

}

/**
* Initialise the Traffic source and layers
Copy link
Member

Choose a reason for hiding this comment

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

Nit: traffic

LineLayer local = TrafficLayer.getLineLayer(Local.BASE_LAYER_ID, lineColor, otherWidth, otherOffset, Local.ZOOM_LEVEL, Local.FILTER);
LineLayer localCase = TrafficLayer.getLineLayer(Local.LOCAL_CASE_LAYER_ID, lineColorCase, otherCaseWidth, otherOffset, Local.ZOOM_LEVEL, Local.FILTER);

// // TODO: add above highest road label instead of bridge-motorway https://github.com/mapbox/mapbox-gl-native/issues/8663
Copy link
Member

Choose a reason for hiding this comment

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

Let's ticket for version 0.2?

String id;
for (Layer layer : layers) {
id = layer.getId();
// TODO use sourceLayer filter instead
Copy link
Member

Choose a reason for hiding this comment

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

Let's ticket for version 0.2?

* Use {@link #isEnabled()} to validate if the plugin is active or not.
* </p>
*/
public final class Traffic implements MapView.OnMapChangedListener {
Copy link
Member

Choose a reason for hiding this comment

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

Could we call this class TrafficPlugin instead? This could be the only convention for now, all plugins should have the Plugin suffix.

minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
Copy link
Member

Choose a reason for hiding this comment

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

Let's start with version 0.1 for now so that we aren't tied to SEMVER.

@zugaldia
Copy link
Member

@tobrun Plugin is in great shape, I only added a few minor comments.

My suggestion would be to add README.md to each separate plugin. @zugaldia started created an overview README.md where we could link the different plugin pages.

Agreed. Let's start with the basics, which is to list all the plugins in the README file including Maven/Gradle installation instructions and a link to the examples in the Test App.

@langsmith will be running point for the next iteration of docs and include them in the website. I'll ticket that separately.

@tobrun
Copy link
Member Author

tobrun commented Apr 11, 2017

Rebased with master for PR with CI, review comments addressed and ready for review.

@tobrun tobrun merged commit 54ef518 into master Apr 11, 2017
@tobrun tobrun deleted the tvn-traffic branch April 11, 2017 15:24
@tobrun
Copy link
Member Author

tobrun commented Apr 11, 2017

Follow up ticket to handle the todo comments found in this PR in #14.

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.

None yet

3 participants