Skip to content

Commit

Permalink
request render after setting pins layer visiblity
Browse files Browse the repository at this point in the history
  • Loading branch information
Helium314 authored and westnordost committed Mar 20, 2023
1 parent 84a5f6e commit eb06960
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ import de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController
import de.westnordost.streetcomplete.screens.main.map.tangram.toLngLat

/** Takes care of displaying pins on the map, e.g. quest pins or pins for recent edits */
class PinsMapComponent(ctrl: KtMapController) {
class PinsMapComponent(private val ctrl: KtMapController) {

private val pinsLayer: MapData = ctrl.addDataLayer(PINS_LAYER)

/** Shows/hides the pins */
var isVisible: Boolean
get() = pinsLayer.visible
set(value) { pinsLayer.visible = value }
set(value) {
pinsLayer.visible = value
ctrl.requestRender()
}

/** Show given pins. Previously shown pins are replaced with these. */
fun set(pins: Collection<Pin>) {
Expand Down

0 comments on commit eb06960

Please sign in to comment.