Giter VIP home page Giter VIP logo

arclusteredmapview's Introduction

ARClusteredMapView

Purpose

Originally developed for Foodish, ARClusteredMapView serves as a drop-in replacement for MKMapView, providing animated clustering of MKAnnotationViews.

I have decided to share this class here since it provides decent functionality in Foodish and was a fitting ingredient in my talk on MapKit at AltTechTalks Berlin on December 11th, 2013.

Since I'm giving a talk on MapKit at NSConference 2014, I have decided to add more functionality to ARClusteredMapView and share it with the world.

Bug reports and/or pull requests welcome.

Usage

  • Start using the ARClusteredMapView class as a replacement for the MKMapView instance you would like to have clustering support for.
  • Make sure that any annotations you add to the view inherit from the ARClusteredAnnotation class, which provides support for managing annotation ownership.
  • Whenever appropriate (i.e. in -mapView:regionDidChangeAnimated:), call ARClusteredMapView's -updateClustering method.
  • In your MKMapViewDelegate implementation, make sure you call -animateAnnotationViews: (supplied with an NSArray of annotation views) to make sure that newly inserted MKAnnotationView instances animate correctly.
  • If you use custom MKAnnotationView subclasses, make sure to set ARClusteredMapView's annotationViewSize and annotationViewAnchorPoint properties to appropriate values. This will make sure that annotation views don't obscure one another and will be properly clustered at all times.

Todo

While ARClusteredMapView has recently been upgraded to use ARC, I'm sure it still has some other bugs which don't manifest in Foodish and/or the examples in my talks and I hope to eliminate these with some help from the community. When those conditions have been met, I will create a podspec and submit the app to CocoaPods.

Scope

I have recently upgraded the project and set its restrictions to a deployment target of >= iOS 7.0, which I've only tested using Xcode 5 so far. It has originally been developed to work with iOS versions as low as 4.2, so it should work with older versions with just minimal amounts of retrofitting.

arclusteredmapview's People

Contributors

alexrepty avatar

Watchers

 avatar

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.