GIF Image as Marker in Google Map for iOS (Swift)

GIF Image as Marker in Google Map for iOS (Swift)

I've this gif image:

I've this gif image:

 

I am able to add a custom static image as marker using the following code:

if let location = locationManager.location {
            currentLocationMarker = GMSMarker(position: location.coordinate)
            currentLocationMarker?.icon = UIImage(named: "user")
            currentLocationMarker?.map = mapView
            currentLocationMarker?.rotation = locationManager.location?.course ?? 0
        }

I want to use this gif image as marker. Is there anyway? Though I know static images are encouraged but is there a possibility?

I was thinking of adding a UIView say a 100x100 view and animating this icon in it, haven't tried it but I tried the solution mentioned in this thread: How to load GIF image in Swift? as:

let jeremyGif = UIImage.gifImageWithName("puppy")
let imageView = UIImageView(image: jeremyGif)
imageView.frame = CGRect(x: 0, y: 0, width: jeremyGif?.size.width ?? 100.0, height: jeremyGif?.size.height ?? 100.0)
//view.addSubview(imageView)
//mapView.addSubview(imageView)

if let location = locationManager.location { currentLocationMarker = GMSMarker(position: location.coordinate) currentLocationMarker?.icon = imageView.image //UIImage(named: "user") currentLocationMarker?.map = mapView currentLocationMarker?.rotation = locationManager.location?.course ?? 0 }

but doing so also doesn't work. I've added this gif image in assets and this is how it appears in it:


ios swift google-maps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Integrate Google Maps in React Native App on iOS

In this React Native tutorial, I will explain how to integrate Google Maps in React Native App into iOS. Create React Native Application. Install react-native-maps package. Configuration on iOS. Enable Google Maps on iOS. Create a Google Maps API Key. Run the React Native App

Hire Dedicated Swift Developers

Want to create a native iOS application for your Startup? **[Hire Dedicated Swift Developers](https://hourlydeveloper.io/hire-dedicated-swift-developer/ "Hire Dedicated Swift Developers")** for end-to-end services like development, migration...

10 Free Online Resources To Learn Swift Language

Swift is a fast and efficient general-purpose programming language that provides real-time feedback and can be seamlessly incorporated.

Show the direction of travel in iOS Google Maps

Real world taxi app experience!Taxi or travel apps always need to show the direction of travel on the map. In this quick tutorial, I will show you how to set up, show, and test the directional marker on the maps.

Hire iOS App Developer

Are you looking to transform your idea into an iPhone application? Hire iPhone programmer team from **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** to ensure the best results, utilizing all the latest trends in iOS app...