Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create a servlet that uses Google Maps?  RSS feed

 
Karen Wilson
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a website that is used to view houses. You can search for houses by entering the city and it will display all houses from the database from that city.
I was wondering how can i use Google Maps to view the location of the houses?
The houses are displayed in a table with edit, delete (and now view links) like the picture here:
http://www.roseindia.net/servlets/viewrecord.gif

so when i click the view link I want Google Maps to appear but how can I get the city and address and put it into Google Maps?
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try the Google Maps APIs?
 
Karen Wilson
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i haven't. What do i need to do to use it?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36463
461
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karen,
It depends on what type of map you want. For a dynamic map, you probably want to use the JavaScript (web) API rather than servlet. Your servlet or JSP could generate the JavaScript needed by that URL. Or maybe you want to use a static map and have the servlet create the URL for that.
 
Karen Wilson
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think the static map will be the best for what i am trying to do.
so how do i pass the parameters city and street to the Google Maps URL?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36463
461
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"A quick example" in the static page docs shows what to do. Take a look and then ask what you are puzzled about. Or what you tried but didn't work.

The nice thing with the static URLs is you can test them out in a browser.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!