|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.ve.data.geocode.VEGeocodeFunctionality
public class VEGeocodeFunctionality
This class provides the geocoding and reverse geocoding abilities of VEGeocodeResource
.
It gives the ability to specify which address fields should be used. You can also specify what aliases to use for the
address fields. The GeocodeTask
uses these address fields and aliases to build a user interface. If no
address fields are specified, one all-purpose address field is used. If no aliases are specified, the default labels
are retrieved from the Res.properties file of the web application.
When an address is geocoded, a zoom factor is applied on the map to display the address. This zoom factor can be
customized. See example below of how these properties can be customized through faces-config.xml.
<managed-bean> <managed-bean-name>veGeocode</managed-bean-name> <managed-bean-class>com.esri.adf.web.ve.data.geocode.VEGeocodeFunctionality</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>addressFields</property-name> <list-entries> <value>AddressLine</value> <value>PostalCode</value> <value>PostalTown</value> </list-entries> </managed-property> <managed-property> <property-name>aliases</property-name> <map-entries> <map-entry> <key>AddressLine</key> <value>Street</value> </map-entry> </map-entries> </managed-property> <managed-property> <property-name>zoomFactor</property-name> <value>10000.0</value> </managed-property> </managed-bean>
Field Summary |
---|
Fields inherited from interface com.esri.adf.web.data.GeocodeFunctionality |
---|
FUNCTIONALITY_NAME |
Fields inherited from interface com.esri.adf.web.ve.data.VEConstants |
---|
MAP_STYLE_AERIAL, MAP_STYLE_AERIAL_WITH_LABEL, MAP_STYLE_ROAD, MAX_LEVEL_OF_DETAIL, MIN_LEVEL_OF_DETAIL, TILE_HEIGHT, TILE_WIDTH, VIRTUAL_EARTH_GEOCODE_WKID, VIRTUAL_EARTH_SPATIAL_REFERENCE_WKID, VIRTUAL_EARTH_XMAX, VIRTUAL_EARTH_XMIN, VIRTUAL_EARTH_YMAX, VIRTUAL_EARTH_YMIN |
Constructor Summary | |
---|---|
VEGeocodeFunctionality()
|
Method Summary | |
---|---|
void |
destroyFunctionality()
The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. |
List<AddressCandidate> |
findAddressCandidates()
Returns a List of AddressCandidate s based on the current set of address field values . |
AddressCandidate |
geocodeAddress()
Geocodes a single address based on the current set of address field values . |
String |
getAddressFieldAlias(String fieldName)
Returns an alias for the given address field . |
String[] |
getAddressFields()
Returns an array of address fields for this geocoder. |
String |
getAddressFieldValue(String fieldName)
Returns the value for a given address field . |
int |
getMinScore()
|
VEGeocodeResource |
getResource()
Returns the GISResource associated with this functionality. |
int |
getScoreHigh()
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
int |
getScoreLow()
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
int |
getScoreMedium()
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
double |
getZoomFactor()
Returns the zoom factor to which the map will be zoomed to to display a result |
void |
initFunctionality(GISResource resource)
The initialization chores for the functionality must be performed in this method. |
List<AddressCandidate> |
reverseGeocodeAddress(WebPoint point)
This method returns a list of possible addresses for a given location. |
void |
setAddressFields(String[] addressFields)
Sets the address fields to be used by this GeocodeFunctionality. |
void |
setAddressFieldValue(String fieldName,
String value)
Sets the value for a given address field . |
void |
setAliases(HashMap<String,String> aliases)
Sets the aliases for the address fields used by this GeocodeFunctionality. |
void |
setMinScore(int userDefinedMinScore)
|
void |
setScoreHigh(int scoreHigh)
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
void |
setScoreLow(int scoreLow)
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
void |
setScoreMedium(int scoreMedium)
Defines the mapping between Bing Maps Geocode service's confidence level and the corresponding AddressCandidate score. |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor to which the map will be zoomed to to display a result |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VEGeocodeFunctionality()
Method Detail |
---|
public int getScoreHigh()
AddressCandidate
score. Returns the score value (1-100)
corresponding to a HIGH confidence level.
public int getScoreMedium()
AddressCandidate
score. Returns the score value (1-100)
corresponding to a MEDIUM confidence level.
public int getScoreLow()
AddressCandidate
score. Returns the score value (1-100)
corresponding to a LOW confidence level.
public void setScoreHigh(int scoreHigh)
AddressCandidate
score. Sets the score value (1-100) corresponding
to a HIGH confidence level. The default value is 80.
scoreHigh
- the score to setpublic void setScoreMedium(int scoreMedium)
AddressCandidate
score. Sets the score value (1-100) corresponding
to a MEDIUM confidence level. The default value is 50.
scoreMedium
- the score to setpublic void setScoreLow(int scoreLow)
AddressCandidate
score. Sets the score value (1-100) corresponding
to a LOW confidence level. The default value is 20.
scoreLow
- the score to setpublic double getZoomFactor()
public void setZoomFactor(double zoomFactor)
zoomFactor
- the zoomFactor to setpublic void initFunctionality(GISResource resource)
GISFunctionality
The initialization chores for the functionality must be performed in this method. This method is called by the
resource
when the functionality needs to be initialized. This happens either when the resource
itself is being initialized or if users add this functionality to the resource using the
GISResource.addFunctionality(String, GISFunctionality)
method after the resource has already
been initialized.
Classes which implement this method should maintain the resource
as a class instance variable and
return the same in the GISFunctionality.getResource()
method. The functionality is ready for use only after this method has
been called.
initFunctionality
in interface GISFunctionality
resource
- the GISResource
that this functionality supportsGISResource.init(WebContext)
public void destroyFunctionality()
GISFunctionality
The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. This
method is called by the GISResource
when the resource itself is being destroyed.
The functionality is no longer usable after this method has been called.
destroyFunctionality
in interface GISFunctionality
GISResource.destroy()
public List<AddressCandidate> reverseGeocodeAddress(WebPoint point)
point
- a WebPoint to be reverse geocoded. Please ensure the point has a valid spatial reference, especially
if it is in a different spatial reference from the WebContext
.
null
if nothing is found.public AddressCandidate geocodeAddress()
GeocodeFunctionality
Geocodes a single address based on the current set of address field values
.
geocodeAddress
in interface GeocodeFunctionality
public List<AddressCandidate> findAddressCandidates()
GeocodeFunctionality
Returns a List
of AddressCandidate
s based on the current set of address field values
.
findAddressCandidates
in interface GeocodeFunctionality
List
of AddressCandidate
s matching the current set of address field valuespublic VEGeocodeResource getResource()
GISFunctionality
Returns the GISResource
associated with this functionality.
The resource passed to GISFunctionality.initFunctionality(GISResource)
is maintained as a class variable and is accessible
through this method.
getResource
in interface GISFunctionality
GISResource
associated with this functionalitypublic String getAddressFieldAlias(String fieldName)
GeocodeFunctionality
Returns an alias for the given address field
.
The GeocodeTask
labels the input text box for the address field with this alias.
getAddressFieldAlias
in interface GeocodeFunctionality
fieldName
- the address field for which the alias is to be returned
public String getAddressFieldValue(String fieldName)
GeocodeFunctionality
Returns the value for a given address field
.
getAddressFieldValue
in interface GeocodeFunctionality
fieldName
- the address field for which the value is to be returned
public String[] getAddressFields()
GeocodeFunctionality
Returns an array of address fields for this geocoder. Every implementation of GeocodeFunctionality
defines the address fields that are available.
The GeocodeTask
dynamically generates input text box for each address field.
getAddressFields
in interface GeocodeFunctionality
String
array of address fields for this geocoderpublic void setMinScore(int userDefinedMinScore)
userDefinedMinScore
- the userDefinedMinScore to setpublic int getMinScore()
public void setAddressFields(String[] addressFields)
GeocodeRequest
object in the Bing Maps Geocode Service. You can override this by
specifying which address fields should be used. Possible values are :
"AddressLine","AdminDistrict","CountryRegion", "District", "Locality", "PostalCode", "PostalTown". For more
information about these fields, please refer to the Address
class in the Bing Maps Geocode Service
documentation.
addressFields
- the address fieldspublic void setAddressFieldValue(String fieldName, String value)
GeocodeFunctionality
Sets the value for a given address field
.
setAddressFieldValue
in interface GeocodeFunctionality
fieldName
- the address field for which the value is to be setvalue
- the value for the given address fieldpublic void setAliases(HashMap<String,String> aliases)
VEGeocodeFunctionality veGeoFunc = ...; HashMap<String, String> aliases = new HashMap<String, String>(); aliases.put("PostalCode", "Zip Code"); aliases.put("CountryRegion", "Country"); veGeoFunc.setAliases(aliases);
aliases
- the aliases to set. The keys of the HashMap correspond to address fieldspublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |