Closed Errichamonda closed 6 years ago
I'm trying to add Callout to my TileView markers but when I scale the TileView the callout doesn't appear in center of the marker.
Here it is before i zoom out: https://imgur.com/aDc010d And here and after: https://imgur.com/Mc93Qrg
My MarkerTapListener; mMarkerTapListener = (View v, int x, int y) -> { tileView.slideToAndCenter(x, y); SampleCallout callout = new SampleCallout(v.getContext()); tileView.addCallout(callout, x, y, -0.5f, -1.0f); callout.transitionIn(); callout.setTitle("Guida " + v.getTag()); callout.setSubtitle("Altre info?"); };
mMarkerTapListener = (View v, int x, int y) -> { tileView.slideToAndCenter(x, y); SampleCallout callout = new SampleCallout(v.getContext()); tileView.addCallout(callout, x, y, -0.5f, -1.0f); callout.transitionIn(); callout.setTitle("Guida " + v.getTag()); callout.setSubtitle("Altre info?"); };
For positioning i use placeMarker(R.drawable.marker, 1106, 606, 0);
placeMarker(R.drawable.marker, 1106, 606, 0);
and private void placeMarker(int resId, double x, double y, int tag) { ImageView imageView = new ImageView(getContext()); imageView.setImageResource(resId); imageView.setTag(tag); tileView.setMarkerTapListener(mMarkerTapListener); tileView.addMarker(imageView, x, y, -1f, -1.0f); }
private void placeMarker(int resId, double x, double y, int tag) { ImageView imageView = new ImageView(getContext()); imageView.setImageResource(resId); imageView.setTag(tag); tileView.setMarkerTapListener(mMarkerTapListener); tileView.addMarker(imageView, x, y, -1f, -1.0f); }
What's wrong with it?
p.s. I have some problem formatting the code in GitHub
Fixed it was my mistake. I didn't use getCoordinateTranslater().translateAndScaleAbsoluteToRelativeX and Y
glad you got it working
I'm trying to add Callout to my TileView markers but when I scale the TileView the callout doesn't appear in center of the marker.
Here it is before i zoom out: https://imgur.com/aDc010d And here and after: https://imgur.com/Mc93Qrg
My MarkerTapListener;
mMarkerTapListener = (View v, int x, int y) -> { tileView.slideToAndCenter(x, y); SampleCallout callout = new SampleCallout(v.getContext()); tileView.addCallout(callout, x, y, -0.5f, -1.0f); callout.transitionIn(); callout.setTitle("Guida " + v.getTag()); callout.setSubtitle("Altre info?"); };
For positioning i use
placeMarker(R.drawable.marker, 1106, 606, 0);
and
private void placeMarker(int resId, double x, double y, int tag) { ImageView imageView = new ImageView(getContext()); imageView.setImageResource(resId); imageView.setTag(tag); tileView.setMarkerTapListener(mMarkerTapListener); tileView.addMarker(imageView, x, y, -1f, -1.0f); }
What's wrong with it?
p.s. I have some problem formatting the code in GitHub