-
Notifications
You must be signed in to change notification settings - Fork 335
Home
moagrius edited this page Sep 8, 2013
·
12 revisions
The TileView widget is a subclass of ViewGroup that provides a mechanism to asynchronously display tile-based images, with additional functionality for 2D dragging, flinging, pinch or double-tap to zoom, adding overlaying Views (markers), built-in Hot Spot support, dynamic path drawing, multiple levels of detail, and support for any relative positioning or coordinate system.
A minimal implementation might look like this:
TileView tileView = new TileView(this); tileView.setSize(3000,5000); tileView.addDetailLevel(1.0f, "path/to/tiles/%col%-%row%.jpg");
A more advanced implementation might look like:
TileView tileView = new TileView(this); tileView.setSize(3000,5000); tileView.addTileViewEventListener(someMapEventListener); tileView.defineRelativeBounds(42.379676, -71.094919, 42.346550, -71.040280); tileView.addDetailLevel(1.000f, "tiles/boston-1000-%col%_%row%.jpg", 256, 256); tileView.addDetailLevel(0.500f, "tiles/boston-500-%col%_%row%.jpg", 256, 256); tileView.addDetailLevel(0.250f, "tiles/boston-250-%col%_%row%.jpg", 256, 256); tileView.addDetailLevel(0.125f, "tiles/boston-125-%col%_%row%.jpg", 128, 128); tileView.addMarker(someView, 42.35848, -71.063736); tileView.addMarker(anotherView, 42.3665, -71.05224); tileView.addMarkerEventListener(someMarkerEventListener);
A detailed, step-by-step instruction on creating an app with this component is available here, by Trustus1er.