public void changeMap(Map map) { isCompleted = false; this.map = map; this.startWidth = map.getWidth(); this.startHeight = map.getHeight(); paint = new Paint(); imgMatrix = new Matrix(); mapGC(); loadMap(); }
public MapView(BaseMapScreen baseMapScreen, Map map) { super(baseMapScreen.getContext()); this.baseMapScreen = baseMapScreen; this.map = map; this.startWidth = map.getWidth(); this.startHeight = map.getHeight(); paint = new Paint(); imgMatrix = new Matrix(); loadMapHandler = new LoadMapHandler(); initRouteParams(); loadMap(); }
public void updateNaviMode() { if (isNaviMode && !isInvalidate) { float[] values = new float[9]; imgMatrix.getValues(values); scale = (float) Math.sqrt(values[3] * values[3] + values[4] * values[4]); scale = (float) Math.round(scale * 10) / 10; p1 = new Path(); float px, py; px = (path.get(0).getX() + map.getCellSize() / 2f) * values[0] + (path.get(0).getY() + map.getCellSize() / 2f) * values[1] + values[2]; py = (path.get(0).getX() + map.getCellSize() / 2f) * values[3] + (path.get(0).getY() + map.getCellSize() / 2f) * values[4] + values[5]; p1.moveTo(px, py); for (int i = 1; i < path.size(); i++) { px = (path.get(i).getX() + map.getCellSize() / 2f) * values[0] + (path.get(i).getY() + map.getCellSize() / 2f) * values[1] + values[2]; py = (path.get(i).getX() + map.getCellSize() / 2f) * values[3] + (path.get(i).getY() + map.getCellSize() / 2f) * values[4] + values[5]; p1.lineTo(px, py); } isNaviRefresh = true; // postInvalidate(); } }