JSP custom taglib lets you perform geocode requests via Yahoo Placefinder API.
This service lets you find for example the specific latitude and longitude for an address. For example:
<%@ taglib uri="taglib.tld" prefix="g" %> <g:YahooGeocode appid="your_id" result="res"> <g:setParameter name="location">701 First Street, Sunnyvale, CA</g:YahooGeocode> </g:YahooGeocode> <p>Found: <%=res.getFound()%> <%=res.getResult()[0].getLatitude()%> : <%=res.getResult()[0].getLongitude()%> and you will get this: Found:1 37.416386 : -122.02486 Attribute result describes a name for page scope variable with geocode data. Type for this variable
is com.cj.yahoo.GeocodeBean. This bean supports the following methods:
getError()
com.cj.yahoo.GeocodeResultBean supports the following methods
getLatitude()
Tags are: YahooGeocode Body tag performs geocoding request via Yahoo PlaceFinder API. Attributes are: 1) appid Describes application ID (you have to request it from Yahoo).
setParemeter Body tag lets you set a parameter for geocode request. Tag's body describes a value. Attributes are: 1) name Describes a name for your parameter for downloading: Library: yahoogeocodetag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|