Geomajas, geocoder (PureGWT face) 1.4.0-M1

org.geomajas.plugin.geocoder.client
Class GeocoderPresenter

java.lang.Object
  extended by org.geomajas.plugin.geocoder.client.GeocoderPresenter
All Implemented Interfaces:
EventHandler, SelectAlternativeHandler, SelectLocationHandler

public class GeocoderPresenter
extends Object
implements SelectLocationHandler, SelectAlternativeHandler

Widget for starting a geocoder location search.

Author:
Pieter De Graef

Field Summary
 
Fields inherited from interface org.geomajas.plugin.geocoder.client.event.SelectLocationHandler
TYPE
 
Fields inherited from interface org.geomajas.plugin.geocoder.client.event.SelectAlternativeHandler
TYPE
 
Method Summary
 void clearLocation()
          Clear the current location.
 void fireEvent(GwtEvent<?> event)
          Fire an event.
 String getServicePattern()
          Get the regular expression which is used to select which geocoder services to use.
 void goToLocation(GetLocationForStringResponse response, String location)
          Go to the location which matches the given string.
 void goToLocation(String location)
          Go to the location which matches the given string.
 void onSelectAlternative(SelectAlternativeEvent event)
          Called when the geocoder returned multiple alternatives, purpose is to allow the user to select one.
 void onSelectLocation(SelectLocationEvent event)
          Called when the location is selected either because the geocoder returned a match or because the user chose one of the alternatives.
 HandlerRegistration setSelectAlternativeHandler(SelectAlternativeHandler handler)
          Set the select alternative handler.
 HandlerRegistration setSelectLocationHandler(SelectLocationHandler handler)
          Set the select location handler.
 void setServicePattern(String servicePattern)
          Set the regular expression which is used to select which geocoder services to use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearLocation

public void clearLocation()
Clear the current location.


goToLocation

public void goToLocation(String location)
Go to the location which matches the given string.

Parameters:
location - location

goToLocation

public void goToLocation(GetLocationForStringResponse response,
                         String location)
Go to the location which matches the given string.

Parameters:
response - get location command response
location - location to go to

getServicePattern

public String getServicePattern()
Get the regular expression which is used to select which geocoder services to use.

Returns:
geocoder selection regular expression

setServicePattern

public void setServicePattern(String servicePattern)
Set the regular expression which is used to select which geocoder services to use.

Parameters:
servicePattern - geocoder selection regular expression

setSelectAlternativeHandler

public HandlerRegistration setSelectAlternativeHandler(SelectAlternativeHandler handler)
Set the select alternative handler.

There can only be one handler, the default displays the alternatives in a window on the map widget.

Parameters:
handler - select alternative handler
Returns:
handler registration.

setSelectLocationHandler

public HandlerRegistration setSelectLocationHandler(SelectLocationHandler handler)
Set the select location handler.

There can only be one handler, the default zooms the map widget to the selected location.

Parameters:
handler - select location handler
Returns:
handler registration.

onSelectAlternative

public void onSelectAlternative(SelectAlternativeEvent event)
Description copied from interface: SelectAlternativeHandler
Called when the geocoder returned multiple alternatives, purpose is to allow the user to select one.

Specified by:
onSelectAlternative in interface SelectAlternativeHandler
Parameters:
event - event, contains the list of alternatives

onSelectLocation

public void onSelectLocation(SelectLocationEvent event)
Description copied from interface: SelectLocationHandler
Called when the location is selected either because the geocoder returned a match or because the user chose one of the alternatives.

Specified by:
onSelectLocation in interface SelectLocationHandler
Parameters:
event - event, contains the location which is selected

fireEvent

public void fireEvent(GwtEvent<?> event)
Fire an event.

Parameters:
event - event to fire

Geomajas, geocoder (PureGWT face) 1.4.0-M1

Copyright © 2013 Geosparc. All Rights Reserved.