1
|
|
-/**************************************************************************
|
2
|
|
-* file: dmpwmtsservice.cpp
|
3
|
|
-
|
4
|
|
-* Author: wanzhongping
|
5
|
|
-* Date: 2021-07-28 11:34:16
|
6
|
|
-* Email: zhongpingw@chinadci.com
|
7
|
|
-* copyright: 广州城市信息研究所有限公司
|
8
|
|
-***************************************************************************/
|
9
|
|
-#include "dmpwmtsservice.h"
|
10
|
|
-
|
11
|
|
-// DmpWMTSService::DmpWMTSService()
|
12
|
|
-// : DmpService()
|
13
|
|
-// {
|
14
|
|
-// map_type_ = MapServerType::WMTS_SERVER;
|
15
|
|
-// //AddProperty("tilePath","/usr/local/dmap4/gdmap/_alllayers");
|
16
|
|
-// //AddProperty("tilePath","/mnt/d/Code/tiles/gdmap/_alllayers");
|
17
|
|
-// //AddProperty("tileVersion","1");
|
18
|
|
-// }
|
19
|
|
-// DmpWMTSService::~DmpWMTSService()
|
20
|
|
-// {
|
21
|
|
-// }
|
22
|
|
-// bool DmpWMTSService::Read(boost::property_tree::ptree &pt_node)
|
23
|
|
-// {
|
24
|
|
-// try {
|
25
|
|
-// enabled_ = pt_node.get<bool>("enabled");
|
26
|
|
-// capabilities_ = pt_node.get<std::string>("capabilities");
|
27
|
|
-
|
28
|
|
-// //读取属性
|
29
|
|
-// for (auto property : pt_node.get_child("properties"))
|
30
|
|
-// {
|
31
|
|
-// std::string key = property.first;
|
32
|
|
-// std::string val = property.second.data();
|
33
|
|
-// AddProperty(key, val);
|
34
|
|
-// }
|
35
|
|
-
|
36
|
|
-// }
|
37
|
|
-// catch(std::exception ex) {
|
38
|
|
-// return false;
|
39
|
|
-// }
|
40
|
|
-// return true;
|
41
|
|
-// }
|
42
|
|
-// bool DmpWMTSService::Write(boost::property_tree::ptree &pt_node)
|
43
|
|
-// {
|
44
|
|
-// pt_node.put("typeName", (int)map_type_);
|
45
|
|
-// pt_node.put("capabilities", capabilities_);
|
46
|
|
-// pt_node.put("enabled", enabled_);
|
47
|
|
-
|
48
|
|
-// boost::property_tree::ptree pt_subitem;
|
49
|
|
-// std::map<std::string, std::string>::iterator iter = properties_.begin();
|
50
|
|
-// while(iter != properties_.end())
|
51
|
|
-// {
|
52
|
|
-// pt_subitem.put(iter->first, iter->second);
|
53
|
|
-// ++iter;
|
54
|
|
-// }
|
55
|
|
-// pt_node.put_child("properties", pt_subitem);
|
56
|
|
-
|
57
|
|
-// return true;
|
58
|
|
-// } |