We are building a project that is based on java ee. In my part I made a map that is written in javascript. They want me to integrate my map to their code. By integrating, they want me to retrieve all data from their server. They said what if google closes its service. You should retrieve your data from our server. But I couldn't exactly understand what I'm going to do. That's why I'm asking in here. This is what I have done so far in order to clarify things.
Asked
Active
Viewed 247 times
1 Answers
0
I think they mean you should query the Google api from your backend and store the results in RDBMS. Then in your front end read from your database and display it.

strash
- 1,291
- 2
- 15
- 29
-
Thanks. Can you give me any link of tutorial or stackoverflow entries? If possible. – Mert AKEL May 04 '17 at 06:35
-
yep yep I will find you one. You must choose the db type. Are you familiar with sql databases or nosql databases? dont you have any on your system? – strash May 04 '17 at 06:51
-
for now you have only a javascript front end that is querying the google apis and returning json responses- and you display them directly to your page – strash May 04 '17 at 06:52
-
so now instead of displaying them you should write them to the database – strash May 04 '17 at 06:52
-
the thing you are trying to make will not be easy if you dont have a database in your project for now. Take a look at this thread: http://stackoverflow.com/questions/8412505/send-data-from-javascript-to-a-mysql-database – strash May 04 '17 at 06:54
-
the best design for your app is: front end only query Your database through rest calls for displaying the records from the database. Your backend should use RestTemplate (java) to query google services and write in the database. That way you are implementing server to server calls and your front end will be fast as young horse. – strash May 04 '17 at 06:57
-
You helped me a lot !. Thank you so much. We have a database in our project. I will work on what you said. – Mert AKEL May 04 '17 at 06:59
-
I can not rate because my reputation is less than 15 :D Thanks again. – Mert AKEL May 04 '17 at 10:41
-
Hi I have another question I have managed to find some examples. Like this http://www.9lessons.info/2012/09/restful-web-services-api-using-java-and.html and this http://www.jramoyo.com/2013/02/resttemplate-with-google-places-api.html but every time when I look to the browser in the network tab, it gives many responses how am I going to grab them? – Mert AKEL May 05 '17 at 16:31
-
you are using RestTemplate? ok so the response is Json response and you must parse it using GSON or JACKSON libraries for json parsing – strash May 05 '17 at 16:37
-
No I mean. Which link to I need to consume with resttemplate. On the website which is this https://samplemap.000webhostapp.com when I click on locations and run it. It produces many response. Do I need to just write this link as a url https://maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=places&key=AIzaSyCL90bPGCwrn3-QDF7Scz2NtgsCGNWGMrM or any other? – Mert AKEL May 05 '17 at 16:51
-
Emm not exactly. So Google maps api has many endpoints that you should query. All of them return simple json response. – strash May 05 '17 at 17:13
-
See this example http://stackoverflow.com/questions/11642418/trying-to-use-google-places-api-with-jquerys-getjson-function – strash May 05 '17 at 17:19
-
Your task is not easy. You should see which endpoints of the Google api will return the objects you need as json then persist them in the database. – strash May 05 '17 at 17:22
-
After that when you are loading your own page you should give the information from the database as a parameter for your page. Full stack development knowledge is needed as well as familiarity with the Google maps api. I can help no problems just ask me when you need – strash May 05 '17 at 17:24