Changeset 6382
- Timestamp:
- Jun 16, 2016, 3:31:43 PM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 2 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) { -
geovis/trunk/IData.h
r5852 r6382 67 67 }; 68 68 69 extern void iDataInit(const char *username, const char *hub = NULL);69 extern void iDataInit(const char *username, const char *hubURL = NULL); 70 70 extern void iDataCleanup(); 71 71 extern void getCollectionList(std::vector<Collection>& list);
Note: See TracChangeset
for help on using the changeset viewer.