I wrote a widget similar to the Warcraft GEO map function.
For example, you have a scrollView that can be zoomed in and out. It will zoom in and out, click the button in it, and perform other operations.
This small map control. It will be synchronized with your large scrollView. There are thumbnails and the location of your current view. Just like in a game.
See the graph.
SmallMapView. h
<UIKit/UIKit.h> <QuartzCore/QuartzCore.h>@property (nonatomic,assign,)@property (nonatomic,retain,)CALayer *@property (nonatomic,retain,)CALayer *@property (nonatomic,retain,)UIScrollView *- ()initWithUIScrollView:(UIScrollView *- ()scrollViewDidScroll:(UIScrollView *- (
SmallMapView. m
- ()initWithUIScrollView:(UIScrollView *== _contentLayer = _rectangleLayer == = CGSizeMake(, = == == CGRectMake(, , scrollView.frame.size.width * _scaling, scrollView.frame.size.height *- (- ()scrollViewDidScroll:(UIScrollView * x = y = h = w =* _scaling, y * _scaling, h * self.scaling, w *- (=- ()setScaling:(UIScrollView *= self.frame.size.height /- (CALayer *)drawContentView:(UIScrollView **layer == (UIView *view *image =*copyLayer == ( x = y = h = w == CGRectMake(x * _scaling,y *_scaling,w * _scaling,h *
If you need, you can go here to get the source code: https://github.com/TinyQ/LittleMapView.git