Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotation takes shortcut when moved #99

Open
lukasvd opened this issue Aug 5, 2012 · 5 comments
Open

annotation takes shortcut when moved #99

lukasvd opened this issue Aug 5, 2012 · 5 comments

Comments

@lukasvd
Copy link

lukasvd commented Aug 5, 2012

Small question I hope. I have a setup that when you move your finger over a elevation-plot, an annotation (marker) is shown along the line of a shape annotation. I do this by constantly updating the coordinate (by means of delegate). when you move your finger to fast over the plot, the marker annotation takes shortcuts (in fluent lines though), bezier like it seams. Is this something that can be influenced? I would like the marker to follow the given coordinates.

@cloay
Copy link

cloay commented Jan 24, 2013

You can implement RMMapViewDelegate and add some code as follows:

  • (void)mapView:(RMMapView *)map didDragAnnotation:(RMAnnotation *)annotation withDelta:(CGPoint)delta
    {
    //set coordinate
    //annotation.coordinate =
    }

@lukasvd
Copy link
Author

lukasvd commented Jan 24, 2013

Thanks for the reply. I do use the proposed procedure. From the (core-)plot events are send to the map object which updates the location.coordinate accordingly. I do this in exact the same manner for mkmapview and there the plot annotation on the map follows the polyline nicely. I also tried updating the annotation.position only (could be more lightweight to process) but the same results. It seems like when there are too much updates on a annotation location (or position) not all intermediate points are processed and the curve is determined by the delta of the points that do get processed, hence the nice curves.

@lukasvd lukasvd closed this as completed Jan 24, 2013
@lukasvd lukasvd reopened this Jan 24, 2013
@incanus
Copy link

incanus commented Jan 24, 2013

Have you considered something like hiding the actual annotation and just animating a lookalike until it is released again? I'm not sure I've ever tried anything like this before. From what I understanding, you basically want to drag an annotation along a visible track?

@lukasvd
Copy link
Author

lukasvd commented Jan 25, 2013

Yep, that's what I am doing. To clarify the setup a bit more. Half the screen is a coreplot graph which visualizes the elevation of a polyline, the other half of the screen is a map object (mkmapview or rmmapview) which shows the polyline. When you move your finger over the elevation graph there is a small image on the map (rmmarker annotation based on an image) that shows exactly where you are on the map (point on the polyline). This works nicely for mkmapview, did work as well for the original rout-me lib I worked with, but is working different with the Alpstein fork I use now. If the gesture movement on the plot is slow it also works just fine, if you go faster it skips intermediate points (locations). Or so it seems.
So when there is movement i show the "specialized" annotation, and hide/release it afterwards.

@incanus
Copy link

incanus commented Jan 31, 2013

I would recommend profiling the code to see what's taking up the time. Maybe it's something easy that could be pre-calculated like pixel-to-coordiante conversions or something like that.

yarry pushed a commit to yarry/route-me that referenced this issue Jul 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants