Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map flickering issue #434

Open
CMiOSDeeplink opened this issue Feb 21, 2023 · 1 comment
Open

map flickering issue #434

CMiOSDeeplink opened this issue Feb 21, 2023 · 1 comment
Assignees
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@CMiOSDeeplink
Copy link

When the page was idle, the map was flickering on a black background.

Also, it is inserted inside the TableView cell.

version :'GoogleMaps', '7.3.0'

Code example

    mapContainerView.subviews.first?.removeFromSuperview()
    // Set up map view
    let mapView = GMSMapView()
                    
    addSelectionMarker(forMapView: mapView, location: location)
    
    // Disable all maps controls
    mapView.settings.indoorPicker = false
    mapView.settings.compassButton = false
    mapView.settings.myLocationButton = false
    mapView.settings.setAllGesturesEnabled(false)
    
    // Add mapview to container
    mapView.translatesAutoresizingMaskIntoConstraints = false
    mapContainerView.addSubview(mapView)
    let views = ["mapView": mapView]
    var constraints = [NSLayoutConstraint]()
    constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "H:|[mapView]|",
                                                                  options: .alignAllCenterX,
                                                                  metrics: nil,
                                                                  views: views))
    constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "V:|[mapView]|",
                                                                  options: .alignAllCenterX,
                                                                  metrics: nil,
                                                                  views: views))
    mapContainerView.addConstraints(constraints)
    mapView.setNeedsLayout()
    mapView.layoutIfNeeded()

    func addSelectionMarker(forMapView mapView: GMSMapView,
                        location: CMStoreLocation) {
    let marker = GMSMarker()
    let storeLocation = CLLocationCoordinate2DMake(location.lat,
                                                   location.lon)
    marker.position = storeLocation
    marker.icon = UIImage(named: "location_cmgreen")
    marker.map = mapView
    mapView.animate(toLocation: storeLocation)
    mapView.animate(toZoom: googleMapsDefaultZoomScale)
}

Thanks!
IMG_20230221_123052

@CMiOSDeeplink CMiOSDeeplink added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 21, 2023
@wangela
Copy link
Member

wangela commented Feb 21, 2023

If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.

@CMiOSDeeplink Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@amuramoto amuramoto assigned wangela and unassigned amuramoto Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants