question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

i got struct in adding marker on real time by single tapping

See original GitHub issue

hi i want to add marker on runtime while single tapping but when i implement this code double longitude = getTileView().getCoordinateTranslater().translateAndScaleAbsoluteToRelativeX(getTileView().getScrollX() + x, getTileView().getScale()); double latitude = getTileView().getCoordinateTranslater().translateAndScaleAbsoluteToRelativeY(getTileView().getScrollY() + y, getTileView().getScale());

its works fine but when i zoom image then tap its add marker on diffrent place

pleas help me out from this

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mohitmadaan27commented, Jan 10, 2017

Hi i resolved by doing this .Hotspot was giving me wrong position

final GestureDetector gestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
                //do something
                Log.e("single", "touch");
                int h = Math.round(motionEvent.getY());
                int w = Math.round(motionEvent.getX());
                ImageView marker = new ImageView(Test4plan.this);
                // save the coordinate for centering and callout positioning

                double longitude = getTileView().getCoordinateTranslater().translateAndScaleAbsoluteToRelativeX(getTileView().getScrollX() + w, getTileView().getScale());
                double latitude = getTileView().getCoordinateTranslater().translateAndScaleAbsoluteToRelativeY(getTileView().getScrollY() + h, getTileView().getScale());

                double[] point = {longitude, latitude};
                marker.setTag(point);
                // give it a standard marker icon - this indicator points down and is centered, so we'll use appropriate anchors
                marker.setImageResource(R.drawable.map_marker_featured);
                tileView.addMarker(marker, longitude, latitude, null, null);
                return true;
            }

            @Override
            public void onLongPress(MotionEvent motionEvent) {
                Log.e("long", "touch");
                super.onLongPress(motionEvent);
            }

            @Override
            public boolean onDoubleTap(MotionEvent e) {
                Log.e("double", "touch");
                return super.onDoubleTap(e);
            }
        });
        tileView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {

                return gestureDetector.onTouchEvent(event);
            }
        });
0reactions
p-lrcommented, Jan 10, 2017

Have you correctly implemented the onMesure method of your marker? See this link for explanation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Drag marker on on Single tap instead of LongClick
What I want is the user only has to tap a marker and start dragging instead of hold the marker for 1 2...
Read more >
What is EFT Tapping, and Can It Calm the ADHD Brain?
EFT tapping is a technique that aims to decrease stress and improve wellbeing. See how it can help with ADHD symptoms here.
Read more >
Logic Remote release notes - Apple Support (TJ)
It is now possible to delete a track from the Live Loops grid in Logic Remote. ... is hidden while playing and a...
Read more >
10 ForeFlight Map Features You Might Not Know About
Instead of being stuck with unrealistic ETE estimates for the rest of the flight, tap the next leg in the route (the one...
Read more >
Sank Marker Pen for Highlight-Double Line Markers ... - Amazon.com
【Information】 · The single double line outline pen is 13. 7 cm. It made by plastic and refill ; Usage. The first time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found