This package contains the DefaultEventListenerServlet. When electing to use servlets to handle map events, developers should create a subclass of DefaultEventListenerServlet and provide it's url as the url attribute in any <googlemaps:event> tags.
When subclassing DefaultEventListenerServlet, developers should only override the processXX methods, calling super.processXX(), then providing additional functionality afterwards. This ensures the map will have consistent, normal map behaviour, in addition to their custom behaviour.
The following example is a Servlet based event listener that will add a marker to the map whenever the user clicks on it (assumes a <googlemaps:event action="click"> tag was added to the map):
public void MyListenerServlet extends DefaultEventListenerServlet { public void processClickEvent(GoogleMapTag map, double longitude, double latitude) {\ super.processClickEvent(map, longitude, latitude); GoogleMapPointTag point = new GoogleMapPointTag(); String pointName = "point_" + (new Date()).getTime(); point.setId(pointName); map.addPoint(point); GoogleMapMarkerTag marker = new GoogleMapMarkerTag(); String markerName = "marker_" + (new Date()).getTime(); marker.setId(markerName); marker.setPoint(pointName); map.addMarker(marker); } }