Copyright (c) 2001, DM Solutions Group Inc. * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ //set the language resource file $szLanguageResource = str_replace("\\","/",dirname(__FILE__))."/Locate.dbf"; // include the supporting php functions include("../session.inc.php"); include_once("../CWC2ButtonCache.php"); // Include geocoder API include_once(COMMON."phpgeocoder/geocoder.php" ); // List of search services to use include_once(COMMON."phpgeocoder/services/gazetteer_server.php"); include_once(COMMON."phpgeocoder/services/gmap_server.php"); include_once(COMMON."phpgeocoder/services/postalcode_server.php"); include_once(COMMON."phpgeocoder/services/NTS_server.php"); include_once(COMMON."phpgeocoder/services/watershed_server.php"); $szOnload = ""; if (isset($http_form_vars['szField']) && $http_form_vars['szField'] != "") { $szOnload = "removeSpinner()"; $oGeoCoder = new PHPGeoCoder(); $oGeoCoder->oErrorManager =& $_SESSION['gErrorManager']; switch($http_form_vars['szField']) { case "placename" : { $oGeoCoder->addSearchAttribute(new PlaceName($http_form_vars['szPlaceName'])); $oGeoCoder->addSearchService(new GazetteerServer($oGeoCoder)); }break; case "postalcode" : { $oGeoCoder->addSearchAttribute(new PostalCode($http_form_vars['szPostalCode'])); $oGeoCoder->addSearchService(new PostalCodeServer($oGeoCoder)) ; }break; case "nts" : { $oGeoCoder->addSearchAttribute(new MapSheet($http_form_vars['szNTS'])); $oGeoCoder->addSearchService(new NTSServer($oGeoCoder)) ; } break; case "watershed" : { $oGeoCoder->addSearchAttribute(new WatershedCode($http_form_vars['szWatershed'])); $oGeoCoder->addSearchService(new WatershedServer($oGeoCoder)) ; } break; default : break; } } $szPlaceName = ((isset($http_form_vars['szPlaceName'])) ? $http_form_vars['szPlaceName'] : ""); $szPostalCode = ((isset($http_form_vars['szPostalCode'])) ? $http_form_vars['szPostalCode'] : ""); $szNTS = ((isset($http_form_vars['szNTS'])) ? $http_form_vars['szNTS'] : ""); $szWatershed = ((isset($http_form_vars['szWatershed'])) ? $http_form_vars['szWatershed'] : ""); ?>