Open levogirar opened 3 years ago
What should be developed in this issue is:
I suppose this is what should be done in this case @levogirar
@kakaye-mkubwa it looks good. One question:
"geometry" : {
"location" : {
"lat" : -33.866651,
"lng" : 151.195827
},
"viewport" : {
"northeast" : {
"lat" : -33.8653881697085,
"lng" : 151.1969739802915
},
"southwest" : {
"lat" : -33.86808613029149,
"lng" : 151.1942760197085
}
}
},
but I am only interested in the "location" latitude
and longitude
.
I can create indepedent lat and long columns in the GooglePlace
table instead of creating geometry
table
Great! I prefer this.
Problem
Currently, we have very little information in our website. A easy way to add more data is through Google.
Solution
I propose to use the Google Place API. Google Cloud allow for $200 monthly free API calls, and for Place Details, it is $17 per 1000 calls. We should make the call, then store the result in our database.
How will it work?
When we create a new company, there will be a field to write manually the Place ID. The following tool can help us find the Place ID for any company, Place ID Finder. In the future, we could look for a way to make this automatic (see Place Searches).
In the
company database
, we can add a new field calledGoogle Place
. Here, we store the following:From all these, we can create the following:
NB: we will use LEAFLET.JS and OPEN STREET MAP to create the map.
FAQ
1. How often do we update the information? In order to save on cost, we should do it once a week. This type of information seldom changes (except for the reviews). 2. What happens if we do not have the company Place ID? I think we should use a conditional to display the component. If the field is empty, do not show the
Google Maps
component.