mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.36k stars 1.33k forks source link

Add emphasis-circle-color and emphasis-circle-radius to location-indicator #16463

Closed galinelle closed 4 years ago

galinelle commented 4 years ago

This PR adds the ability to draw an additional circle in the location-indicator layer, called emphasis-circle. This can be used to draw a pulsating circle to attract attention. Example usage included in the glfw app.

Launch Checklist

chloekraw commented 4 years ago

High level, this looks good to me too. Thanks @galinelle!

pengdev commented 4 years ago

@LukasPaczos @galinelle In symbol layer implementation refs, we support the following configuration options:

    <!-- Location pulsing circle -->
    <item name="mapbox_pulsingLocationCircleEnabled">false</item>
    <item name="mapbox_pulsingLocationCircleFadeEnabled">true</item>
    <item name="mapbox_pulsingLocationCircleColor">@color/mapbox_location_layer_blue</item>
    <item name="mapbox_pulsingLocationCircleDuration">2300</item>
    <item name="mapbox_pulsingLocationCircleRadius">35</item>
    <item name="mapbox_pulsingLocationCircleAlpha">0.4</item>
    <item name="mapbox_pulsingLocationCircleInterpolator">decelerate</item>

Shall we consider exposing these options for the location-indicator layer?

LukasPaczos commented 4 years ago

@pengdev ultimately, the layer should only expose radius, color, and alpha (or alpha baked into color). The transitions are platform-driven so the rest of the arguments should be handled on the platform side.

pengdev commented 4 years ago

@pengdev ultimately, the layer should only expose radius, color, and alpha (or alpha baked into color). The transitions are platform-driven so the rest of the arguments should be handled on the platform side.

Sounds good.

galinelle commented 4 years ago

ping