Code Monkey home page Code Monkey logo

kml.swift's Introduction

KML.swift

CocoaPods GitHub license

Simple KML parser for Swift.

capture

Libraries

Supporting TAGs

  • Style
  • StyleMap
  • PolyStyle
  • LineStyle
  • MultiGeometry
  • Polygon
  • LineString
  • Point
  • Folder
  • Placemark

License

MIT

kml.swift's People

Contributors

asus4 avatar elikohen avatar joelgerborelaser avatar maxbritto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kml.swift's Issues

Any Support for adding <NetworkLink><Link><href><GroundOverlay> to cover image

I can read the data from KML file now and its showing current coordinate like i provided.But,I can't show the image using groundOverlay on Map?Any Help? Or did I do something wrong?

Here is the project source : https://www.dropbox.com/s/pak5ti45e9th91f/Kml.swift-master%202.zip?dl=0

Here is the extract of kmz : https://www.dropbox.com/s/fjfbgj4kea4pxps/My%20Whole%20Region%202.zip?dl=0

Thanks for delivering such a great support parsing library for kml.

Podspec

It'd be great if you published to Cocoapods

Render icon

Hi! Thank you for this library. Could you plan to add icon support for placemarks?

innerBoundaryIs Polygon support

Hi,

It's a nice work but is it possible to support the "innerBoundaryIs Polygon" on kml file? It isn't seem to work when i render a map.

AEXML

I keep getting this error which I cant understand, could you possibly assist?

Kml.swift-master/Source/KML.swift:401:33: Type 'AEXMLElement' has no member 'errorElementName'

Cheers,
Damien K

Importing KML from Google Earth Web Causes Crash

Looking at a KML that was generated from the web version of google earth I see the following tag that causes a crash in the style parsing:

<name>Google Earth Web KML FILE web</name>
	<gx:CascadingStyle kml:id="__managed_style_0318E6AFC5265754105B">
		<Style>
			<IconStyle>
				<scale>1.2</scale>
				<Icon>
					<href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&amp;id=2000&amp;scale=4</href>
				</Icon>
				<hotSpot x="64" y="128" xunits="pixels" yunits="insetPixels"/>
			</IconStyle>
			<LabelStyle>
			</LabelStyle>
			<LineStyle>
				<color>ff2dc0fb</color>
				<width>4.8</width>
			</LineStyle>
			<PolyStyle>
				<color>40ffffff</color>
			</PolyStyle>
			<BalloonStyle>
				<displayMode>hide</displayMode>
			</BalloonStyle>
		</Style>
	</gx:CascadingStyle>
	<gx:CascadingStyle kml:id="__managed_style_1B1AB55863265754105A">
		<Style>
			<IconStyle>
				<Icon>
					<href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&amp;id=2000&amp;scale=4</href>
				</Icon>
				<hotSpot x="64" y="128" xunits="pixels" yunits="insetPixels"/>
			</IconStyle>
			<LabelStyle>
			</LabelStyle>
			<LineStyle>
				<color>ff2dc0fb</color>
				<width>3.2</width>
			</LineStyle>
			<PolyStyle>
				<color>40ffffff</color>
			</PolyStyle>
			<BalloonStyle>
				<displayMode>hide</displayMode>
			</BalloonStyle>
		</Style>
	</gx:CascadingStyle>
	<StyleMap id="__managed_style_01024CD06B265754105A">
		<Pair>
			<key>normal</key>
			<styleUrl>#__managed_style_1B1AB55863265754105A</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#__managed_style_0318E6AFC5265754105B</styleUrl>
		</Pair>
	</StyleMap>

Crash on String.subString

I think this goes without sayng, but this library is awesome! Thanks for creating it. One issue I'm getting though is a crash inside of KML.swift for some KML files:

private extension String { func subString(_ from: Int) -> String { return self.substring(from: self.characters.index(self.startIndex, offsetBy: from)) }

The crash is due to the method not handling when a String has no characters in it. If I use something like this, this issue is resolved:

private extension String { func subString(_ from: Int) -> String { if 0 < self.characters.count { return self.substring(from: self.characters.index(self.startIndex, offsetBy: from)) } else { return "" } } }

(Sorry about the formatting of this code above, but I'm unfamiliar with how to make it prettier.)

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.