I’m new to servlet and jsp, I want to make a simple application using Java servlets or JSP that get the locations of some places using Google maps and then do some calculations, then display the results on the map in a webpage.
I can request places search using this :
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522%2C151.1957362&radius=500&types=bus_station&sensor=false&key=YOURAPIKEY.
It returns a JSON array, but I don’t know how to call this link inside java code.
or how to send the location from java-script to servlets.
Simply I want to apply algorithm written in java and calls data from Google maps also return outputs on map.
You can use URLConnection to call the link from Java code and XMLHTTPRequest to send the location from browser (javascript) to the servlet.