+
+ $sOsmType = getParamSet('osm_type', array('N', 'W', 'R'));
+ $iOsmId = getParamInt('osm_id', -1);
+ $fLat = getParamFloat('lat');
+ $fLon = getParamFloat('lon');
+ if ($sOsmType && $iOsmId > 0)
+ {
+ $aLookup = array('osm_type' => $sOsmType, 'osm_id' => $iOsmId);
+ }
+ else if ($fLat !== false && $fLon !==false)
+ {
+ $oReverseGeocode = new ReverseGeocode($oDB);
+ $oReverseGeocode->setZoom(getParamInt('zoom', 18));
+
+ $aLookup = $oReverseGeocode->lookup($fLat, $fLon);
+ if (CONST_Debug) var_dump($aLookup);
+ }
+ else if ($sOutputFormat != 'html')
+ {
+ userError("Need coordinates or OSM object to lookup.");
+ }
+
+ if ($aLookup)