How do you get all the businesses within 10 miles of my location in Swift using corelocation? - swift

I want to get all the businesses within 10 miles of my location in Swift. I tried using the geocoder from CoreLocation and GoogleMaps and it gives me random places but I just want to see all the businesses near my location. Is that possible or do I have to cut my search to restaurants, cafe, etc.?

you can use this google api for getting nearby businesses
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=1500&type=restaurant&keyword=cruise&key=YOUR_API_KEY
also you can see all available keywords from
https://developers.google.com/places/web-service/supported_types
for using multiple keywords simultaneously
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=1500&type=atm%7Chospital&key=YOUR_API_KEY
add keywords seperated by %7C

Related

Sort by distance in Nominatim API

I have developed a flutter application which uses Nominatim API for searching on a map in OpenStreetMap. I have successfully implemented the search however I want the search to prioritise locations near the location that the user is currently viewing.
For Example: If the user is hovering over California, and searches for Hospitals, it should give results on hospitals near me. Currently, it gives locations that are in some other country based on their own importance settings.
Could anybody help me how to do that?
EDIT: I want the results to be "sorted by distance" and not "limit search to nearby locations".

Forms with maps feature that allows users to set their location

I am looking for a online app or code to embed that allows a user to set a certain location on a map.
What we need is a form in which a user inputs its name, address, email and his favorite location which can be a certain point in a town, a point of interest or an arbitrary place in the woods. We would like to see the map selection as well or the GPS coordinates of his selection.
We thought about Google Maps but did not figure a way to achieve this.
Do you have an idea how we can achieve this?
Thanks!
I found something that is usable:
Google Maps API Reverse Geocoding

Google Maps API: Requesting any place labels given longitude and latitude?

I am working on an iPhone map application and wanted to know whether it was possible to request any labels visible on Google Maps given a longitude/latitude and radius?
For example if I gave the following location to this Google Maps API, I would get back McCullough Hall, Moore Hall, etc. The list would be any place labels visible on the map (doesn't have to be just restaurants, businesses).
If this is possible can you direct me to where I can learn more about this. If this isn't possible, can you direct me towards another API where it is possible?
Look into Googles reverse geocoding, I think that's what you're looking for.
The short answer, you cannot!.
The only way is to search for places by name and get a reference key to query the place details including lat/lng. Not the other way around.
IMHO, this is mainly a policy of Google instead of being technical limitation.

How to access to the Search functionality to get the map annotations similary to Maps IPhone application?

I need to use in my application the search functionality used in the Maps IPhone application.
The application user should be able to search locations by a commercial name and then to select one of the annotations (pins) proposed on the map.
Is this function available to use easily?
This functionality is not available in MKMapView
But i will give you a suggestion
Keep a TextField and accept the user search name from that. Then by using google API get the details about the searched location
http://maps.google.com/maps/geo?q=yourSearchName&output=xml
This will return all location information with latitude longitude, Parse those details.
I think Parsing will not be much complicated.
Use Annotations to pinpoint in the map with the latitude and longitude values you got from parsing.

Displaying nearby businesses in mapkit

Is it possible to display nearby businesses in mapkit? If not, how else can that be done?
Is there a way to display by category - restaurant, retail, museums?
Also, I don't think displaying traffic flow is available. Can anyone confirm?
The current version of MapKit does not support such features.
It's main capabilities currently are:
a scrollable/zoomable map
reverse geocoding (get the address for some given lat/long coordinates)
add annotations (pins) at a given lat/long
show phone's current location
show Standard, Satellite, or Hybrid view
To display nearby businesses, you would have to:
query a third-party for that information which would ideally return lat/long coordinates
add annotations to the map using the returned coordinates
This is an interesting and emerging business idea!
I live in Nordic region and there is an open Mashups especially for sweden.
By open i mean, any one can request and get access to the content to find nearby Cafe / WiFi / Sushi restaurants etc..
BEGIN PLUG WARNING
Check my iphone application which fetches content from the mashups and display using MapKit!
END PLUG WARNING
And there is a commercial content provider called Info24 for nordic countries at the moment.
Like DyingCactus said, it's not currently possible without using your own calls to one of the mapping service providers. There are options available, though.
One of them is CloudMade. They have a good iPhone library and support almost all of your requirements.
Check out the API at Cloudmade.com
I know this thread is kind of old, but i figured out a free alternative to do what you are looking for, more or less. You just nee to tap into a maps.google.com service and get a kml or JSON output. I used KML (XML) becuase i found the filesize to be consistently smaller. I wrote a 3 part series on my blog about how to do this for anyone that is interested.
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-1/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-2/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-3/