• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Geographic Location drag type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Geographic Location drag type


  • Subject: Re: Geographic Location drag type
  • From: William Bates <email@hidden>
  • Date: Fri, 13 Jun 2008 07:51:06 -0500

Here's what I've decided to use. I put two flavors on the pasteboard:

com.knowledgeengineering.ISO6709.string
a UTF8 string conforming to ISO6709

com.knowledgeengineering.ISO6709.dictionary
a CFDictionary containting 3 CFNumbers of type double (kCFNumberDoubleType) with keys: latitude, longitude, altitude


(2) Aside from internal use in my app, I put the parser code into my apps' stand-alone .service thingy; configured its plist so it is a filter service (see the Pasteboard Peeker read-me). So now _any_ string flowing thru Services that conforms to ISO6709 syntax will get parsed and the little Geo dictionary added to the drag. It's pretty nice to highlight some text containing lat/long on a web page, choose the services menu item, and pop up a Google map of the location.

Objective C 2.0 example:
if dict is a NSDictionary* obtained from the pasteboard, and myLocation is a Cocoa object of class CLLocation,
myLocation.coordinate.latitude = [dict valueForKey:@"latitude"];
myLocation.coordinate.longitude = [dict valueForKey:@"longitude"];
myLocation.altitude = [dict valueForKey:@"altitude"];


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Have questions...
  • Next by Date: Custom mouse cursor in NSTextView
  • Previous by thread: Re: Control USB Power
  • Next by thread: Custom mouse cursor in NSTextView
  • Index(es):
    • Date
    • Thread