提交 59b65cb892a61858e4a3f0850ae1e3b15ada3ed5
Merge branch 'master' of http://gitlab.ctune.cn/DMapServer/DMapServer4.1
正在显示
19 个修改的文件
包含
36 行增加
和
42 行删除
| @@ -23,7 +23,7 @@ bool DmpServer::accept(const std::string &url) | @@ -23,7 +23,7 @@ bool DmpServer::accept(const std::string &url) | ||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | //子类实现 | 25 | //子类实现 |
| 26 | -bool DmpServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | 26 | +bool DmpServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) |
| 27 | { | 27 | { |
| 28 | return false; | 28 | return false; |
| 29 | } | 29 | } |
| @@ -28,7 +28,7 @@ public: | @@ -28,7 +28,7 @@ public: | ||
| 28 | virtual bool accept(const std::string &url); | 28 | virtual bool accept(const std::string &url); |
| 29 | virtual void executeRequest(DmpServerRequest &request, DmpServerResponse &response) = 0; | 29 | virtual void executeRequest(DmpServerRequest &request, DmpServerResponse &response) = 0; |
| 30 | 30 | ||
| 31 | - virtual bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project); | 31 | + virtual bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project); |
| 32 | virtual bool remove(const std::string &serviceName); | 32 | virtual bool remove(const std::string &serviceName); |
| 33 | virtual bool start(const std::string &serviceName); | 33 | virtual bool start(const std::string &serviceName); |
| 34 | virtual bool stop(const std::string &serviceName); | 34 | virtual bool stop(const std::string &serviceName); |
| @@ -8,10 +8,10 @@ | @@ -8,10 +8,10 @@ | ||
| 8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
| 9 | #include "dmpservercontext.h" | 9 | #include "dmpservercontext.h" |
| 10 | 10 | ||
| 11 | -DmpServerContext::DmpServerContext(const DmpServerRequest *request, DmpServerResponse *response, const DmpProject *project): | 11 | +DmpServerContext::DmpServerContext(const DmpServerRequest *request, DmpServerResponse *response, const DmpServerProject *serverProject): |
| 12 | request_(request), | 12 | request_(request), |
| 13 | response_(response), | 13 | response_(response), |
| 14 | - project_(project) | 14 | + serverProject_(serverProject) |
| 15 | { | 15 | { |
| 16 | 16 | ||
| 17 | } | 17 | } |
| @@ -15,18 +15,18 @@ | @@ -15,18 +15,18 @@ | ||
| 15 | 15 | ||
| 16 | class DmpServerResponse; | 16 | class DmpServerResponse; |
| 17 | class DmpServerRequest; | 17 | class DmpServerRequest; |
| 18 | -class DmpProject; | 18 | +class DmpServerProject; |
| 19 | class SERVER_EXPORT DmpServerContext | 19 | class SERVER_EXPORT DmpServerContext |
| 20 | { | 20 | { |
| 21 | public: | 21 | public: |
| 22 | - DmpServerContext(const DmpServerRequest *request, DmpServerResponse *response, const DmpProject *project); | 22 | + DmpServerContext(const DmpServerRequest *request, DmpServerResponse *response, const DmpServerProject *serverProject); |
| 23 | const DmpServerRequest *request() const { return request_;} | 23 | const DmpServerRequest *request() const { return request_;} |
| 24 | DmpServerResponse *response() const { return response_;} | 24 | DmpServerResponse *response() const { return response_;} |
| 25 | - const DmpProject *project() const { return project_;} | 25 | + const DmpServerProject *serverProject() const { return serverProject_;} |
| 26 | 26 | ||
| 27 | private: | 27 | private: |
| 28 | const DmpServerRequest *request_ = nullptr; | 28 | const DmpServerRequest *request_ = nullptr; |
| 29 | DmpServerResponse *response_ = nullptr; | 29 | DmpServerResponse *response_ = nullptr; |
| 30 | - const DmpProject *project_ = nullptr; | 30 | + const DmpServerProject *serverProject_ = nullptr; |
| 31 | }; | 31 | }; |
| 32 | #endif // __dmpservercontext_h__ | 32 | #endif // __dmpservercontext_h__ |
| @@ -100,7 +100,7 @@ bool DmpServerManager::removeProject(const std::string &serviceName) | @@ -100,7 +100,7 @@ bool DmpServerManager::removeProject(const std::string &serviceName) | ||
| 100 | return true; | 100 | return true; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | -bool DmpServerManager::publish(const std::string &serverName, const std::string &serviceName, int capabilities, const std::string &projectData) | 103 | +bool DmpServerManager::publish(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData) |
| 104 | { | 104 | { |
| 105 | //project | 105 | //project |
| 106 | std::string projData; | 106 | std::string projData; |
| @@ -115,7 +115,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string | @@ -115,7 +115,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string | ||
| 115 | return false; | 115 | return false; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | - if (!serverRegistry_->getServer(serverName)->publish(serviceName, capabilities, *project)) | 118 | + if (!serverRegistry_->getServer(serverName)->publish(serviceName, title, capabilities, *project)) |
| 119 | { | 119 | { |
| 120 | delete project; | 120 | delete project; |
| 121 | return false; | 121 | return false; |
| @@ -123,6 +123,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string | @@ -123,6 +123,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string | ||
| 123 | projects_[serviceName] = project; | 123 | projects_[serviceName] = project; |
| 124 | return true; | 124 | return true; |
| 125 | } | 125 | } |
| 126 | + | ||
| 126 | bool DmpServerManager::deleteService(const std::string &serverName, const std::string &serviceName) | 127 | bool DmpServerManager::deleteService(const std::string &serverName, const std::string &serviceName) |
| 127 | { | 128 | { |
| 128 | if (serverRegistry_->getServer(serverName)->remove(serviceName) && removeProject(serviceName)) | 129 | if (serverRegistry_->getServer(serverName)->remove(serviceName) && removeProject(serviceName)) |
| @@ -177,7 +178,7 @@ bool DmpServerManager::LoadServices() | @@ -177,7 +178,7 @@ bool DmpServerManager::LoadServices() | ||
| 177 | std::string type = e.second.get<std::string>("type"); | 178 | std::string type = e.second.get<std::string>("type"); |
| 178 | int capabilities =e.second.get<int>("capabilities"); | 179 | int capabilities =e.second.get<int>("capabilities"); |
| 179 | std::string project = e.second.get<std::string>("project"); | 180 | std::string project = e.second.get<std::string>("project"); |
| 180 | - this->publish(type,name,capabilities,project); | 181 | + this->publish(type,name,title,capabilities,project); |
| 181 | } | 182 | } |
| 182 | } | 183 | } |
| 183 | return true; | 184 | return true; |
| @@ -30,7 +30,7 @@ public: | @@ -30,7 +30,7 @@ public: | ||
| 30 | std::shared_ptr<DmpServer> serverForRequest(const DmpServerRequest& request); | 30 | std::shared_ptr<DmpServer> serverForRequest(const DmpServerRequest& request); |
| 31 | std::shared_ptr<DmpServerApi> apiForRequest(const DmpServerRequest& request); | 31 | std::shared_ptr<DmpServerApi> apiForRequest(const DmpServerRequest& request); |
| 32 | 32 | ||
| 33 | - bool publish(const std::string& serverName, const std::string& serviceName, int capabilities, const std::string& projectData); | 33 | + bool publish(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData); |
| 34 | bool deleteService(const std::string& serverName, const std::string& serviceName); | 34 | bool deleteService(const std::string& serverName, const std::string& serviceName); |
| 35 | bool startService(const std::string& serverName, const std::string& serviceName); | 35 | bool startService(const std::string& serverName, const std::string& serviceName); |
| 36 | bool stopService(const std::string& serverName, const std::string& serviceName); | 36 | bool stopService(const std::string& serverName, const std::string& serviceName); |
| @@ -9,10 +9,9 @@ | @@ -9,10 +9,9 @@ | ||
| 9 | #include "dmpserverproject.h" | 9 | #include "dmpserverproject.h" |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -DmpServerProject::DmpServerProject(const std::string &name, const std::string &title, const std::string &description,const DmpProject *project): | 12 | +DmpServerProject::DmpServerProject(const std::string &name, const std::string &title, const DmpProject *project): |
| 13 | name_(name), | 13 | name_(name), |
| 14 | title_(title), | 14 | title_(title), |
| 15 | - description_(description), | ||
| 16 | project_(project) | 15 | project_(project) |
| 17 | { | 16 | { |
| 18 | status_ = 1; | 17 | status_ = 1; |
| @@ -18,18 +18,16 @@ | @@ -18,18 +18,16 @@ | ||
| 18 | class SERVER_EXPORT DmpServerProject | 18 | class SERVER_EXPORT DmpServerProject |
| 19 | { | 19 | { |
| 20 | public: | 20 | public: |
| 21 | - DmpServerProject(const std::string &name, | ||
| 22 | - const std::string &title, | ||
| 23 | - const std::string &description, | ||
| 24 | - const DmpProject *project); | 21 | + DmpServerProject(const std::string &name, const std::string &title, const DmpProject *project); |
| 25 | std::string createTime() { return time_;} | 22 | std::string createTime() { return time_;} |
| 26 | - const DmpProject* project() { return project_;} | 23 | + const DmpProject* project() const { return project_;} |
| 24 | + std::string name() const { return name_;} | ||
| 25 | + std::string title() const { return title_;} | ||
| 27 | int status() { return status_;} | 26 | int status() { return status_;} |
| 28 | void setStatus(int status) { status_ = status;} | 27 | void setStatus(int status) { status_ = status;} |
| 29 | private: | 28 | private: |
| 30 | std::string name_; | 29 | std::string name_; |
| 31 | std::string title_; | 30 | std::string title_; |
| 32 | - std::string description_; | ||
| 33 | std::string time_; | 31 | std::string time_; |
| 34 | int status_; | 32 | int status_; |
| 35 | int flag_; | 33 | int flag_; |
| @@ -50,8 +50,6 @@ public: | @@ -50,8 +50,6 @@ public: | ||
| 50 | void setHeader(const std::string &name, const std::string &value); | 50 | void setHeader(const std::string &name, const std::string &value); |
| 51 | Headers headers() const { return headers_; } | 51 | Headers headers() const { return headers_; } |
| 52 | bool isRestful() const { return isRestful_; } | 52 | bool isRestful() const { return isRestful_; } |
| 53 | - std::string serviceName() const { return serviceName_;} | ||
| 54 | - void setServiceName(const std::string &serviceName) { serviceName_ = serviceName;} | ||
| 55 | 53 | ||
| 56 | DmpServerParameters serverParameters() const { return params_; } | 54 | DmpServerParameters serverParameters() const { return params_; } |
| 57 | void setParameter(const std::string &name, const std::string &value); | 55 | void setParameter(const std::string &name, const std::string &value); |
| @@ -70,7 +68,6 @@ protected: | @@ -70,7 +68,6 @@ protected: | ||
| 70 | std::string port_; | 68 | std::string port_; |
| 71 | std::string path_; | 69 | std::string path_; |
| 72 | std::string query_; | 70 | std::string query_; |
| 73 | - std::string serviceName_; | ||
| 74 | bool isRestful_; | 71 | bool isRestful_; |
| 75 | 72 | ||
| 76 | private: | 73 | private: |
| @@ -198,7 +198,7 @@ BOOST_PYTHON_MODULE(dmap_server) | @@ -198,7 +198,7 @@ BOOST_PYTHON_MODULE(dmap_server) | ||
| 198 | .def("allow_method", pure_virtual(&DmpService::allowMethod)) | 198 | .def("allow_method", pure_virtual(&DmpService::allowMethod)) |
| 199 | .def("execute_request", pure_virtual(&DmpService::executeRequest)); | 199 | .def("execute_request", pure_virtual(&DmpService::executeRequest)); |
| 200 | 200 | ||
| 201 | - class_<DmpServerContext>("DmpServerContext",init<DmpServerRequest*, DmpServerResponse*, DmpProject*>()); | 201 | + // class_<DmpServerContext>("DmpServerContext",init<DmpServerRequest*, DmpServerResponse*, DmpProject*>()); |
| 202 | 202 | ||
| 203 | class_<DmpServerRequest>("DmpServerRequest",init<std::string&>()); | 203 | class_<DmpServerRequest>("DmpServerRequest",init<std::string&>()); |
| 204 | 204 |
| @@ -125,7 +125,7 @@ void DmpManagerApiHandler::regService(const DmpServerApiContext &context) const | @@ -125,7 +125,7 @@ void DmpManagerApiHandler::regService(const DmpServerApiContext &context) const | ||
| 125 | context.response()->write("{\"status\":\"false\",\"message\":\"服务发布失败\"}"); | 125 | context.response()->write("{\"status\":\"false\",\"message\":\"服务发布失败\"}"); |
| 126 | return; | 126 | return; |
| 127 | } | 127 | } |
| 128 | - if(context.manager()->publish(serverType, name, capabilities, project)) { | 128 | + if(context.manager()->publish(serverType, name, title, capabilities, project)) { |
| 129 | LOGGER_INFO("服务发布成功"); | 129 | LOGGER_INFO("服务发布成功"); |
| 130 | context.response()->write("{\"status\":\"true\",\"message\":\"Pulish service successful!\"}"); | 130 | context.response()->write("{\"status\":\"true\",\"message\":\"Pulish service successful!\"}"); |
| 131 | // std::string projData; | 131 | // std::string projData; |
| @@ -70,7 +70,7 @@ void DmpMapServer::executeRequest(DmpServerRequest &request, DmpServerResponse & | @@ -70,7 +70,7 @@ void DmpMapServer::executeRequest(DmpServerRequest &request, DmpServerResponse & | ||
| 70 | response.writeHtml(htmlstr + "服务\"" + serviceName + "\"已经停止。</p></body></html>\n"); | 70 | response.writeHtml(htmlstr + "服务\"" + serviceName + "\"已经停止。</p></body></html>\n"); |
| 71 | return; | 71 | return; |
| 72 | } | 72 | } |
| 73 | - DmpServerContext context {&request, &response, serverProj->project()}; | 73 | + DmpServerContext context {&request, &response, serverProj}; |
| 74 | service->executeRequest(context); | 74 | service->executeRequest(context); |
| 75 | } | 75 | } |
| 76 | else { | 76 | else { |
| @@ -91,7 +91,7 @@ void DmpMapServer::executeRequest(DmpServerRequest &request, DmpServerResponse & | @@ -91,7 +91,7 @@ void DmpMapServer::executeRequest(DmpServerRequest &request, DmpServerResponse & | ||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | -bool DmpMapServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | 94 | +bool DmpMapServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) |
| 95 | { | 95 | { |
| 96 | if(capability & DmpServiceType::WMTS) { | 96 | if(capability & DmpServiceType::WMTS) { |
| 97 | DmpService* wmtsservice = getService("WMTSService"); | 97 | DmpService* wmtsservice = getService("WMTSService"); |
| @@ -105,8 +105,8 @@ bool DmpMapServer::publish(const std::string &name, unsigned int capability, con | @@ -105,8 +105,8 @@ bool DmpMapServer::publish(const std::string &name, unsigned int capability, con | ||
| 105 | return false; | 105 | return false; |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | - DmpServerProject* serverProject = new DmpServerProject(name,"","", &project); | ||
| 109 | - serverProjects_[name] = serverProject; | 108 | + DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project); |
| 109 | + serverProjects_[serviceName] = serverProject; | ||
| 110 | 110 | ||
| 111 | return true; | 111 | return true; |
| 112 | } | 112 | } |
| @@ -37,7 +37,7 @@ public: | @@ -37,7 +37,7 @@ public: | ||
| 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/MapServer/([\\w]+)"); } | 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/MapServer/([\\w]+)"); } |
| 38 | std::string capability() const override; | 38 | std::string capability() const override; |
| 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; | 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; |
| 40 | - bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project) override; | 40 | + bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) override; |
| 41 | bool remove(const std::string &serviceName) override; | 41 | bool remove(const std::string &serviceName) override; |
| 42 | bool start(const std::string &serviceName) override; | 42 | bool start(const std::string &serviceName) override; |
| 43 | bool stop(const std::string &serviceName) override; | 43 | bool stop(const std::string &serviceName) override; |
| @@ -36,7 +36,7 @@ namespace DmpWms | @@ -36,7 +36,7 @@ namespace DmpWms | ||
| 36 | void DmpWMSService::executeRequest(const DmpServerContext &context) | 36 | void DmpWMSService::executeRequest(const DmpServerContext &context) |
| 37 | { | 37 | { |
| 38 | const DmpWmsParameters params(context.request()->serverParameters()); | 38 | const DmpWmsParameters params(context.request()->serverParameters()); |
| 39 | - const DmpProject* project = context.project(); | 39 | + const DmpProject* project = context.serverProject()->project(); |
| 40 | const std::string request = params.Request(); | 40 | const std::string request = params.Request(); |
| 41 | if (request.empty()) | 41 | if (request.empty()) |
| 42 | { | 42 | { |
| @@ -65,7 +65,6 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | @@ -65,7 +65,6 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | ||
| 65 | if(what.size() == 4) { | 65 | if(what.size() == 4) { |
| 66 | std::string serviceName = what[1].str(); | 66 | std::string serviceName = what[1].str(); |
| 67 | std::string serverType = what[2].str(); | 67 | std::string serverType = what[2].str(); |
| 68 | - request.setServiceName(serviceName); | ||
| 69 | if(request.isRestful()) { | 68 | if(request.isRestful()) { |
| 70 | std::string queryString = what[3].str(); | 69 | std::string queryString = what[3].str(); |
| 71 | request.setQuery(queryString); | 70 | request.setQuery(queryString); |
| @@ -79,7 +78,7 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | @@ -79,7 +78,7 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | ||
| 79 | response.writeHtml(htmlstr + "服务\"" + serviceName + "\"已经停止。</p></body></html>\n"); | 78 | response.writeHtml(htmlstr + "服务\"" + serviceName + "\"已经停止。</p></body></html>\n"); |
| 80 | return; | 79 | return; |
| 81 | } | 80 | } |
| 82 | - DmpServerContext context {&request, &response, serverProj->project()}; | 81 | + DmpServerContext context {&request, &response, serverProj}; |
| 83 | service->executeRequest(context); | 82 | service->executeRequest(context); |
| 84 | } | 83 | } |
| 85 | else { | 84 | else { |
| @@ -99,7 +98,7 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | @@ -99,7 +98,7 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse | ||
| 99 | } | 98 | } |
| 100 | } | 99 | } |
| 101 | 100 | ||
| 102 | -bool DmpTileServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | 101 | +bool DmpTileServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) |
| 103 | { | 102 | { |
| 104 | if(capability & DmpServiceType::WMTS) { | 103 | if(capability & DmpServiceType::WMTS) { |
| 105 | DmpService* wmtsservice = getService("WMTSService"); | 104 | DmpService* wmtsservice = getService("WMTSService"); |
| @@ -113,8 +112,8 @@ bool DmpTileServer::publish(const std::string &name, unsigned int capability, co | @@ -113,8 +112,8 @@ bool DmpTileServer::publish(const std::string &name, unsigned int capability, co | ||
| 113 | return false; | 112 | return false; |
| 114 | } | 113 | } |
| 115 | } | 114 | } |
| 116 | - DmpServerProject* serverProject = new DmpServerProject(name,"","", &project); | ||
| 117 | - serverProjects_[name] = serverProject; | 115 | + DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project); |
| 116 | + serverProjects_[serviceName] = serverProject; | ||
| 118 | 117 | ||
| 119 | return true; | 118 | return true; |
| 120 | } | 119 | } |
| @@ -37,7 +37,7 @@ public: | @@ -37,7 +37,7 @@ public: | ||
| 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/TileServer/([\\w.]+)([\\w./]*)"); } | 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/TileServer/([\\w.]+)([\\w./]*)"); } |
| 38 | std::string capability() const override; | 38 | std::string capability() const override; |
| 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; | 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; |
| 40 | - bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project) override; | 40 | + bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) override; |
| 41 | bool remove(const std::string &serviceName) override; | 41 | bool remove(const std::string &serviceName) override; |
| 42 | bool start(const std::string &serviceName) override; | 42 | bool start(const std::string &serviceName) override; |
| 43 | bool stop(const std::string &serviceName) override; | 43 | bool stop(const std::string &serviceName) override; |
| @@ -55,7 +55,7 @@ namespace DmpTms | @@ -55,7 +55,7 @@ namespace DmpTms | ||
| 55 | int tileCol=atoi(vec0[0].c_str()); | 55 | int tileCol=atoi(vec0[0].c_str()); |
| 56 | int tileRow=atoi(vec[isize-2].c_str()); | 56 | int tileRow=atoi(vec[isize-2].c_str()); |
| 57 | int tileMatrix=atoi(vec[isize-3].c_str()); | 57 | int tileMatrix=atoi(vec[isize-3].c_str()); |
| 58 | - const DmpProject *project = context.project(); | 58 | + const DmpProject *project = context.serverProject()->project(); |
| 59 | DmpTileLayer *tileLayer = static_cast<DmpTileLayer *>(project->getLayer()); | 59 | DmpTileLayer *tileLayer = static_cast<DmpTileLayer *>(project->getLayer()); |
| 60 | std::string format=vec0[1].c_str(); | 60 | std::string format=vec0[1].c_str(); |
| 61 | std::string filePath=tileLayer->getDataSource(); | 61 | std::string filePath=tileLayer->getDataSource(); |
| @@ -65,10 +65,9 @@ namespace DmpWmts | @@ -65,10 +65,9 @@ namespace DmpWmts | ||
| 65 | params = nullptr; | 65 | params = nullptr; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | - const DmpProject *project = context.project(); | 68 | + const DmpServerProject *serverProject = context.serverProject(); |
| 69 | + const DmpProject *project = serverProject->project(); | ||
| 69 | DmpTileLayer *tileLayer = static_cast<DmpTileLayer *>(project->getLayer(layerName)); | 70 | DmpTileLayer *tileLayer = static_cast<DmpTileLayer *>(project->getLayer(layerName)); |
| 70 | - //context.response()->writeHtml("hello,wmts"); | ||
| 71 | - //const DmpWmtsParameters params(context.request()->serverParameters()); | ||
| 72 | 71 | ||
| 73 | if (req.empty()) | 72 | if (req.empty()) |
| 74 | { | 73 | { |
| @@ -83,7 +82,7 @@ namespace DmpWmts | @@ -83,7 +82,7 @@ namespace DmpWmts | ||
| 83 | else if (boost::iequals(req, "GetCapabilities")) | 82 | else if (boost::iequals(req, "GetCapabilities")) |
| 84 | { | 83 | { |
| 85 | const std::string host=context.request()->domain()+":"+context.request()->port();; | 84 | const std::string host=context.request()->domain()+":"+context.request()->port();; |
| 86 | - const std::string servicename=context.request()->serviceName(); | 85 | + const std::string servicename=serverProject->name(); |
| 87 | 86 | ||
| 88 | boost::property_tree::ptree pt; | 87 | boost::property_tree::ptree pt; |
| 89 | pt.add("Layer.ows:Title",tileLayer->title()); | 88 | pt.add("Layer.ows:Title",tileLayer->title()); |
请
注册
或
登录
后发表评论