ALBasic(); $this->NR_MAPREQUEST=2; // base number for server ACTION } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // CheckRes // does the result consist of all necessary information? function CheckRes() { if ($this->BFGetParam($this->eATAns,"SERVER","LOGICALRECT","0,0,0,0")=="0,0,0,0" ) { $this->MapResponse = "Mapping error"; return $this->BPStat_Error; } else return $this->BPStat_Success; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // GetCSTCount // splits an objectlist and finds number of CST entries function GetCSTCount() { $tmp = explode("^", $this->MapObjectList); $this->num_cst = count($tmp); for ($i = 1; $i<= count($tmp);$i++) $this->arr_cst[$i] = $tmp[$i-1]; $this->Log_to_file("ALMap.GetCSTCount: passed successfully: hits: ".count($tmp)); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // SetOrder // set all parameters, necessary for geocoding function SetOrder() { $this->BPRequest["SERVER"]["ACTION"] = 2; $this->BPRequest["CLIENT"]["REQUEST"] = "TRUE"; $this->BPRequest["CLIENT"]["MAPSBYSTREAM"] = (($this->BPMapsByStream) ? "TRUE" : "FALSE"); // add logical rect for map if applicable if (!empty($this->MapRequestRect)) $this->BPRequest["CLIENT"]["LOGICALRECT"] = $this->MapRequestRect; // add list of customer tables (address layer) to be drawn in map if (strtoupper($this->ShowCustomers) == "TRUE") { $this->BPRequest["CLIENT"]["SHOWCUSTOMERS"] = $this->ShowCustomers; if (!empty($this->VisibleCustomers)) $this->BPRequest["CLIENT"]["VISIBLECUSTOMERS"] = $this->VisibleCustomers; } else if (!empty($this->ShowCustomers)) $this->BPRequest["CLIENT"]["SHOWCUSTOMERS"]= $this->ShowCustomers; // where to find bitmaps for draawing objects in map on map server if (!empty($this->ParaBitmapPath)) $this->BPRequest["CLIENT"]["BITMAPPATH"] = $this->ParaBitmapPath; // if we have a non-empty objectlist, we have to build the CST entries if (!empty($this->MapObjectList)) { $this->GetCSTCount(); for ($i = 1 ; $i<$this->num_cst ; $i++) { $cst = "CST" . $i; $this->BPRequest["CLIENT"][$cst] = $this->arr_cst[$i]; } } $this->Log_to_file("ALMap.SetOrder: passed successfully"); } // SetOrder //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // MapRequest // build request, send request, get answer and check answer function MapRequest() { // check parameter if ($this->BPStat_Error == $this->BFCheckParam($this->NR_MAPREQUEST)) { $this->Log_to_file("ALMap.MapRequest: Too less parameters "); return $this->BPStat_Error; } // set request type $order = $this->SetOrder(); // build request $request = $this->BFBuildOrder(); // send request $answerlength=$this->BFWriteOrder($request); // if length is less than 45 byte, we had an error if($answerlength>45) { // receive answer $this->BFReadALSAnswer($this->NR_MAPREQUEST); // return result code return $this->CheckRes(); } else return $this->BPStat_Error; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // MapRequestRect // returns bounding rect function MapRequestRect() { return $this->BFGetParam($this->eATAns,"SERVER","LOGICALRECT","0,0,0,0"); } }// end of class definition