Skip to content

Commit

Permalink
remove touch buffer for quest pins (fixes #5827)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Aug 22, 2024
1 parent f110c31 commit 3daa2c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class MainMapFragment : MapFragment(), ShowsGeometryMarkers {
tracksMapComponent = TracksMapComponent(context, style, map)
viewLifecycleOwner.lifecycle.addObserver(tracksMapComponent!!)

pinsMapComponent = PinsMapComponent(context, context.contentResolver, map, mapImages!!, fingerRadius, ::onClickPin)
pinsMapComponent = PinsMapComponent(context, context.contentResolver, map, mapImages!!, ::onClickPin)
geometryMapComponent = FocusGeometryMapComponent(context.contentResolver, map)
viewLifecycleOwner.lifecycle.addObserver(geometryMapComponent!!)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import de.westnordost.streetcomplete.screens.main.map.createPinBitmap
import de.westnordost.streetcomplete.screens.main.map.maplibre.MapImages
import de.westnordost.streetcomplete.screens.main.map.maplibre.clear
import de.westnordost.streetcomplete.screens.main.map.maplibre.getEnclosingCamera
import de.westnordost.streetcomplete.screens.main.map.maplibre.queryRenderedFeatures
import de.westnordost.streetcomplete.screens.main.map.maplibre.toLatLon
import de.westnordost.streetcomplete.screens.main.map.maplibre.toPoint
import de.westnordost.streetcomplete.screens.main.map.maplibre.updateCamera
Expand Down Expand Up @@ -53,7 +52,6 @@ class PinsMapComponent(
private val contentResolver: ContentResolver,
private val map: MapLibreMap,
private val mapImages: MapImages,
private val clickRadius: Float,
private val onClickPin: (properties: Map<String, String>) -> Unit
) {
private val pinsSource = GeoJsonSource(SOURCE,
Expand Down Expand Up @@ -135,9 +133,8 @@ class PinsMapComponent(

private fun onClick(position: LatLng): Boolean {
val feature = map.queryRenderedFeatures(
coordinates = map.projection.toScreenLocation(position),
radius = clickRadius,
layerIds = arrayOf("pins-layer", "pin-cluster-layer")
map.projection.toScreenLocation(position),
*arrayOf("pins-layer", "pin-cluster-layer")
).firstOrNull() ?: return false

val properties = feature.properties()
Expand Down

0 comments on commit 3daa2c6

Please sign in to comment.