Get latitude and longitube from city name - objective-c

I would like to enter the city name in the UISearchBar,then the map will jump to the current city.
How to do it?

You would need some kind of NSDictionary which would contain all of the city names with their map references (lat/long) maybe this could be integrated with google maps or some other mapping software. Otherwise you will need to attain or build the dictionary manually. Once you have the map reference you could scroll the map to the right location.

Related

Is there any way to change label names in Qlik Sense?

So I have a table with two columns: location name and coordinates.
I created a map visualization using the coordinates and, of course, the labels on the side menu are the coordinates (as you can see in the pic below).
Is there any way to change those labels, so that the corresponding location names appear instead of the coordinates?
Thanks for the help!
To get what you want add the Location Name to the map as a dimension (instead of the coordinates) and then under Location on that map layer select the Coordinates field (it will by default use the Location Name so change this).
If you want to simplify this you can use tags in your script to say that the Coordinates field is the location data for the Location Name. You can read more about that here, but for example:
TAG FIELD [LocationName] WITH '$geoname', '$relates_Coordinates';
TAG FIELD [Coordinates] WITH '$geopoint', '$relates_LocationName';
This should then mean that when you add LocationName to a map it will automatically know to use the Coordinates to plot the location rather than LocationName.

What's the proper way to let vb.net program to read a list?

For example, say I have a vb.net program and I want the program to be able to reference country codes. If I know the country name I wants to know the country code and via versa.
I can hardcode all the country in the program.
I can make the program read a text file
What would be the proper way?
I am thinking of something like string table in ios programming where instead of telling what a label should say you make a table and then the code reference that table. Something like resource file? Does vb.net have that?
It will be better if you will have the data in a file in your hard drive instead of "hardcoded" ,
it will be easier to change, add, replace, delete values , not mention if you will suddenly decide to move to another country ;)
I would make an enumeration list.
i.e.
Public Enum CountryCodes
Albania = 355
Algeria = 213
American Samoa= 684
End Enum
Find enum
Dim value As CountryCodes = CountryCodes.Algeria

How to set google static map font for city town label

I need to set small font size of google static map. So, what are the required parameters to achieve the same thing. Since, i am using the below url to get static map
http://maps.googleapis.com/maps/api/staticmap?center={$randAppPhoto['latitude']},{$randAppPhoto['longitude']}&scale=2&size=700x400&maptype=terrain&markers={$randAppPhoto['latitude']},{$randAppPhoto['longitude']}&zoom=7&format=jpg&sensor=false
where, $randAppPhoto is an array in php which has dynamic lat , long
I don't think it's possible to change the font for the texts on the maps. You can check a list of parameters for setting map styles here.
Changing scale=2 to scale=1 in the URL will make the street name font smaller, if that's what you're trying to do.

Remove substring before a specific char (NSString)

Basically I am getting a users city throughout Facebook Connect. The result is always in this format:
Sydney, Australia
But since there will be many users, the city and country can vary. Here is the format:
First the city with a comma, then a space and the country.
I only want to however retrieve the country name. Is it possible for me to locate the comma in string, then remove everything behind it. Then I can replaceOccurancesOfString:" " to remove the space.
I have seen other questions on this but they are in different languages. I am asking for Objective-C
Thanks!
one easy way to do it is to use - (NSArray *)componentsSeparatedByString:(NSString *)separator to make an array out of it, and then pick the second object of the array.

How to change Geo information to real name

Is there a way to convert Geo information to real place name? For example, I take a photo on "137-159 New Montgomery St San Francisco, CA 94105", the Geotagging information is :
geo:37.786971,-122.399677
when I type the geo in google map, it can show the place name to me. Does google provide API to get it? Thanks in advance.
Yes, the Google Maps API GeoCoder GClientGeocoder.getLocations() provides reverse geocoding as well:
The term geocoding generally refers to translating a human-readable address into a point on the map. The process of doing the converse, translating a point into a human-readable address, is known as reverse geocoding.
The GClientGeocoder.getLocations() method supports both standard and reverse geocoding. If you pass this method a GLatLng object instead of a String address, the geocoder will perform a reverse lookup and return a structured JSON object of the closest addressable location. Note that the closest addressable location may be some distance from the original latitude and longitude values of the query, if the supplied GLatLng is not an exact match for any addressable locations.