Articles Tagged 'Services'

How to get Latitude and Longitude in Objective-C

The MapKit framework provides many useful features, except the return of Latitude and Longitude from an address. In JavaScript, for example, you can use the service provided by Google Geocoding and discussed in Google Maps: How to get Latitude and Longitude from an address . On Apple iPhone or iPad, however, you can overcome the obstacle by using a different Google services. Specifically, you can directly call the url:

1
http://maps.google.com/maps/geo?q = [address] & output = csv

Where is [indirizzo] to enter the string with the address you want to transform coordinates. The output returned is of type:

1
200,8,41.9128300,12.2241172

). The first value, 200 , indicates that everything went well ( 200 OK ). The second, 8 , is the Google accuracy parameter (1-10). The last two values ​​are, finally, latitude and longitude. Now we see a prototype of a method can be included in our applications:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CLLocationCoordinate2D ) getLocationFromAddress : ( NSString * ) address { - (CLLocationCoordinate2D) getLocationFromAddress: ( NSString *) address {
urlString = [ NSString stringWithFormat : @ "http://maps.google.com/maps/geo?q=%@&output=csv" , NSString * urlString = [ NSString stringWithFormat: @ "% @ http://maps.google.com/maps/geo?q = & output = csv"
NSUTF8StringEncoding ] ] ; [Address stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];

listItems = [ locationString componentsSeparatedByString : @ "," ] ; NSArray * ListItems = [locationString componentsSeparatedByString: @ ""];

/ / Int zoom = 0;
0.0 ; double latitude = 0.0;
0.0 ; double longitude = 0.0;

listItems count ] > = 4 && [ [ listItems objectAtIndex : 0 ] isEqualToString : @ "200" ] ) { if ([ListItems count]> = 4 && [[ListItems objectAtIndex: 0] isEqualToString: @ "200"]) {
/ / Zoom = [[ListItems objectAtIndex: 1] intValue];
listItems objectAtIndex : 2 ] doubleValue ] ; latitude = [[ListItems objectAtIndex: 2] doubleValue];
listItems objectAtIndex : 3 ] doubleValue ] ; longitude = [[ListItems objectAtIndex: 3] doubleValue];
{ Else {}
/ / Error
}
CLLocationCoordinate2D location;
location.latitude = latitude;
location.longitude = longitude;

return location;
}

Notes of Interest

, alla stregua della funzione explode ( ) del PHP per intenderci. The string returned in locationString is "splitted" by the method componentsSeparatedByString , like the function explode ( ) of PHP for instance. In the example I proposed I entered - but commented - the code to retrieve even the Google parameter accuracy, precision or scale factor, denoted by zoom .

Source as

For completeness, I made ​​a small example application with which you can try the method proposed above, enter any address and the iPhone will display on the map.


Download Source

I thank the team devAPP for the inspiration of this article.

More ...

Skypemote.com: say it with emotions

Skypemote

Open - in beta - Skypemote.com , a project born from an idea me and Nicola ( flussodigitale.com ), which provides a simple editor to create nice drawings from "paste" in Skype. The editor has been created in Adobe Flash CS3 and, weather permitting, would also release a version - Desktop - Adobe AIR.
If you use Skype to "chat" with this editor you can definitely impress your audience. If you find this service useful and fun, do not forget to help with suggestions, and - if you will - with some donations! :)
Follow the project because there will soon be more "sympathetic" news.

More ...

Lulu: publish and sell worldwide

Lulu Lulu is a free service via the Web that allows anyone to print and sell his book, and more. This service was reported to me long ago, but I got to see him just now. As indicated on the website, "The great merit of Lulu is to allow everyone, without distinction, to realize a dream." And that's it!
Surely we are facing another example of what is now the Internet allows you to do, removing those barriers and those impediments that were unthinkable a few years ago.

Lulu is fast, easy and free:

Publish and sell easily within minutes.
No entry fee. No minimum order.
Maintain control of copyright.
Set your price.
Each product is printed in the moment in which it is ordered.
No excess inventory.

You may publish, in addition, rigid and soft cover books, photo albums, calendars, DVDs, E-books, and more, all in a very simple and quick enough to register for free by your PC and send the material (in the case a book, for example, PDF, DOC or RTF). So if you have a dream here is your chance to propose to modno quickly and with minimal expense.

Recommended Reading: Parsec

More ...


Stop SOPA