0

I show location using a special placemark on Yandex map. When I zoom out on the map, the placemark shifts from the location. How can I make sure it stays in position when zoom out or zoom in?

private fun initMapView(point: Point) {
        val cameraPosition = CameraPosition(point, ZOOM, AZIMUTH, TILT)
        val animation = Animation(Animation.Type.SMOOTH, DURATION)
        val basePoiImageView = ImageView(requireContext()).apply {
            setImageResource(R.drawable.ic_poi_base) // icon is vector
        } 
        with(viewBinding) {
            mapView.map.move(cameraPosition, animation, null)
            mapView.map.logo.setAlignment(
                Alignment(
                    HorizontalAlignment.LEFT,
                    VerticalAlignment.TOP
                )
            )
            mapView.onStart()
            mapView.map.mapObjects.addPlacemark(point, ViewProvider(basePoiImageView))
        }
    }

Image zoom in

Image zoom out

gokmenbayram
  • 421
  • 4
  • 10

0 Answers0