I created a web view to open google maps. I got no problems getting the location by CLLocationManager. However, I need to specify a query string like this: "hospital loc: [latitude], [longitude]" to put in the search box to locate the nearest hospitals. How can I implement this after I load "maps.google.com" in my web view?
Try this :
http://maps.google.com/?q=hospital+loc:+[latitude],+[longitude]
Notes :
Obviously replace with your desired latitude, longitude coordinates
Remember to properly encode the parameter passed to q=
Related
I have a city place ID, but I need to get latitude and longitude from it.
My method was to let the user search for a place name, hit the API to get a list of suggestions, and when the user selects a single choice, hit the API again to get latitude and longitude.
I can get the place ID, but I can't find anywhere in the API to grab the longitude and latitude from it.
Developing for iOS, if that matters.
You need to call the lookupPlaceId method of GMSPlacesClient. See Get Place By Id for more details.
I've got the GPS coordinates of a place and want to query the GoogleMaps SDK for the Place ID in order to get more information about a place.
I looked up the documentation https://developers.google.com/places/place-id. But yet didn't found a way on 'easily' get the Place ID like:
let placeId = GMSService.getPlaceIdFromCoordinates(longitude: 02.52324, latitude: 03.5345)
The iOS documentation for Maps and Places API doesn't list GMSService, the only class resembling is is GMSServices which doesn't have the getPlaceIdFromCoordinates.
You can look at the Place IDs and Details of the Places API documentation. PlaceID can be retrieved from the GMSPlace object.
To actually search for places (whether through text or coordinates) you can try out the Place Autocomplete page of the documentation.
I'm trying to use Apple's CLGeocoder to search for a place based on a string and get the latitude/longitude of it. I'm using an instant feedback system, so as you type the address in, suggestions are made beneath the search field from which a selection can be made from, using this function:
(void)geocodeAddressString:(NSString *)addressString completionHandler:(CLGeocodeCompletionHandler)completionHandler
however, it seems to search for each space-separated token in its exact form as opposed to as a part of another word. For example, if I search for 'Lond', I get "Lond, Sheopur, Madhya Pradesh, India" instead of "London".
How can I make CLGeocoder work with partial place names and return 'London' for the string 'Lond'?
Thanks,
I'm new to Core Location, I want to know how to get the list of location like in iPhoto when we share photo to Facebook.
For example :
User type in "New York", and then click "Search"
The tableview will show a list of location with that name. It will also present the geotag information.
Thanks!
It turns out that Facebook does not have "Location", what it does have is "Place", kind of a 'check-in'.
But, we're not able to create the Place object programmatically, we're only able to lookup of a place based on the Latitude & longitude.
And fortunately, Apple already provided CLGeocoder to lookup for location and its Lat & Long, and from this I can supply Facebook's Place's Lat & long.
Twitter provides an API for getting a place object for any given location. As per twitter API documentation at https://dev.twitter.com/docs/api/1/get/geo/search :
"Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status.".
API returns a place object. I am specifically interested in getting the bounding coordinates for that place which can be a Point or a polygon which is included in place object. I will then use this to check if user's location lies within some other location say New York.
Now, for any user one can fetch his profile using twitter API. API returns a json object which contains user's location which is basically a string e.g, "San Francisco, CA". This location can be passed to geo search api mentioned above to get coordinates for the polygon which defines a user's location.
I am using twitter4j library to do the same. Method 'searchPlaces()' corresponds to
/geo/search API of twitter and takes a GeoQuery object as argument. However, GeoQuery object has only two constructors which take GeoLocation i.e, latitude, longitude information or ip address.
https://github.com/twitter/twitter4j/blob/master/twitter4j-core/src/main/java/twitter4j/GeoQuery.java
As can be seen in GET geo/search API, all parameters all optional. However, providing only two constructors in GeoQuery class forces one to provide either latitude and longitude values or ipaddress. What I have instead is the string for user's location from his profile.
Can someone please help me out with why there is this disparity between twitter4j and twitter API. Also, can someone suggest some other way to find if some twitter user is from New York.
PS: Any attempt to geocode user's location to get lat,long also requires GeoQuery object which again needs lat, long and I don't seem to be able to figure out how this can be done too.
Thanks in Advance.
I encountered this as well. A workaround is:
GeoQuery geo = new GeoQuery((String)null);
geo.setQuery("New York")