Giter Site home page Giter Site logo

Comments (12)

sandman4sure avatar sandman4sure commented on September 18, 2024 2

It breaks because of the layer.masksToBounds = true in ClusterAnnotationView

from cluster.

efremidze avatar efremidze commented on September 18, 2024

on the cluster annotation or regular annotation?

from cluster.

donbytyqi avatar donbytyqi commented on September 18, 2024

on the cluster annotation view, sorry should've been more clear.

annotationView = ClusterAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier, type: .image(UIImage(named: "pin.png"))) annotationView?.isUserInteractionEnabled = true annotationView?.canShowCallout = true annotationView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)

from cluster.

efremidze avatar efremidze commented on September 18, 2024

You need to add it twice since its reused

if let view = view as? ClusterAnnotationView {
    view.annotation = annotation
    view.configure(with: type)
    view.canShowCallout = true
    view.rightCalloutAccessoryView = SomeView()
} else {
    view = ClusterAnnotationView(annotation: annotation, reuseIdentifier: identifier, type: type)
    view.canShowCallout = true
    view.rightCalloutAccessoryView = SomeView()
}

from cluster.

donbytyqi avatar donbytyqi commented on September 18, 2024

That doesn't seem to work as well, is this the right place to put it?

func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
    
    guard !annotation.isKind(of: MKUserLocation.self) else {
        return nil
    }
    
    let annotationIdentifier = "AnnotationIdentifier"
    
    var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: annotationIdentifier)
    
    if annotationView == nil {
        annotationView = ClusterAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier, type: .image(UIImage(named: "pin.png")))
        annotationView?.canShowCallout = true
        annotationView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
    } else {
        annotationView!.annotation = annotation
        annotationView?.canShowCallout = true
        annotationView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
    }
    
    return annotationView
    
}

from cluster.

efremidze avatar efremidze commented on September 18, 2024

I don't believe I'm breaking the callout anywhere. Can u check stackoverflow? Or try to debug it.

func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
    
    guard !annotation.isKind(of: MKUserLocation.self) else {
        return nil
    }
    
    let annotationIdentifier = "AnnotationIdentifier"
    
    var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: annotationIdentifier)
    
    if annotationView == nil {
        annotationView = ClusterAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier, type: .image(UIImage(named: "pin.png")))
    } else {
        annotationView!.annotation = annotation
    }
    annotationView!.canShowCallout = true
    annotationView!.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
    
    return annotationView
    
}

from cluster.

donbytyqi avatar donbytyqi commented on September 18, 2024

Still not working, maybe the issue is Swift 4?

from cluster.

efremidze avatar efremidze commented on September 18, 2024

swift 4 doesn't affect callouts

from cluster.

donbytyqi avatar donbytyqi commented on September 18, 2024

hmm, okay, I'll just see what's causing this issue. Thanks for the help :)

from cluster.

matejhocevar avatar matejhocevar commented on September 18, 2024

I'm having the same issue. How can I display annotation callout?
Can someone show me on example code from this repo?
Thanks for help

from cluster.

efremidze avatar efremidze commented on September 18, 2024

This library handles the clustering, you can add a callout by using the MKMapViewDelegate methods.

Example: https://www.raywenderlich.com/548-mapkit-tutorial-getting-started

from cluster.

ghadeermohameedelmahdy avatar ghadeermohameedelmahdy commented on September 18, 2024

anyone have the solution?

from cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.