{"id":18270433,"url":"https://github.com/nnhubbard/ZSPinAnnotation","last_synced_at":"2025-04-05T01:30:36.103Z","repository":{"id":1995990,"uuid":"2928994","full_name":"nnhubbard/ZSPinAnnotation","owner":"nnhubbard","description":"Build custom MKMapView annotations with any UIColor","archived":false,"fork":false,"pushed_at":"2016-06-14T17:25:47.000Z","size":346,"stargazers_count":160,"open_issues_count":4,"forks_count":31,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-05T11:52:52.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"www.zedsaid.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nnhubbard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-06T23:42:14.000Z","updated_at":"2022-08-25T15:05:21.000Z","dependencies_parsed_at":"2022-08-28T07:10:40.290Z","dependency_job_id":null,"html_url":"https://github.com/nnhubbard/ZSPinAnnotation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnhubbard%2FZSPinAnnotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnhubbard%2FZSPinAnnotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnhubbard%2FZSPinAnnotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnhubbard%2FZSPinAnnotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnhubbard","download_url":"https://codeload.github.com/nnhubbard/ZSPinAnnotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276022,"owners_count":20912285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:37.862Z","updated_at":"2025-04-05T01:30:35.754Z","avatar_url":"https://github.com/nnhubbard.png","language":"Objective-C","readme":"ZSPinAnnotation\n=============\n\nHave you ever felt limited by the three Annotation pin colors that Apple provides with MapKit? Have you ever thought it was a pain to have to create custom images in photoshop every time you wanted to change the color?  `ZSPinAnnotation` solves these problems by building the pin annotation on the fly and caching them for performance. All pin annotations use `CoreGraphics` to draw the pins so you get super sharp and beautiful annotations of any color.  `ZSPinAnnotation` is a `MKAnnotationView` subclass, so you can easily use it in your `mapView:viewForAnnotation:` method.\n\n![ZSPinAnnotation](http://f.cl.ly/items/1e3K2G3L380s082E2P2u/zspinannotation.png \"ZSPinAnnotation\")\n\nHow It Works\n---\n\nUse a ZSPinAnnotation on a MapView:\n\n```objective-c\n- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id \u003cMKAnnotation\u003e)annotation {\n\t\n    // Don't mess with user location\n\tif(![annotation isKindOfClass:[ZSAnnotation class]])\n        return nil;\n    \n    ZSAnnotation *a = (ZSAnnotation *)annotation;\n    static NSString *defaultPinID = @\"StandardIdentifier\";\n    \n    // Create the ZSPinAnnotation object and reuse it\n    ZSPinAnnotation *pinView = (ZSPinAnnotation *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];\n    if (pinView == nil){\n        pinView = [[ZSPinAnnotation alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID];\n    }\n    \n    // Set the type of pin to draw and the color\n    pinView.annotationType = ZSPinAnnotationTypeStandard;\n    pinView.annotationColor = a.color;\n    pinView.canShowCallout = YES;\n    \n    return pinView;\n\t\n}\n```\n\nHow to use in your App\n---\n`ZSPinAnnotation` requires the `QuartzCore.framework`, `CoreImage.framework` and `CoreGraphics.framework`.\n\nTake a look at the demo project in the download for an example of how to use `ZSPinAnnotation`.\n\nPin Types\n---\nZSPinAnnotation provides three different types of pin images: `ZSPinAnnotationTypeStandard`, `ZSPinAnnotationTypeDisc`, `ZSPinAnnotationTypeTag` and `ZSPinAnnotationTypeTagStroke`. The default is `ZSPinAnnotationTypeStandard` which defaults to the color `red`.\n\n![Annotation Types](http://cl.ly/image/3A1P0h2F1h39/types.png \"Annotation Types\")","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnhubbard%2FZSPinAnnotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnhubbard%2FZSPinAnnotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnhubbard%2FZSPinAnnotation/lists"}