本文整理汇总了Java中com.qozix.tileview.TileView类的典型用法代码示例。如果您正苦于以下问题:Java TileView类的具体用法?Java TileView怎么用?Java TileView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileView类属于com.qozix.tileview包,在下文中一共展示了TileView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMarkerTap
import com.qozix.tileview.TileView; //导入依赖的package包/类
@Override
public void onMarkerTap( View view, int x, int y ) {
// get reference to the TileView
TileView tileView = getTileView();
// we saved the coordinate in the marker's tag
double[] position = (double[]) view.getTag();
// lets center the screen to that coordinate
tileView.slideToAndCenter( position[0], position[1] );
// create a simple callout
SampleCallout callout = new SampleCallout( view.getContext() );
// add it to the view tree at the same position and offset as the marker that invoked it
tileView.addCallout( callout, position[0], position[1], -0.5f, -1.0f );
// a little sugar
callout.transitionIn();
// stub out some text
callout.setTitle( "MAP CALLOUT" );
callout.setSubtitle( "Info window at coordinate:\n" + position[1] + ", " + position[0] );
}
示例2: onCreate
import com.qozix.tileview.TileView; //导入依赖的package包/类
@Override
public void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
tileView = new TileView( this );
/**
* Set an id. This is necessary to enable the save state mechanism of Android.
* It is retrieved from a resource value, but it can also be generated with
* {@code View.generateViewId()}.
*/
tileView.setId( R.id.tileview_id );
tileView.setSaveEnabled( true );
// use our own custom bitmap provider to access Android internal storage
tileView.setBitmapProvider( new BitmapProviderInternalStorage() );
setContentView( tileView );
}
示例3: frameTo
import com.qozix.tileview.TileView; //导入依赖的package包/类
public void frameTo(final int x, final int y) {
final TileView tile = getTileView();
tile.post(new Runnable() {
@Override
public void run() {
tile.slideToAndCenterWithScale(
(0 - imageBounds.left * (int) MAX_SCALE) + (x * (int) MAX_SCALE),
(0 - imageBounds.top * (int) MAX_SCALE) + (y * (int) MAX_SCALE),
MAX_SCALE);
}
});
}
示例4: init
import com.qozix.tileview.TileView; //导入依赖的package包/类
/**
* This must be called when the {@link MapViewFragment} is ready to update its UI.
* <p>
* The caller is responsible for removing this {@link MapLoader.MapRouteUpdateListener} from the
* {@link MapLoader}, after this object is no longer used.
*/
public void init(Map map, TileView tileView) {
mMap = map;
setTileView((TileViewExtended) tileView);
MapLoader.getInstance().setMapRouteUpdateListener(this);
if (mMap.areRoutesDefined()) {
drawRoutes();
} else {
MapLoader.getInstance().getRoutesForMap(mMap);
}
}
示例5: setTileViewBounds
import com.qozix.tileview.TileView; //导入依赖的package包/类
private void setTileViewBounds(TileView tileView, Map map) {
Map.MapBounds mapBounds = map.getMapBounds();
if (mapBounds != null) {
tileView.defineBounds(mapBounds.X0,
mapBounds.Y0,
mapBounds.X1,
mapBounds.Y1);
} else {
tileView.defineBounds(0, 0, 1, 1);
}
}
示例6: setTileView
import com.qozix.tileview.TileView; //导入依赖的package包/类
private void setTileView(final TileView tileView) {
mTileView = tileView;
mTileView.setMarkerTapListener(new MarkerLayout.MarkerTapListener() {
@Override
public void onMarkerTap(View view, int x, int y) {
if (view instanceof MovableMarker) {
MovableMarker movableMarker = (MovableMarker) view;
/* Prepare the callout */
MarkerCallout markerCallout = new MarkerCallout(mContext);
markerCallout.setMoveAction(new MorphMarkerRunnable(movableMarker, markerCallout,
mTileView, mContext, mMap));
markerCallout.setEditAction(new EditMarkerRunnable(movableMarker, MarkerLayer.this,
markerCallout, mTileView, mRequestManageMarkerListener));
markerCallout.setDeleteAction(new DeleteMarkerRunnable(mParentView, movableMarker, markerCallout,
tileView, mMap));
MarkerGson.Marker marker = movableMarker.getMarker();
markerCallout.setTitle(marker.name);
markerCallout.setSubTitle(marker.lat, marker.lon);
mTileView.addCallout(markerCallout, movableMarker.getRelativeX(), movableMarker.getRelativeY(), -0.5f, -1.2f);
markerCallout.transitionIn();
}
}
});
}
示例7: init
import com.qozix.tileview.TileView; //导入依赖的package包/类
/**
* Triggers the fetch of the map's markers and their drawing on the {@link TileView}. If this is
* the first time this method is called for this map, the markers aren't defined and the
* {@link MapLoader} will get them in an asynctask. Otherwise, we can draw them immediately.
* <p>
* This must be called when the {@link MapViewFragment} is ready to update its UI.
* <p>
* The caller is responsible for removing this {@link MapLoader.MapMarkerUpdateListener} from
* the {@link MapLoader}, after this object is no longer used.
*/
public void init(Map map, TileView tileView) {
mMap = map;
setTileView(tileView);
MapLoader.getInstance().setMapMarkerUpdateListener(this);
if (mMap.areMarkersDefined()) {
drawMarkers();
} else {
MapLoader.getInstance().getMarkersForMap(mMap);
}
}
示例8: MovableMarkerClickCallback
import com.qozix.tileview.TileView; //导入依赖的package包/类
MovableMarkerClickCallback(MovableMarker movableMarker, MarkerGrab markerGrab,
TileView tileView, Map map) {
mMovableMarkerWeakReference = new WeakReference<>(movableMarker);
mMarkerGrabWeakReference = new WeakReference<>(markerGrab);
mTileView = tileView;
mMap = map;
}
示例9: MorphMarkerRunnable
import com.qozix.tileview.TileView; //导入依赖的package包/类
MorphMarkerRunnable(MovableMarker movableMarker, MarkerCallout markerCallout, TileView tileView,
Context context, Map map) {
mMovableMarkerWeakReference = new WeakReference<>(movableMarker);
mMarkerCalloutWeakReference = new WeakReference<>(markerCallout);
mTileView = tileView;
mContext = context;
mMap = map;
}
示例10: EditMarkerRunnable
import com.qozix.tileview.TileView; //导入依赖的package包/类
EditMarkerRunnable(MovableMarker movableMarker, MarkerLayer markerLayer,
MarkerCallout markerCallout, TileView tileView,
MapViewFragment.RequestManageMarkerListener listener) {
mMovableMarkerWeakReference = new WeakReference<>(movableMarker);
mMarkerLayerWeakReference = new WeakReference<>(markerLayer);
mMarkerCalloutWeakReference = new WeakReference<>(markerCallout);
mTileView = tileView;
mListenerWeakRef = new WeakReference<>(listener);
}
示例11: DeleteMarkerRunnable
import com.qozix.tileview.TileView; //导入依赖的package包/类
DeleteMarkerRunnable(View parentView, MovableMarker movableMarker, MarkerCallout markerCallout,
TileView tileView, Map map) {
mParentView = parentView;
mMovableMarkerWeakReference = new WeakReference<>(movableMarker);
mMarkerCalloutWeakReference = new WeakReference<>(markerCallout);
mTileView = tileView;
mMap = map;
}
示例12: MarkerTouchMoveListener
import com.qozix.tileview.TileView; //导入依赖的package包/类
public MarkerTouchMoveListener(TileView tileView, MarkerMoveCallback markerMoveCallback,
MarkerClickCallback markerClickCallback) {
mTileView = tileView;
mGestureDetector = new GestureDetector(tileView.getContext(), this);
mMarkerMoveCallback = markerMoveCallback;
mMarkerClickCallback = markerClickCallback;
CoordinateTranslater coordinateTranslater = tileView.getCoordinateTranslater();
mLeftBound = coordinateTranslater.getLeft();
mRightBound = coordinateTranslater.getRight();
mTopBound = coordinateTranslater.getTop();
mBottomBound = coordinateTranslater.getBottom();
}
示例13: moveCalibrationMarker
import com.qozix.tileview.TileView; //导入依赖的package包/类
/**
* Before telling the {@link TileView} to move a marker, we save its relative coordinates so we
* can use them later on calibration save.
*/
private static void moveCalibrationMarker(TileView tileView, View view, double x, double y) {
CalibrationMarker calibrationMarker = (CalibrationMarker) view;
calibrationMarker.setRelativeX(x);
calibrationMarker.setRelativeY(y);
tileView.moveMarker(view, x, y);
}
示例14: placeMarker
import com.qozix.tileview.TileView; //导入依赖的package包/类
private void placeMarker(TileView tileView, Context context, int resId, double x, double y) {
Log.wtf("", "adding " + x + " " + y);
ImageView imageView = new ImageView(context);
imageView.setImageResource(resId);
double scale = tileView.getScale();
this.view = tileView.addMarker(imageView, x/scale, y/scale);
}
示例15: onCreate
import com.qozix.tileview.TileView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tileView = (TileView)findViewById(R.id.tile_view);
tooltipLayout = (ToolTipRelativeLayout)findViewById(R.id.tooltip_layout);
initializeTileView();
setupFAB();
}