| 495 | } |
| 496 | |
| 497 | int RemoteSearch::getObjects(const hadmap::PointVec& envelope, const std::vector<hadmap::OBJECT_TYPE>& types, |
| 498 | hadmap::txObjects& objects) { |
| 499 | std::string baseUrl = pTrans->location(); |
| 500 | std::string url = |
| 501 | UrlGen(baseUrl).db(dbName).getObject().envelope(envelope[0].x, envelope[0].y, envelope[1].x, envelope[1].y).url(); |
| 502 | |
| 503 | std::vector<PostParamPtr> params; |
| 504 | for (auto& objType : types) params.push_back(PostParamPtr(new ObjTypeParam(objType))); |
| 505 | std::string paramJson; |
| 506 | generatePostJson(params, paramJson); |
| 507 | |
| 508 | std::string jsonData; |
| 509 | if (pTrans->post(url, paramJson, jsonData)) { |
| 510 | objects.clear(); |
| 511 | |
| 512 | JsonParser::parseObj(jsonData, objects); |
| 513 | |
| 514 | return objects.empty() ? TX_HADMAP_DATA_EMPTY : TX_HADMAP_DATA_OK; |
| 515 | } |
| 516 | |
| 517 | return TX_HADMAP_DATA_ERROR; |
| 518 | } |
| 519 | |
| 520 | int RemoteSearch::getObjects(const std::vector<txLaneId>& laneIds, const std::vector<OBJECT_TYPE>& types, |
| 521 | txObjects& objects) { |