{"id":9,"date":"2008-09-08T21:37:26","date_gmt":"2008-09-09T02:37:26","guid":{"rendered":"http:\/\/developer.casgrain.com\/?p=9"},"modified":"2009-05-18T11:52:56","modified_gmt":"2009-05-18T16:52:56","slug":"desktop-core-location","status":"publish","type":"post","link":"https:\/\/developer.casgrain.com\/?p=9","title":{"rendered":"Desktop Core Location"},"content":{"rendered":"<p><em>Update 18\/Feb\/09 @ 19:45 EST: Source code is on BitBucket.org:<\/em><\/p>\n<pre>\nhg clone http:\/\/bitbucket.org\/philippec\/desktopcorelocation\n<\/pre>\n<p>\n<em>Update 5\/Feb\/09 @ 12:43 EST: It appears that Apple <a href=\"http:\/\/www.appleinsider.com\/articles\/09\/02\/05\/apples_snow_leopard_to_include_location_multi_touch_tools.html\">may implement CoreLocation in their next generation desktop OS<\/a>. Excellent!.<\/em><\/p>\n<p><p>\n<em>Update 8\/Sep\/08 @ 22:40 EST: The license is MIT. Share and enjoy!.<\/em><\/p>\n<p>\n<em>Update 8\/Sep\/08 @ 21:45 EST: This is an IronCoder entry, and is essentially a hack. I&#8217;m working on figuring out a license.<\/em><\/p>\n<p><h3>My IronCoder entry for c4[2]: a clean-room implementation of Apple&#8217;s CoreLocation.framework, complete with sample application.<br \/>\n<\/h3>\n<p><a href=\"http:\/\/developer.casgrain.com\/files\/DesktopCoreLocation.zip\">http:\/\/developer.casgrain.com\/files\/DesktopCoreLocation.zip<\/a><\/p>\n<h4>Description<\/h4>\n<p>\nThis is a clean-room implementation of Apple&#8217;s CoreLocation framework that is part of the iPhone SDK.<\/p>\n<p>\nIt uses Apple&#8217;s own headers, which are installed when you install the iPhone SDK, as the interface, and implements all the functionality of CoreLocation in an embeddable framework.<\/p>\n<p>\nIt can be made a system-wide framework buy changing its executable path from <code>@loader_path\/..\/Frameworks\/<\/code> to <code>\/Library\/Frameworks<\/code>.<\/p>\n<p>\nThe Desktop and Phone sample applications are very similar: they both demonstrate using CoreLocation.framework.<\/p>\n<h4>How it works<\/h4>\n<p>The framework figures out your current, internet-facing IP address using <a href=\"http:\/\/whatismyip.com\/\">whatismyip.com<\/a>. It then uses basic <a href=\"http:\/\/www.maxmind.com\/app\/locate_my_ip\">IP Geolocation<\/a> web services to extract latitude and longitude. Results are cached 30 days for each IP address.<\/p>\n<p>\nThere are certainly other IP geolocation services (for instance, SkyHook Wireless) but they required a paid license.<\/p>\n<h4>Parano&iuml;a<\/h4>\n<p>In keeping with the theme, you can drop a file called <code>unauthorizedApps<\/code> in <code>\/Library\/Documents\/WebServer\/clbl\/<\/code> and start your webserver. You can then edit the file at will to deny a particular app the use of CoreLocation.<\/p>\n<h4>Contents<\/h4>\n<blockquote>\n<dl>\n<dt>PhoneLocation\/PhoneLocation.xcodeproj<\/dt>\n<dd>Sample application that demonstrates using CoreLocation on the iPhone\/iPod Touch.<br \/>\nBuild and go, it will find your current location (which, in the Simulator, is 1, Infinite Loop, Cupertino, CA). Press the &#8220;Show Me&#8221; button to go to these coordinates in Google Maps.<\/dd>\n<p><dt>DesktopLocation\/DesktopLocation.xcodeproj<\/dt>\n<dd>Sample application that demonstrates using CoreLocation on the Desktop. It uses the Desktop CoreLocation framework in exactly the same manner as PhoneLocation, but the results are pulled from my version of the framework.<br \/>\nPress the &#8220;Show Me&#8221; button to go to these coordinates in Google Maps.<\/dd>\n<p><dt>CoreLocation\/CoreLocation.xcodeproj<\/dt>\n<dd>Stand-alone, embeddable framework<\/dd>\n<\/dl>\n<\/blockquote>\n<h4>Requirements<\/h4>\n<ul>\n<li>MacOSX 10.5<\/li>\n<li>Latest iPhone SDK. <strong>Does not contain any Apple proprietary information.<\/strong><\/li>\n<li>Internet connexion<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Update 18\/Feb\/09 @ 19:45 EST: Source code is on BitBucket.org: hg clone http:\/\/bitbucket.org\/philippec\/desktopcorelocation Update 5\/Feb\/09 @ 12:43 EST: It appears that Apple may implement CoreLocation in their next generation desktop OS. Excellent!. Update 8\/Sep\/08 @ 22:40 EST: The license is MIT. Share and enjoy!. Update 8\/Sep\/08 @ 21:45 EST: This is an IronCoder entry, and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,5],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-development","category-macosx"],"_links":{"self":[{"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":2,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}