How to use Pulsator on GoogleMap Marker
albertml opened this issue · comments
When I tried to add it in GoogleMap Marker, its not working...
Here's my code:
var myMarker.position = CLLocationCoordinate2D(latitude: myLatitude , longitude: myLongitude)
myMarker.title = "MyLocation"
myMarker.map = mapView
let pulsator = Pulsator()
pulsator.radius = 240.0
pulsator.backgroundColor = UIColor.blue.cgColor
myMarker.layer.addSublayer(pulsator)
Theres no error when you compile but the pulsator is not seen only the marker is displayed.
If you put your Pulsator codes in viewWillAppear
, it will work. I tried viewDidLoad
and it won't work on Google Maps.
I know it is a bit of weird and I will leave other people comment on this.
Still not working Mr. Ziki Li....
First I tried this,
override func viewWillAppear(_ animated: Bool) {
let pulsator = Pulsator()
pulsator.radius = 240.0
pulsator.backgroundColor = UIColor.blue.cgColor
myMarker.layer.addSublayer(pulsator)
}
Still didn't work... Then I tried this
override func viewWillAppear(_ animated: Bool) {
// Creates a marker in the center of the map.
myMarker.position = CLLocationCoordinate2D(latitude: myLocation.coordinate.latitude, longitude: myLocation.coordinate.longitude)
myMarker.title = "MyLocation"
myMarker.panoramaView = panoramaView
myMarker.icon = GMSMarker.markerImage(with: .blue)
let pulsator = Pulsator()
pulsator.radius = 240.0
pulsator.backgroundColor = UIColor.blue.cgColor
myMarker.layer.addSublayer(pulsator)
myMarker.map = mapView
}
But still no luck... Any more suggestion? Thanks in advance...
Has anyone found a way to add pulsator to google maps?
Anyone found a way to add pulsator to google maps?
need add pulsator to marker
I did add a pulsator to gmaps
#34 (comment)