@Override public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) { return new MapView.LayoutParams(getContext(), attrs); }
/** * Sets the gravity for the placing of the zoom controls. * * @param zoomControlsGravity a combination of {@link Gravity} constants describing the desired placement. */ public void setZoomControlsGravity(int zoomControlsGravity) { this.zoomControlsGravity = zoomControlsGravity; mapView.requestLayout(); }
@Override protected ViewGroup.LayoutParams generateDefaultLayoutParams() { return new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, null, MapView.LayoutParams.Alignment.BOTTOM_CENTER); }
@Override public void onClick(View v) { mapView.getModel().mapViewPosition.zoomOut(); } });
@Override public void onClick(View view) { mapView.onZoomEvent(); MapZoomControls.this.mapView.getModel().mapViewPosition.zoomIn(); } });
protected void redrawLayers() { mapView.getLayerManager().redrawLayers(); }
@Override public void onDestroy() { if (this.mapView != null) { this.mapView.destroyAll(); } super.onDestroy(); }
public TouchGestureHandler(MapView mapView) { this.mapView = mapView; this.flinger = new Scroller(mapView.getContext()); }
/** * In this class we instantiate the MapView directly using this class, * without using an XML layout file. * * @return */ @Override protected MapView getMapView() { MapView mv = new MapView(this); setContentView(mv); return mv; }
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { measureChildren(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec); }
/** * Hook to create controls, such as scale bars. * You can add more controls. */ protected void createControls() { initializePosition(mapView.getModel().mapViewPosition); }
@Override public void onClick(View view) { mapView.onZoomEvent(); MapZoomControls.this.mapView.getModel().mapViewPosition.zoomOut(); } });
@Override protected void onDestroy() { this.mapView2.destroyAll(); super.onDestroy(); }
@Override protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) { return new MapView.LayoutParams(p); }
@Override public void run() { requestLayout(); } });
@Override public void onClick(View v) { mapView.getModel().mapViewPosition.zoomIn(); } });
public void setMarginHorizontal(int marginHorizontal) { setPadding(marginHorizontal, getPaddingTop(), marginHorizontal, getPaddingBottom()); mapView.requestLayout(); }
@Override protected byte getZoomLevelMax() { return mapView.getModel().mapViewPosition.getZoomLevelMax(); }
@Override protected byte getZoomLevelMin() { return mapView.getModel().mapViewPosition.getZoomLevelMin(); }