通过Zoom缩放地图标记,Android [英] Scale Map Markers by Zoom, Android
本文介绍了通过Zoom缩放地图标记,Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的地图上有很多标记.放大每个标记会显示一个位置.但是缩小标记会相互重叠,因此确定标记的位置会更加困难.
I have lot of markers on my map. Zooming in each marker shows me a position. but zooming out the markers are overlapping each other and it is more difficult do determine the position of a marker.
有没有一种方法可以根据缩放比例缩放标记图像?
Is there a way to scale the marker image depending on the zoom factor?
推荐答案
取决于绘制标记的方式.如果您的标记只是位图/可绘制对象,只需使用 matrix.postScale()
Depends on how you draw your marker. If your marker is just a bitmap/drawable, simply use matrix.postScale()
Matrix matrix = new Matrix();
matrix.postScale(2f, 2f); // douple the size
canvas.drawBitmap(mBitmap, matrix, mPaint);
这篇关于通过Zoom缩放地图标记,Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文