As in above images ,marker always visible even if zoom out completely and all marker are getting attach together completely when zoom out
So how to adjust maker size while zoom in and zoom out as in below images
As in above images ,marker always visible even if zoom out completely and all marker are getting attach together completely when zoom out
So how to adjust maker size while zoom in and zoom out as in below images
If you need to change the markers size according to zoom out and in, then need to implement onCameraMove() listener and according to zoom level you need to change the icon of marker added as below
override fun onCameraMove() {
var zoomlevel = map.cameraPosition.zoom
if (zoomlevel < 6) {
marker1?.apply {
setIcon(BitmapDescriptorFactory.fromResource(R.drawable.car_yellow_xs))
}
}
else if (zoomlevel <= 10) {
marker1?.apply {
setIcon(BitmapDescriptorFactory.fromResource(R.drawable.car_yellow_small))
}
}
else if (zoomlevel <= 12) {
marker1?.apply {
setIcon(BitmapDescriptorFactory.fromResource(R.drawable.car_yellow_med_small))
}
}
}
Make sure marker images size should be increased with increasing zoom level, Hence you need to change images of marker according to the zoom level in camera move listener. Let me know if this works!