Closed azizbekian closed 8 years ago
if you want a layer beneath the tiles use addViewAt(0, view);
also, TileView inherits from ZoomPanLayout, they're not different instances
is this resolved?
if you want a layer beneath the tiles use addViewAt(0, view);
Cannot seem to find such an API. Which class has this method?
also, TileView inherits from ZoomPanLayout, they're not different instances
When adding LinearLayout
filled horizontally with multiple ImageViews
as a first child of TileView
(aka TileView.addView(myLinearLayout, 0)
), when zooming the TileView
, images in LinearLayout
get stretched, whereas when this LinearLayout
is added to ZoomPanLayout
the zoom works perfectly fine.
I'm not sure what you mean. There is only one ZoomPanLayout
which is also the TileView
, unless you're adding your own.
Sorry for confusion. I meant ScalingLayout
.
tileView.getScalingLayout().addView(linearLayout, 0);
This way the zooming works fine. But if I add the linearLayout
as a child of tileView, then zooming stretches the images that are inside of this linearLayout
.
Now, what I want is to have this linearLayout
as a first layer, and when zoomed - layer two loaded. But this way layer two is beneath the linearLayout
, so tiles are not seen when zoomed.
OK. There's a built-in ScalingLayout right above the tiles: https://github.com/moagrius/TileView/blob/master/tileview/src/main/java/com/qozix/tileview/TileView.java#L113
This one is automatically synced with the TIleView's scale. You can move this one to beneath the tiles, with something like:
View scalingLayout = tileView.getScalingLayout();
tileView.removeView(scalingLayout);
tileView.addView(0, scalingLayout);
Or, you could make your own ScalingLayout, add that at the first level, but then you'd have to sync the scale with tileview yourself (although that's pretty easy).
Thank you, @moagrius , this works pretty nice!
:thumbsup:
In the "...add a down-sampled image beneath the tile layer?" you showed how to add an
ImageView
toTileView
. What I need is adding a layout, so that it can be zoomed. Thus I tried adding my layout toZoomPanLayout
instead ofTileView
, which works fine, now my layout gets zoomed in/out. But the tiles are not being displayed. I guess they are being shown beneath of my added layout.How can I achieve this effect? I want my layout (which is filled by
ImageView
s) to be shown and when zoomed in the tiles loaded on top of this layout.