Comments (6)
08-07 15:59:00.230: E/AndroidRuntime(20562): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
Looks like you're trying to add a View that's already in another ViewParent. You need to detach it from the display list before adding it (just like you would with any addView call).
HTH, LMK if that solves it.
from tileview.
Seems I was re-using the marker imageview when I shouldn't have been, I've fixed that problem and also fixed an off-by-one error in the DetailLevelPatternParserDefault which was causing my map to mis-align by one tile. However the markers never stay in the same location relative to the map, they shift back as if they too are off by one tile.
from tileview.
I figured out why the markers aren't aligned and I'm not sure if it is intentional. Initially I'd specified the anchor x/y to be 0.5, 1.0 (e.g. from the top left, half the width in and the entire height down) however it appears that this is incorrect and instead I've used -0.5 and -1.0 which seem to work a lot better. This is not intuitive as you would imagine that you're effectively specifying a percentage of the image width and height. I imagine that this is because you want to shift the anchor point by half the width in the negative direction however from an API perspective it's slightly confusing.
from tileview.
The math is x + (child.measuredWidth * anchorX)
It's much more common to have a google-maps style offset, where the image is pointing down and centered over the point, but I believe implying a negative offset is presumptive. It's actually gone back and forth between the (implied negative, or not) in the old widget (MapView)
from tileview.
I think what you should try to express is the percentage from top left of the image (or even bottom left) to the pixel of the image you wish to align with the point you're specifying on the map. So flipping these to imply a positive is better for the API consumer.
You can also, for instance specify exact pixel co-ordinates as per using 33 / image.getWidth(), 22 / image.getHeight() to calculate the anchors and the API consumer doesn't need to flip it.
from tileview.
It's been both ways (in the previous widget, MapView); I settled on this for a number of reasons, but mostly because presuming a google-maps style marker didn't make sense - this widget can be used for a variety of applications that aren't necessarily map-centric, and positive offsets are very likely. When setting offsets, I think flipping the sign implicitly is more confusing to the consumer.
FWIW, when it was implicitly flipped, users said the same thing, that it was confusing. I think it's mostly just personal preference, or the perspective from user's specific use case.
I'm always happy to try to fix bugs, or add features, but it's pretty unlikely I'll break the existing API. I am considering converting all TileView/ZoomPanLayout private members to protected, for more flexible extensions... I'll see if there's a need for that. Otherwise, feel free to fork your own version.
from tileview.
Related Issues (20)
- Issues scaling past 1f HOT 3
- Remote tile demo freezes and crashes HOT 2
- Combine smooth scroll and scale HOT 2
- Tiles not properly laid out when Scale < 1 with remote tiles HOT 15
- Open source but no license? HOT 2
- Markers disappear when zooming HOT 4
- Cannot add tile images on the fly HOT 1
- StreamProvider asked to provide data for rows and columns out of bounds with to small images HOT 5
- Tiles outside the image are created HOT 8
- White text on white background in Advanved Tile Demo HOT 1
- Get touched position when touch on the tileview (version 4.0.7)
- longtouch
- App killed in background crashes when returning to foreground HOT 1
- `android.os.BadParcelableException` regarding `com.moagrius.widget.ScrollView$SavedState.<init>` HOT 1
- Use in viewholder for recycler view. HOT 2
- build() method starts to return void instead of TileView HOT 1
- Mike passed away HOT 5
- Does this lib support SVG format
- JCenter -> MavenCenter
- implementation 'com.qozix:tileview:2.7.7' doesn't seem to work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tileview.