@Override public void handleMessage(Message msg) { mapBitmap = bmLow; minRate = MapCommonUtil.getScreenWidth(getContext()) / MapView.this.startWidth; imgMatrix.setScale(minRate, minRate); float[] values = new float[9]; imgMatrix.getValues(values); float y = (MapCommonUtil.getScreenHeight(getContext()) - startHeight * values[4]) / 2; imgMatrix.postTranslate(0, y); isNaviMode = false; isNaviRefresh = false; isCompleted = true; postInvalidate(); if (onMapLoadCompletedListener != null) { onMapLoadCompletedListener.onMapLoadCompleted(map); } }
public void moveToCenter(Point point, int from) { int sWidth = MapCommonUtil.getScreenWidth(getContext()) / 2; int sHeight = MapCommonUtil.getScreenHeight(getContext()) / 2; // float scale = MapCommonUtil.getMapScale(this); float[] values = new float[9]; imgMatrix.getValues(values); float startx = (point.getX() * values[0] + point.getY() * values[1]) + values[2]; float starty = (point.getX() * values[3] + point.getY() * values[4]) + values[5]; float x = sWidth - startx; float y = sHeight - starty; float dx = x / 10; float dy = y / 10; if (Math.abs(x) < 3 && Math.abs(y) < 3) { if (null != onInvalidataListener) { onInvalidataListener.onInvalidataEnd(from); return; } } translate(x, y, dx, dy, from); }