%--
-Copyright (C) 2004-2006 Autodesk, Inc.
-This library is free software; you can redistribute it and/or
-modify it under the terms of version 2.1 of the GNU Lesser
-General Public License as published by the Free Software Foundation.
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--%>
<%@ page import="org.osgeo.mapguide.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.text.*" %>
<%@ page import="javax.servlet.jsp.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ include file ="../utilityfunctions.jsp" %>
<%@ include file ="findaddressfunctions.jsp" %>
Find Address Task
<%
String mgSessionId = request.getParameter("SESSION");
boolean showPreviousResults = false;
MgSiteConnection siteConnection = null;
try
{
// Initialize the Web Extensions and connect to the Site using
// the session identifier stored in JSP session state.
InitializeWebTier();
MgUserInformation userInfo = new MgUserInformation(mgSessionId);
siteConnection = new MgSiteConnection();
siteConnection.Open(userInfo);
// Create a ReserviceService object and use it to open the Map
// object from the sessions repository. Use the Map object to
// determine if the "AddressMarker" layer is visible.
MgMap map = new MgMap(siteConnection);
map.Open("Sheboygan");
MgLayer addressLayer = GetLayerByName(map, "AddressMarker");
if (addressLayer != null)
{
showPreviousResults = addressLayer.GetVisible();
}
}
catch (MgException e)
{
out.write(e.GetExceptionMessage());
out.write(e.GetDetails());
}
%>
Find Address
Search for an Address
Address:
Sheboygan, WI
Hint try:
601 North 5th Street
720 Riverfront Drive
<%
// If there are previous results, display them as hyperlinks and emit
// a second form with a Clear Results button.
if (showPreviousResults)
{
MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
MgResourceIdentifier addressMarkerDataResId = new MgResourceIdentifier("Session:" + mgSessionId + "//AddressMarker.FeatureSource");
EmitAddressResults(out, featureService, addressMarkerDataResId, mgSessionId);
}
%>
Geocoding Provided by: geocoder.us.
Locative Tecnologies offers the free geocoder.us web service for non commercial purposes. If you wish to use this geocoding web service in an production application you must sign up for a commercial license. Click the link above for more information.