{"id":3986,"date":"2013-05-20T18:04:42","date_gmt":"2013-05-20T13:04:42","guid":{"rendered":"http:\/\/aasims.wordpress.com\/?p=3750"},"modified":"2025-05-08T10:31:24","modified_gmt":"2025-05-08T10:31:24","slug":"thumbnail-based-mapview-annotation","status":"publish","type":"post","link":"https:\/\/aasimnaseem.com\/blog\/thumbnail-based-mapview-annotation\/","title":{"rendered":"Thumbnail Based MapView Annotation"},"content":{"rendered":"<p style=\"text-align: left;\"><strong>JPSThumbnailAnnotation<\/strong> is an open-source library to customize your MapKit annotation view for displaying image thumbnails along with title and subtitle. \u00a0Here is a quick screenshot from my sample project using this library.<\/p>\n<p style=\"text-align: left;\"><strong>Setup<\/strong><\/p>\n<p style=\"text-align: left;\">Its free, and open source; You need to <a href=\"https:\/\/github.com\/jpsim\/JPSThumbnailAnnotation\" target=\"_blank\" rel=\"noopener\">download\u00a0JPSThumbnailAnnotation library from github<\/a>\u00a0and drag\/drop the directory into your project; You will have following six files in library;<\/p>\n<ol>\n<li>JPSThumbnail.h<\/li>\n<li>JPSThumbnailAnnotation.h<\/li>\n<li>JPSThumbnailAnnotation.m<\/li>\n<li>JPSThumbnailAnnotationView.h<\/li>\n<li>JPSThumbnailAnnotationView.m<\/li>\n<li>JPSThumnail.m<\/li>\n<\/ol>\n<p><strong>Usage<\/strong><\/p>\n<p>import JPSThumbnailAnnotation.h\u00a0and add the following line of code to add one annotation on your map view<\/p>\n<p>[code]<\/p>\n<p>JPSThumbnail *faisaMosqueAnnotation = [[JPSThumbnail alloc] init];<br \/>\nfaisaMosqueAnnotation.image = [UIImage imageNamed:@&quot;faisalMasjid.jpg&quot;];<br \/>\nfaisaMosqueAnnotation.title = kFaisalMasjidTitle;<br \/>\nfaisaMosqueAnnotation.subtitle = kFaisalMasjidSubTitle;<br \/>\nfaisaMosqueAnnotation.coordinate = CLLocationCoordinate2DMake(33.72976, 73.03698);<br \/>\nfaisaMosqueAnnotation.disclosureBlock = ^{ NSLog(@&quot;Faisal Mosque selected&quot;); };<br \/>\nJPSThumbnailAnnotation *annotation = [[JPSThumbnailAnnotation alloc] initWithThumbnail:faisaMosqueAnnotation];<br \/>\n[mapView addAnnotation:annotation];<\/p>\n<p>[\/code]<\/p>\n<p>You are good to go now .. You can <a href=\"https:\/\/dl.dropboxusercontent.com\/u\/37107813\/ThumbnailAnnotationExample.zip\" target=\"_blank\" rel=\"noopener\">download a sample project from here.<\/a><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/s04.flagcounter.com\/count\/VubL\/bg_FFFFFF\/txt_000000\/border_FFFFFF\/columns_6\/maxflags_250\/viewers_0\/labels_1\/pageviews_1\/flags_0\/\" alt=\"Flag Counter\" border=\"0\" \/><\/p>\n<p>Happy Programming .. (:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JPSThumbnailAnnotation is an open-source library to customize your MapKit annotation view for displaying image thumbnails along with title and subtitle. \u00a0Here is a quick screenshot from my sample project using this library. Setup Its free, and open source; You need to download\u00a0JPSThumbnailAnnotation library from github\u00a0and drag\/drop the directory into your&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4545,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[544,596,719],"class_list":["post-3986","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ios","tag-ios","tag-jpsthumbnailannotation","tag-mapkit"],"_links":{"self":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/3986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/comments?post=3986"}],"version-history":[{"count":3,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/3986\/revisions"}],"predecessor-version":[{"id":5306,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/3986\/revisions\/5306"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/media\/4545"}],"wp:attachment":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/media?parent=3986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/categories?post=3986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/tags?post=3986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}