The framework provides MapKit many useful features, except the return of Longitude and Latitude 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 . Apple iPhone or iPad, however, you can overcome this obstacle by using a different Google services. Specifically, you can call directly to 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 , Google is the 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 ] ] ; [StringByAddingPercentEscapesUsingEncoding address: 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 "split" by the method componentsSeparatedByString , like the function explode ( ) in PHP for instance. I put the example I proposed - but commented - the code to retrieve even the Google accuracy parameter, 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 show on the map.


Download Source
I thank the team devAPP for the inspiration of this article.
Continued ...
She was released the beta 0.6 component UMAP for Flash CS3 (Actionscript 3.0) - is also present in the package version for Flex. Among the news we see the adoption of OpenStreetMap as the default provider. Also added was an advanced manager Marker and a series of various optimizations.
Continued ...
Google has APIs - Javascript - to put its maps in any web site . vied how to accomplish the same thing with Flash!
We start from a free component, UMAP (Universal ActionScript 3.0 Mapping API - Integrated with Google Maps), developed by AFComponents , a vertically organized companies of components for Flash / Flex really interesting and affordable. On the site, where you need to register to take advantage of free downloads, there are also versions of UMAP for ActionScript 2.0: MAP G Ver.2.6.1 . In this case we will analyze the version 0.4 Beta UMAP for ActionScript 3.0 (inside the package there is also a Flex component). That we're going to see is - obviously - a beta version and lacks, therefore, some features in version for Actionscript 2.0 ( G Ver.2.6.1 MAP ). However, watchman at the future, it seems more interesting to focus attention on this release, I tried both and, despite the release of more complete for Actionscript 2.0, Actionscript 3.0 beta version is considerably more powerful.
Continued ...
Reinvigorate the Web service dedicated to statistics, has added a new report on the hourly distribution of traffic on the tab 'Traffic'. This new feature can add more than 700 hours of traffic, giving an interesting insight TREND time of visits and page views, inter-quartile range (IQR) range.
Really interesting is the second new concerns that the old hostname / IP address that is now replaced with a report Geolocate the tab 'Visitor Detail', not bad at all (uses Google Map).
In addition, this new view can display the names of visitors who have a resolvable address, all integrated with the characteristic of the name tags Reinvigorate , so as to show, in practice, some visitors by name!
Continued ...
We often talked about the use of the Web Application (Web2.0) and how the software market is moving to online applications typically installed on our machine. Last important signal by Adobe (see Net Software ) that wants to release - or is starting to drop - a set of software online.
Today I propose to you a really great tool, Weebly , which aims to create a website online, complete with domain (tuoweb. weebly.com) and tools for editing really interesting. See the video demo below.
The idea, of course, is not new, but the approach Weebly clearly shows why short-must have Adobe Photoshop online will really be a step forward. In addition to ease of use this service offers interesting editing tools such as RSS readers, inclusion of Google Maps, Video input (from various sources) and more. The use of Ajax and DHTML (Dynamic HTML) is really used for, which makes the job of editing really easy and affordable for everyone.
The interesting point, in my opinion, is that when you insert an image you can turn a small editor for daily operations as diverse as Crop - crop - and Resize - resize.
We just rolled out a couple of new features: You can now Edit, Crop, Resize, Adjust and Enhance your pictures in the new integrated image editor Snipshot, we'll present a warning (but allow you to continue) if you are using an unsupported browser, we released some small updates to the themes, and a couple other small changes & fixes.
The fundamental issue lies here. A short tools like Weebly can use image editor like Adobe Photoshop, which will make the business of Web Design Online editing of the traditional.
Obviously this is only part of what might happen; editor Video, Audio and Text are the next to enter advanced forcefully online!
Continued ...
Web 2.0 also means software distributed through APIs (application programming interface). The ability to use features and remote functionality is extremely useful elsewhere in reality as the Internet. In addition to Yahoo, with its style Toolkit 2.0, Google - in the context of geo-referencing - offers its free tools, in this case for the handling and management of maps.
Google Maps API allows you to insert Google Maps into their web pages using JavaScript.
Continued ...
Latest Comments
datrix : Thank you very much!
Robert : I rispsoto your questions with pleasure. The idea is really great. I am looking for a solution ...
Sting : @ Darius - you can see an example here: http://www.fight4fun.it/ clicking on: MAPS I hope ...
vik : Giustappunto I'm working on a project and the client asked me to show all the news (which are CPT) in ...
Giovambattista Fazioli : @ paso: absolutely. Simply identifying the field [cci] input [/ cci] you want to ...