Latest 0.1.2
Homepage https://github.com/nickolanack/objc-kml-saxparser
License MIT
Platforms ios 7.0, requires ARC
Authors

An ultra simple SAX kml parser – great for large kml files

CI Status
Version
License
Platform

Usage

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

Blocks Methos

#import "Kml.h"

//...

-(void) someKmlIntializer:(NSString *) kmlText{

NSString *[email protected]"<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http:/www.opengis.net/kml/2.2"><Placemark><name>Descriptive HTML</name><visibility>1</visibility><description><![CDATA[]]></description><Point><coordinates>-122.0822035425683,37.42228990140251,0</coordinates></Point></Placemark></kml>‚Äč";

    Kml *kml =[[Kml alloc] initWithKmlString:kmlString];

    [kml onPlacemark:^(NSDictionary *dictionary) {

        //NSLog(@"%@", dictionary);

    }];

    [kml parse];

}

Delegate Method


#SomeViewController.h 

...
#import "SaxKmlParserDelegate.h"
@interface SomeViewController : UIViewController<SaxKmlParserDelegate, ...>
...

#SomeViewController.m

...

-(void) someKmlIntializer:(NSString *) kmlText{

     [[[SaxKmlParser alloc] initWithDelegate:self] parseString:kmlText];

}
-(void) onKmlPlacemark:(NSDictionary *)dictionary{
    //TODO add to MKMap
}
-(void) onKmlGroundOverlay:(NSDictionary *)dictionary{
    //TODO add to MKMap
}
-(void) onKmlPolyline:(NSDictionary *)dictionary{
    //TODO add to MKMap
}
-(void) onKmlPolygon:(NSDictionary *)dictionary{
    //TODO add to MKMap
}
...

Requirements

Installation

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

pod "KMLSaxParser"

Author

nickolanack, [email protected]

License

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

Latest podspec

{
    "name": "KMLSaxParser",
    "version": "0.1.2",
    "summary": "A kml (sax) parser for Objc.",
    "description": "A library to parse and return spatial features from kml files",
    "homepage": "https://github.com/nickolanack/objc-kml-saxparser",
    "license": "MIT",
    "authors": {
        "nickolanack": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nickolanack/objc-kml-saxparser.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "KMLSaxParser": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This