Ios implements a map function similar to Warcraft in

Source: Internet
Author: User

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.