How set Custom Annotation markers ( animated rings around a point) on GMSMapView

前端 未结 5 1830
陌清茗
陌清茗 2020-12-29 00:23

Using Google maps iOS SDK I have implemented a mapView in that i have created markers as follows

// Creates a marker in the center of the map.
GMSMarker *mar         


        
5条回答
  •  既然无缘
    2020-12-29 01:00

    From the google map sdk / it appears at this moment v1.9 the only supported animations in using framed based images. If you're using mapkit - > you can simply use https://github.com/TransitApp/SVPulsingAnnotationView

    From google's sdk -> ios sample

    AnimatedCurrentLocationViewController.m

                NSMutableArray *frames = [NSMutableArray array];
                for (int i =0; i<146; i++) {
                    NSString *img = [NSString stringWithFormat:@"pulse-%d",i];
                    [frames addObject:[UIImage imageNamed:img]];
                }
               marker.icon = [UIImage animatedImageWithImages:frames duration:3];
    

    On my branch of FlipBook https://github.com/johndpope/Flipbook I've rendered out the pulse animations in retina to a bunch of transparent png images. It maybe possible to further reduce these file sizes in photoshop. Granted this is not ideal and will cause your binary file size to be bloated but is passable.

提交回复
热议问题