GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ericze/MapViewAnimation: 在地图上实现的简陋动画UIView Animation,Core Animation

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
MapViewAnimation.xcodeproj
MapViewAnimation.xcodeproj
 
 
MapViewAnimation.xcworkspace
MapViewAnimation.xcworkspace
 
 
MapViewAnimation
MapViewAnimation
 
 
MapViewAnimationTests
MapViewAnimationTests
 
 
MapViewAnimationUITests
MapViewAnimationUITests
 
 
Pods
Pods
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 
UIViewAnimation.gif
UIViewAnimation.gif
 
 
ios_movingAnnotation.gif
ios_movingAnnotation.gif
 
 

Repository files navigation

MapViewAnimation

在地图上实现的简陋动画UIView Animation,Core Animation(如何在地图上做动画) CAKeyFrameAnimation

for (int i = 0; i<[points count]; i++) { TracingPoint * tp = points[i];

    //position
    MAMapPoint p = MAMapPointForCoordinate(tp.coordinate);
    [xvalues addObjectsFromArray:@[@(p.x), @(p.x)]];//stop for turn
    [yvalues addObjectsFromArray:@[@(p.y), @(p.y)]];

    //angle
    double currDir = [Util fixNewDirection:tp.course basedOnOldDirection:preDir];
    [rvalues addObjectsFromArray:@[@(preDir * DegToRad), @(currDir * DegToRad)]];
    
    //distance
    dis[i] = MAMetersBetweenMapPoints(p, preLoc);
    sumOfDistance = sumOfDistance + dis[i];
    dis[i] = sumOfDistance;
    
    //record pre
    preLoc = p;
    preDir = currDir;
}

//   add animation.
 CAKeyframeAnimation *xanimation = [CAKeyframeAnimation animationWithKeyPath:MapXAnimationKey];
 xanimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
  xanimation.values   = xvalues;
  xanimation.keyTimes = times;
 xanimation.duration = duration;
 xanimation.delegate = self;
 xanimation.fillMode = kCAFillModeForwards;

image image

About

在地图上实现的简陋动画UIView Animation,Core Animation

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.