Fix RMPath #64

Open
michaeltyson opened this Issue Oct 29, 2010 · 8 comments

Comments

Projects
None yet
3 participants
Owner

michaeltyson commented Oct 29, 2010

(Quoting vyskocil:) Redraw is sometimes broken, slowdowns with small zoom level, out of memory error arise sometimes (layer too big), missing features

Owner

michaeltyson commented Oct 29, 2010

May I propose User/Project@SHA ref: michaeltyson/route-me@a54a756 as a starting point for revising RMPath: This introduces some more sensible path geometry (not the weird inverted thing that was there originally), and adds both bounds calculation and direct CGPath access. It's cleaner, too.

Contributor

amjaliks commented Mar 24, 2011

Michael, why don't you put your proposed changes for RMPath to master branch?

Owner

michaeltyson commented Mar 24, 2011

I haven't done it yet mostly because it's largely untested, and I'm currently flat-out on a product development cycle.

Pretty soon I'm going to work on an update to one of my apps that'll use paths, and that'll necessitate a closer look at RMPath - I intend to roll it into the master when I do that. Will be a couple/several weeks yet, though.

Contributor

amjaliks commented Mar 24, 2011

Now I am working also a project where I need to you RMPath a lot. Maybe you can share your change in a branch? Thus, we don't create two incompatible solutions?

Contributor

amjaliks commented Mar 24, 2011

Michael, is there any chance you will share your improved RMPath code shortly? Or I need dig it my self? :)

Owner

michaeltyson commented Mar 25, 2011

I already have =) The link's the first comment, above

I have tried Michaels RMPath proposed in this issue and it works much better than the current version. I had one issue though. I got crashes when zooming in and out and when the path was outside the visible area. I tracked it down to the recalculateGeometry in the new RMPath. I changed the end of this method so that right after:

pixelBounds = CGRectIntersection(pixelBounds, CGRectInset(screenBounds, -outset, -outset));

the rest of the method now looks like:

if (!CGRectIsNull(pixelBounds))
{
pixelBounds.origin.x -= myPosition.x; pixelBounds.origin.y -= myPosition.y;
self.anchorPoint = CGPointMake(-pixelBounds.origin.x / pixelBounds.size.width,-pixelBounds.origin.y / pixelBounds.size.height);
}
self.bounds = pixelBounds;
[super setPosition:myPosition];
[self setNeedsDisplay];

Owner

michaeltyson commented May 4, 2011

Okay, I've submitted my implementation (with matspetter's fix - thanks!) for perusal - see route-me/#121.

jklimke referenced this issue in jklimke/mapbox-ios-sdk Nov 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment