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

Adds text under location icon #401

Closed
wants to merge 2 commits into from
Closed

Adds text under location icon #401

wants to merge 2 commits into from

Conversation

cammace
Copy link
Contributor

@cammace cammace commented Apr 2, 2018

This allows you to place a string text under the location icon. Right now I have the demo querying the map and filtering layer features to only those with names, thus ideally, this will show you the current POI you are at. Still, need to implement navigation version of this that shows current street.

Users can use the setPlaceText API to set the string which is displayed.

List<Feature> features = mapboxMap.queryRenderedFeatures(rectF, has("name"));
if (!features.isEmpty()) {
locationLayerPlugin.setPlaceText(features.get(0).getStringProperty("name"));
}
Copy link
Member

Choose a reason for hiding this comment

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

While I like the idea shown above, I wonder if we need it as default behaviour?

@@ -239,6 +239,10 @@ public void applyStyle(LocationLayerOptions options) {
updateMapWithOptions(options);
}

public void setPlaceText(String placeText) {
Copy link
Member

Choose a reason for hiding this comment

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

missing javadoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants