Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Refactoring and splitting basic SymbolLayer icon examples #1030

Merged
merged 2 commits into from
May 14, 2019

Conversation

langsmith
Copy link
Contributor

It's only taken me two years to get around to it, but I've always felt like the current BasicSymbolLayerActivity example wasn't truly basic. Yes, it added SymbolLayer icons, but the example had logic to listen to map clicking, change select state, animate the icon size, etc.

It's not a barebones and clean example of how to simply add SymbolLayer icons to the map with no other frills.

This pr moves the master branch's BasicSymbolLayerActivity code to an example titled IconSizeChangeOnClickActivity and then cuts out the fluff from the BasicSymbolLayerActivity. The BasicSymbolLayerActivity now just shows 3 SymbolLayer icons in Uruguay.

cc @riastrad and @samfader for mobile support

cc @colleenmcginnis . This refactoring and code movement might make https://docs.mapbox.com/android/maps/examples/ a bit wonky. I will fix things downstream in /android-docs once this lands.

ezgif com-resize (6)

}
return true;
}
mapboxMap.setStyle(new Style.Builder().fromUrl("mapbox://styles/mapbox/cjf4m44iw0uza2spb3q0a7s41")
Copy link
Member

Choose a reason for hiding this comment

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

could you add some context why we are using this specific style?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a style that isn't found in Style class to just shake things up a little.

Screen Shot 2019-05-13 at 1 02 59 PM

if (mapboxMap != null) {
mapboxMap.removeOnMapClickListener(this);
}
mapView.onDestroy();
Copy link
Member

Choose a reason for hiding this comment

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

we aren't stopping animations in this example so we can potentially crash with selecting a symbol and closing the activity quickly after.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, 4d4e13a adds animation cancellation in onDestroy().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I closed the example during the icon size animation. No issues.

@langsmith langsmith force-pushed the ls-adding-basic-symbol-layer-example branch from 033426d to b9402a6 Compare May 13, 2019 20:02
@langsmith
Copy link
Contributor Author

Anything else, @tobrun ?

@langsmith langsmith merged commit 94589ce into master May 14, 2019
@langsmith langsmith deleted the ls-adding-basic-symbol-layer-example branch May 14, 2019 22:45
@langsmith langsmith mentioned this pull request May 22, 2019
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants