0

How do I feed bunch of addresses to Google map via Wicketstuff GMap api so that when map is launched, I see marker/balloon based on city. Basically I want to be able to feed all the addresses and have map show one balloon/city and when city balloon is clicked, launch a wicket panel.I am using wicket 1.4.13 and wicketstuff 1.5.16.

shrM
  • 11
  • 1
  • 4
  • Thanks Martin for the information. With wicketstuff GeoCoder and GLatLng apis I keep getting org.wicketstuff.gmap.geocoder.GeocoderException: OVER_QUERY_LIMIT exception , while creating GLatLng object using GeoCoder. Geocoder coderG = new Geocoder(); GLatLng gLatLng1 = coderG.geocode("1600 Amphitheatre Parkway, Mountain View, CA, USA"); If I hard code lat/lon (GLatLng gLatLng1 = new LatLng(37.4224764,-122.0842499)) , then it's fine.Any idea why Geocoder is not working with address directly. – shrM Jan 09 '19 at 19:23

1 Answers1

1

You need to add Marker objects to the map for each city:

 final GMap map = new GMap("wicketId", "yourApiKey");

 GMarkerOptions markerOptions = new GMarkerOptions(map, latLng, "A marker for city Xyz", true);
 map.addOverlay(new GMarker(markerOptions));

I'd recommend you to take a look at the examples

martin-g
  • 17,243
  • 2
  • 23
  • 35
  • I figured out that Geocoder.encode api for wicketstuff 15.13 was not appending api_key to the url and hence the error was getting thrown. I modified the URL obtained to include api_key and also changes the protocol to https from http and it worked. – shrM Jan 15 '19 at 01:32