本文整理汇总了Java中com.google.android.maps.MapView.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.getHeight方法的具体用法?Java MapView.getHeight怎么用?Java MapView.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.maps.MapView
的用法示例。
在下文中一共展示了MapView.getHeight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
if (overlayImage == null || overlayImage.isRecycled()) {
return false;
}
float x = mapView.getWidth() / 2f;
float y = mapView.getHeight() / 2f;
imageMatrix.reset();
imageMatrix.postTranslate(-centerX + x, -centerY + y);
imageMatrix.postRotate(rotation, x, y);
imageMatrix.postScale(scale, scale, x, y);
canvas.drawBitmap(overlayImage, imageMatrix, transparency);
// Draw small black ring with white edge to indicate center point
centerPaint.setColor(0xffffffff);
centerPaint.setStrokeWidth(4f);
canvas.drawCircle(x, y, 5, centerPaint);
centerPaint.setColor(0xff000000);
centerPaint.setStrokeWidth(2f);
canvas.drawCircle(x, y, 5, centerPaint);
return false;
}
示例2: animateTo
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
protected void animateTo(int index, GeoPoint center) {
if (manager != null) {
manager.markSelected();
}
MapView mapView = getMapView();
ViewController controller = new ViewController(mapView);
Point pt = new Point(mapView.getWidth() / 2, mapView.getHeight() / 2);
int spanLat = bounds.top - bounds.bottom;
int spanLon = bounds.left - bounds.right;
controller.animateTo(center, pt, spanLat, spanLon, animate);
}
示例3: animateTo
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
protected void animateTo(int index, GeoPoint center) {
if (manager != null) {
manager.markSelected();
}
MapView mapView = getMapView();
ViewController controller = new ViewController(mapView);
Point pt = new Point(mapView.getWidth() / 2, mapView.getHeight() / 4 * 3);
controller.animateTo(center, pt, MIN_ZOOM_LEVEL + 1, true);
}
示例4: animateTo
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
protected void animateTo(int index, GeoPoint center) {
if (manager != null) {
manager.markSelected();
}
MapView mapView = getMapView();
ViewController controller = new ViewController(mapView);
Point pt = new Point(mapView.getWidth() / 2, mapView.getHeight() / 4 * 3);
controller.animateTo(center, pt, MIN_ZOOM_LEVEL + 1, animate);
}
示例5: onTouchEvent
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
if (directions == null)
return super.onTouchEvent(event, mapView);
Point center = new Point(mapView.getWidth() / 2, mapView.getHeight() / 2); // simple calc of center pixel
int closestDir = curDir; // assume its the same
double bestMin = Double.MAX_VALUE; // closest direction so far
// the algorithm is as follows: find the shortest distance from the
// center
// of the screen to each direction. Then, change to the direction that
// is
// closest to the center
for (int i = 0; i < directions.length; i++) {
Point[] dirPixelPoints = pixelPoints[i];
if (directions[i].getType() == Direction.SAME_FLOOR) {
double avgDist = (DrawingHelpers.distance(dirPixelPoints[0],center)
+ DrawingHelpers.distance(dirPixelPoints[dirPixelPoints.length / 2],center) + DrawingHelpers.distance(
dirPixelPoints[dirPixelPoints.length - 1], center)) / 2.0;
if (avgDist < bestMin) {
bestMin = avgDist;
closestDir = i;
}
}
}
// only changes the direction if the direction being automatically
// switched to is and outside direction
if (curDir != closestDir && // inefficient to setui if we don't need to
app.campus.buildingIsOutside(directions[closestDir].getBuilding()) && // only change if moving between outside points
app.campus.buildingIsOutside(directions[curDir].getBuilding())) {
if (main != null) {
main.setUI(closestDir, false); // calling this, we set the bitmaps + the icons
} else {
main.setUI(closestDir, false);
}
}
return super.onTouchEvent(event, mapView); // not stealing the event
}