Simplification is the key
Although I understand your goal (to get a list of all the hotels near you), I believe that your explanation has thrown many people into fear. You donβt need to triangulate positions and calculate circle radius - not with the API and Google Maps services.
All you need to know is that you need a solution for front-end, internal, or mobile devices.
Google Maps Website API Web Service (back-end)
The Places API has a very useful feature called "Nearby Places." To quote the documentation for this feature:
A neighborhood search allows you to search for places within a specific area. You can refine your search query by providing keywords or by specifying the type of place you are looking for.
What looks exactly the way you need it, right?
To make a request from the server to the Places API web service by looking for nearby places, you can do the following:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&type=restaurant&name=cruise&key=YOUR_API_KEY
Remember to change key=YOUR_API_KEY to a valid key field. The above example will look for restaurants within a radius of 500 meters around the place -33.8670522,151.1957362.
There are many options for this, and you can read more about this in the following documentation.
https://developers.google.com/places/web-service/search
JavaScript Maps API with Place Library (front-end)
If you, however, do not have a central server or service to make requests for you, as clients also send requests directly, this is also an option.
In this case, there is a JavaScript API. The JavaScript API is a friendly client API that reuses some features of a web service.
In this case, you can use the JavaScript API in conjunction with the Place Library for it. According to the documentation, this API allows you to perform "Surrounding Search Requests":
Neighborhood Search allows you to search for places in a specified area with a keyword or type
An example of such a request can be seen in a live example in the following link https://developers.google.com/maps/documentation/javascript/examples/place-search
You can read more about the parameters and use of this API and this library in the following documentation https://developers.google.com/maps/documentation/javascript/places#place_search_requests
Google Maps API for Android (Mobile)
From the photo you added, I assume that your application will βuse on the goβ (possibly a mobile application) or something similar.
In this case, using a web server or website can be cumbersome, because by the time you have an answer from it, the car is already in a different position!
To help you with this, there is also an Android API. To use it, you need:
- Download and install Android Studio
- Add Google Play Services Package (contains the APIs you will use)
You can read more about this process here https://developers.google.com/maps/documentation/android-api/start
Regarding code and examples, I highly recommend that you check out this GitHub sample repository https://github.com/googlemaps/android-samples
Our hotels may not appear on Google Maps
If your DeLorean doesn't return you to the second half of the 19th century, or you are stuck on an island with hundreds of Meerkats, poisonous pools and a tiger wondering if you should eat you or not, Google Maps will show you a lot of hotels where you can spend the night.
PS: kudos ++ if someone gets my links: P
Adding Hotels and Places to Google Maps APIs and Services
If this is still not enough, there is still a way to fix it. You can add hotel addresses and locations to Google Maps using one of the following methods:
- Post a review
- Use Maps Maker
Post a review
The Send Feedback feature allows you to send reviews to Google data groups for viewing. Once approved, the data is added to the Google database and will be available to all Google customers. You can do this by following the steps described here https://support.google.com/maps/answer/3094045?co=GENIE.Platform%3DDesktop&hl=en
Please note that the process of reviewing your feedback will take some time, so do not expect anything instant!
Use Maps Maker
Alternatively, you can use Maps Maker . This tool allows you to make changes and add information to our services in a more streamlined way.
At first, your changes and suggestions will still be validated, and it usually takes less than two weeks to get something approved.
However, over time, as you claim more and more that you are approved, you gain a reputation, and when you have a lot of reputation, your offers will be largely automatically added.
Before using it, make sure that you look in the list of supported countries .
In addition, if the language is important, you can also consider it by checking the list of supported languages .
I really don't want to add anything to Google Maps
Sometimes the whole business is the information itself, so providing it freely is not an option.
In these cases, you will have your own database, which your services will need to check.
In cases like this, an individual solution is required for your system, but additional information is required in order to propose a few ideas.
Hope this helps!