MapXL / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

User can pan outside of map bounds #88

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There are upper and lower bounds to the map, nothing north of the north
pole. nothing south of the south pole.

RouteMe does not have any way to keep a user from scrolling much further
south than the south pole/north than the north pole.

I would love if there was a way to keep a user from panning beyond the
upper and lower bounds of the map, like maps.app does.

Original issue reported on code.google.com by Quazie on 15 Mar 2009 at 3:57

GoogleCodeExporter commented 8 years ago

Original comment by Quazie on 15 Mar 2009 at 3:57

GoogleCodeExporter commented 8 years ago
In our use of Route me, we patched this by using Categories 
(http://en.wikipedia.org/wiki/Objective-
C#Example_usage_of_categories) to override the moveBy-method of RMMapContents 
(code below).Not exactly 
a great solution, but it works...

- (void)moveBy: (CGSize) delta{ 
    [mercatorToScreenProjection moveScreenBy:delta];
    [imagesOnScreen moveBy:delta];
    [tileLoader moveBy:delta];
    [overlay moveBy:delta];
    [overlay correctPositionOfAllSublayers];
    [renderer setNeedsDisplay];

    if(self.mapCenter.latitude>89 || self.mapCenter.latitude<-89){
        delta.width=-delta.width;
        delta.height=-delta.height;
        [self moveBy:delta];
    }
}

Original comment by knu...@gmail.com on 1 Jun 2010 at 8:07

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
MapView can have a delegate method -(BOOL)shouldMapMove:(MapView *)map 
by:(CGSize)delta

This can enable us to check for bounds and decide whether moveBy: method is 
called.

Original comment by srikanthsmail on 4 Sep 2010 at 10:17