Reputation: 185
I have set of longitudes and latitude in array , I want to display them on google maps in a web browser using google API , spring and java
Upvotes: 0
Views: 2540
Reputation: 4784
as far as my knowledge, spring is a backend RESTful web service, and I think what you want to do is to dynamically build the javascript that display multiple markers on the Google Maps.
You can look at this example, or the javascript market documentation for more information.
Upvotes: 3
Reputation: 4037
I would suggest you to first convert the array into a JSON array, that would be easy for your Java/Spring code to parse and then finally display on the Google Maps using the Maps Library.
To convert array into JSON:
String mStringArray[] = { "String1", "String2" };
JSONArray mJSONArray = new JSONArray(Arrays.asList(mStringArray));
To display the latitude/longitude that are now in JSON on Google Maps follow this tutorial.
Hope this Helps!!
Upvotes: 1