Comments (14)
i'm not following - can you use code or psuedo-code to describe step-by-step what you're experiencing?
from tileview.
per email exchange, this issue was resolved by calling requestLayout after adding a marker, to make sure the layout rect was registered with the hit-testing map. The latest release has this functionality built-in.
from tileview.
For me it's not working. When i add a marker dynamically and if i don't zoom in or out onTap is not triggered. I use the last src version and i've called requestLayout (after a test without) but it doesn't work...
from tileview.
Same here !
from tileview.
can you guys try calling both invalidate* and postInvalidate on the MarkerManager after the marker is added?
or... can you provide step-by-step instructions to recreate?
from tileview.
in my onFingerDown method i do
handler.postdelayed( runnable, ViewConfiguration.getLongPressTimeout() );
runnable :
public void run() {
if (!movedFinger) {
ImageView marker = new ImageView(ctx);
marker.setImageResource(R.drawable.marker);
marker.setTag("Test");
tileview.addMarker(marker, xPoint, yPoint, -0.5f, -1f);
}
}
I've tried both invalidate and postInvalidate but without result.
from tileview.
I see - so the marker is rendering but it's not being registered for the onMarkerTap event, right? If that's not correct, please explain.
Assuming that is correct, a little background: onMakerTap just compares the coordinates of the tap event to a map of all the marker's layout as Rects. This is calculated in onLayout
.
I suspect the problem is because you're both adding markers from a handler, off the UI thread. So, try this:
At the end of your run
method (on the line after tileview.addMarker(marker, xPoint, yPoint, -0.5f, -1f);
), add something like this
tileview.post(new Runnable(){
@Override
public void run(){
tileview.requestLayout();
}
});
post
will be called on the TileView's UI thread, and hopefully force a recalculation of the marker layouts which would register them with the onMarkerTap map of Rects.
LMK if that helps. If not, I'll try to recreate locally to find a patch.
from tileview.
nop... it still not work.
from tileview.
ok, i'll create a debug build and post back within the next couple days, hopefully with a patch to commit
thanks for the feedback
from tileview.
in the onLayout method of MarkerManager if i comment
if(!changed){
return;
}
It's work. The Rect is not define.
from tileview.
awesome - looks like a premature optimization - I'll make the change and commit as soon as I get a chance.
thanks!
from tileview.
@skaor this patch has been included in the latest commit and release. thanks for contributing!
from tileview.
yeahhh my first contrib to a github project :p !
from tileview.
you're even mentioned in the release - you're basically famous now ;)
from tileview.
Related Issues (20)
- 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
- Impossible import com.qozix.tileview HOT 5
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.