// ************************************************************************ // * System-Settings * // ************************************************************************ // What3Words (Options) What3Words_BaseUrl = "https://api.what3words.com/v2"; //Define columns here, includes title and regexp. var config = { columns: [{ name:"latitude", displayName:"Latitude (d)", type: "double", }, { name:"longitude", displayName:"Longitude (d)", type: "double", }, { name:"What3Words", displayName:"What3Words", type: "string", defwidth: 40 }] } var LOG_DEBUG = 0; var LOG_INFO = 1; var LOG_WARN = 2; var LOG_ERR = 3; var LOG_ALERT = 4; var LogLevel = LOG_WARN; vecLogLevel = DOpus.NewVector vecLogLevel.push_back(2); vecLogLevel.push_back("DEBUG"); vecLogLevel.push_back("INFO"); vecLogLevel.push_back("WARNING"); vecLogLevel.push_back("ERROR"); vecLogLevel.push_back("ALERT"); function Logger(Level, strMessage) { if (Level>=LogLevel) { DOpus.OutputString(" " + strMessage); } } // Called by Directory Opus to initialize the script function OnInit(initData){ var uid = "9a9065a5-fe17-434a-9715-ccc787fed193"; var url = "http://resource.dopus.com/viewtopic.php?f=35&p="; initData.name = "What3Words"; initData.desc = "Adds columns for displaying What3Words address from the image location data."; initData.copyright = "wowbagger"; initData.version="0.3"; initData.default_enable=true; initData.min_version = "12.0.0"; initData.config_desc = DOpus.NewMap(); initData.config_desc("What3WordsAPIKey") = "What3words API Key, http://developer.what3words.com/"; initData.config.What3WordsAPIKey = ""; for(i=0;i