Latest 0.1.1
Homepage https://github.com/ivan114/IVBezierPathRenderer
License MIT
Platforms ios 8.0
Authors

IVBezierPathRenderer

CI Status
Version
License
Platform

Introduction

MapKit framework provide us useful classes for drawing simple path in MKMapView.
However, those lines draw with MKPolylineRenderer are too plat and unstylized, and most importantly, no bezier path, which is not sufficient for my map application usage.
Therefore, IVBezierPathRenderer is created for more natural map path drawing.

Screenshots

Screenshots

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

IVBezierPathRenderer is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "IVBezierPathRenderer"

After installing the pod add the following import header to your source code

@import IVBezierPathRenderer;

Usage

IVBezierPathRenderer is easy to use. Just create your MKPolyline and MKPolylineRenderer as usual, then replace your MKPolylineRenderer object with IVBezierPathRenderer object. That is all need to be done.

Swift:

func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer {
    if let overlay = overlay as? MKPolyline{
        let renderer = IVBezierPathRenderer(overlay:overlay)
        renderer.strokeColor = UIColor.blueColor().colorWithAlphaComponent(0.5)
        renderer.lineWidth = 4
        //Optional Tension for curve, default: 4
        //renderer.tension = 2.5
        //Optional Border
        //renderer.borderColor = renderer.strokeColor
        //renderer.borderMultiplier = 1.5
        return renderer
    }
}

Objective-C:

-(MKOverlayRenderer*)mapView:(MKMapView*)mapView rendererForOverlay:(id<MKOverlay>) overlay{
     if([overlay isKindOfClass:[MKPolyline class]]){
        IVBezierPathRenderer *renderer = [[IVBezierPathRenderer alloc] initWithOverlay:overlay];
        renderer.strokeColor = [[UIColor blueColor] colorWithAlphaComponent:0.5f];
        renderer.lineWidth = 4;
        //Optional Tension for curve, default: 4
        //renderer.tension = 2.5;
        //Optional Border
        //renderer.borderColor = renderer.strokeColor;
        //renderer.borderMultiplier = 1.5;
        return renderer;
     }
 }

Author

Ivan Li, [email protected]

References

License

IVBezierPathRenderer is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "IVBezierPathRenderer",
    "version": "0.1.1",
    "summary": "Alternative Path Renderer for MapKit to render path with bezier curve.",
    "description": "MapKit framework provide us useful classes for drawing simple path in MKMapView. nHowever, those lines draw with MKPolylineRenderer are too plat and unstylized, and most importantly, no bezier path, which is not sufficient for my map application usage. nTherefore, IVBezierPathRenderer is created for more natural map path drawing.",
    "homepage": "https://github.com/ivan114/IVBezierPathRenderer",
    "screenshots": "http://cl.ly/gTB7/IVBezierPathRendererScreenshots.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ivan Li": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ivan114/IVBezierPathRenderer.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "IVBezierPathRenderer/Classes/**/*"
}

Pin It on Pinterest

Share This