Changeset 6382 for geovis/trunk/IData.cpp
- Timestamp:
- Jun 16, 2016, 3:31:43 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/IData.cpp
r5856 r6382 35 35 }; 36 36 #endif 37 static const char *serviceURL = "http://mygeohub.org/api/idata/collection/"; 38 static std::string g_iDataUsername; 37 38 static const char *defaultHubURL = "https://mygeohub.org"; 39 static const std::string servicePath = "/api/idata/collection/"; 40 static std::string serviceURL; 41 static std::string iDataUsername; 39 42 40 43 using namespace IData; 41 44 using namespace osgEarth; 42 45 43 void IData::iDataInit(const char *username, const char *hub )44 { 45 TRACE("user: %s hub: %s", username, hub );46 void IData::iDataInit(const char *username, const char *hubURL) 47 { 48 TRACE("user: %s hub: %s", username, hubURL); 46 49 static bool first = true; 47 g_iDataUsername = username; 50 std::ostringstream oss; 51 std::string hubHost; 52 if (hubURL != NULL) { 53 hubHost = hubURL; 54 } else { 55 hubHost = defaultHubURL; 56 } 57 oss << hubHost << servicePath; 58 serviceURL = oss.str(); 59 iDataUsername = username; 48 60 if (first) { 49 61 curl_global_init(CURL_GLOBAL_DEFAULT); … … 73 85 { 74 86 std::ostringstream oss; 75 oss << serviceURL << commandNames[cmd] << "?username=" << g_iDataUsername;87 oss << serviceURL << commandNames[cmd] << "?username=" << iDataUsername; 76 88 for (std::vector<std::string>::iterator itr = params.begin(); 77 89 itr != params.end(); ++itr) {
Note: See TracChangeset
for help on using the changeset viewer.