xml_gm_params

The XML Google Maps xml gm params class.

Defined (1)

The class is defined in the following location(s).

/xmlgooglemaps_helper.php  
  1. class xml_gm_params { 
  2.  
  3. function xml_gm_params() { 
  4. $this->width = intval(get_option(key_xmlgm_width)); 
  5. $this->height = intval(get_option(key_xmlgm_height)); 
  6. $this->align = intval(get_option(key_xmlgm_align)); 
  7. $this->googleMapsAPIKey = get_option(key_xmlgm_uid); 
  8. $this->viewStyle = get_option(key_xmlgm_viewstyle); 
  9. $this->urlDisplayMode = get_option(key_xmlgm_urldisplaymode); 
  10. $this->panZoomControl = get_option(key_xmlgm_panzoomcontrol); 
  11. $this->overViewMapControl = get_option(key_xmlgm_overviewmap); 
  12. $this->scaleControl = get_option(key_xmlgm_scalecontrol); 
  13. $this->mapTypeControl = get_option(key_xmlgm_maptypecontrol); 
  14. $this->mapNormal = get_option(key_xmlgm_mapnorm); 
  15. $this->mapHybrid = get_option(key_xmlgm_maphyb); 
  16. $this->mapSatellite = get_option(key_xmlgm_mapsat); 
  17. $this->mapPhysical = get_option(key_xmlgm_mapphy); 
  18. $this->mapEarth = get_option(key_xmlgm_mapearth); 
  19. $this->dragging = get_option(key_xmlgm_dragging); 
  20. $this->doubleClickZoom = get_option(key_xmlgm_doubleClickZoom); 
  21. $this->continuousZoom = get_option(key_xmlgm_continuousZoom); 
  22. $this->googleBar = get_option(key_xmlgm_googleBar); 
  23. $this->scrollWheelZoom = get_option(key_xmlgm_scrollWheelZoom); 
  24. $this->measurement = get_option(key_xmlgm_elevationmeasurement); 
  25. $this->speedscale = get_option(key_xmlgm_speedscale); 
  26.  
  27. $this->kmlParsing = get_option(key_xmlgm_kmlparsing); 
  28.  
  29. $this->gpxLineColor = get_option(key_xmlgm_linecolor); 
  30. $this->gpxLineWidth = intval(get_option(key_xmlgm_linewidth)); 
  31. $this->gpxLineOpacity = intval(get_option(key_xmlgm_lineopacity)); 
  32. $this->gpxView = get_option(key_xmlgm_gpxview); 
  33. $this->gpxElevationLineColor = str_replace("#", "", get_option(key_xmlgm_elevlinecolor)); 
  34. $this->gpxElevationChart = get_option(key_xmlgm_elevationchart); 
  35. $this->gpxElevationLineWidth = intval(get_option(key_xmlgm_elelinewidth)); 
  36. $this->gpxElevationChartHeight = intval(get_option(key_xmlgm_elevationheight)); 
  37.  
  38. $this->gpxElevationChartTitle = get_option(key_xmlgm_elevationtitle); 
  39. $this->gpxSpeedLineColor = str_replace("#", "", get_option(key_xmlgm_speedlinecolor)); 
  40. $this->gpxSpeedChart = get_option(key_xmlgm_speedchart); 
  41. $this->gpxSpeedLineWidth = intval(get_option(key_xmlgm_speedlinewidth)); 
  42. $this->gpxSpeedChartHeight = intval(get_option(key_xmlgm_speedheight)); 
  43. $this->gpxSpeedChartTitle = get_option(key_xmlgm_speedcharttitle); 
  44. $this->gpxCSSStyle = get_option(key_xmlgm_gpxcssstyle); 
  45. $this->gpxCheckpointMarkerColor = get_option(key_xmlgm_checkpointmapmarkercolor); 
  46. $this->gpxCheckpointInterval = get_option(key_xmlgm_checkpointinterval); 
  47. $this->gpxCheckpointTable = get_option(key_xmlgm_checkpointtable); 
  48. $this->gpxCheckpointTableTemplate = get_option(key_xmlgm_checkpointtabletempl); 
  49. $this->gpxCheckpointTableRowTemplate = get_option(key_xmlgm_checkpointtablerowtempl); 
  50. $this->gpxWaypointMarkerTemplate = get_option(key_xmlgm_gpxmarkertempl); 
  51. $this->gpxDirectOpenWPLink = get_option(key_xmlgm_gpxdirectopenwplink); 
  52. $this->nggalMarkerTemplate = get_option(key_xmlgm_nggmarkertempl); 
  53.  
  54. if (strlen($this->gpxCheckpointTableTemplate)==0) { 
  55. $filename = dirname(__FILE__)."/defaultcptable.template"; 
  56. if (file_exists($filename)) { 
  57. $handle = fopen ($filename, "r"); 
  58. $this->gpxCheckpointTableTemplate = fread ($handle, filesize ($filename)); 
  59. fclose ($handle); 
  60. if (strlen($this->gpxCheckpointTableRowTemplate)==0) { 
  61. $filename = dirname(__FILE__)."/defaultcptablerow.template"; 
  62. if (file_exists($filename)) { 
  63. $handle = fopen ($filename, "r"); 
  64. $this->gpxCheckpointTableRowTemplate = fread ($handle, filesize ($filename)); 
  65. fclose ($handle); 
  66. if (strlen($this->gpxWaypointMarkerTemplate)==0) { 
  67. $filename = dirname(__FILE__)."/defaultgpxmarker.template"; 
  68. if (file_exists($filename)) { 
  69. $handle = fopen ($filename, "r"); 
  70. $this->gpxWaypointMarkerTemplate = fread ($handle, filesize ($filename)); 
  71. fclose ($handle); 
  72. }  
  73. if (strlen($this->nggalMarkerTemplate)==0) { 
  74. $filename = dirname(__FILE__)."/defaultnggmarker.template"; 
  75. if (file_exists($filename)) { 
  76. $handle = fopen ($filename, "r"); 
  77. $this->nggalMarkerTemplate = fread ($handle, filesize ($filename)); 
  78. fclose ($handle); 
  79. }  
  80.  
  81. var $width = 664; 
  82. var $height = 400; 
  83. var $align = "left"; 
  84. var $googleMapsAPIKey = ""; 
  85. var $viewStyle = "G_NORMAL_MAP"; 
  86. var $urlDisplayMode = "title"; 
  87. var $panZoomControl = "large"; 
  88. var $overViewMapControl = "hide"; 
  89. var $scaleControl = "hide"; 
  90. var $mapTypeControl = "show"; 
  91. var $mapNormal = "show"; 
  92. var $mapHybrid = "show"; 
  93. var $mapSatellite = "show"; 
  94. var $mapPhysical = "hide"; 
  95. var $mapEarth = "hide"; 
  96. var $dragging = "enabled"; 
  97. var $doubleClickZoom = "enabled"; 
  98. var $continuousZoom = "enabled"; 
  99. var $googleBar = "disabled"; 
  100. var $scrollWheelZoom = "enabled"; 
  101. var $kmlParsing = "enabled"; 
  102.  
  103. var $manualZoom = 0; 
  104. var $minLat = 0; 
  105. var $maxLat = 0; 
  106. var $minLon = 0; 
  107. var $maxLon = 0; 
  108. var $zoom = 0; 
  109. var $deltazoom = 0; 
  110.  
  111. var $gpxLineColor = "#0000FF"; 
  112. var $gpxLineWidth = 5; 
  113. var $gpxLineOpacity = 50; 
  114. var $gpxView = "all"; 
  115. var $gpxInterval = 1; 
  116. var $gpxElevationLineColor = "0000FF"; 
  117. var $gpxElevationLineWidth = 5; 
  118. var $gpxElevationChart = "show"; 
  119. var $gpxElevationChartHeight = 200; 
  120. var $measurement = "metric"; 
  121. var $speedscale = "level2"; 
  122. var $gpxSpeedLineColor = "0000FF"; 
  123. var $gpxSpeedLineWidth = 5; 
  124. var $gpxSpeedChart = "hide"; 
  125. var $gpxSpeedChartHeight = 200; 
  126. var $gpxCSSStyle = "font-family: Verdana, Arial, Sans-Serif;"; 
  127. var $gpxSpeedChartTitle = "Speed Profile"; 
  128. var $gpxElevationChartTitle = "Elevation Profile"; 
  129. var $gpxCheckpointInterval = 0; 
  130. var $gpxCheckpointMarkerColor = "red"; 
  131. var $gpxCheckpointTable = "hide"; 
  132. var $gpxDirectOpenWPLink = "dblclick"; 
  133.  
  134. var $gpxCheckpointTableTemplate = ""; 
  135. var $gpxCheckpointTableRowTemplate = ""; 
  136. var $gpxWaypointMarkerTemplate = ""; 
  137. var $nggalMarkerTemplate = ""; 
  138.  
  139. var $nggalGalleries = array(); 
  140. var $nggalPics = array(); 
  141.  
  142. function getNggCount() { 
  143. return count($this->nggalGalleries) + count($this->nggalPics); 
  144.  
  145. function printObjectHTMLComment() { 
  146. print_r("<!-- Debug Info Actual Parameter Object \n"); 
  147. print_r($this); 
  148. print_r("\n -->"); 
  149.  
  150. function setParams($param_string) { 
  151. $manualzoom = 0; 
  152. $vars = split(";", $param_string); 
  153. for ($i=0 ;$i<count($vars);$i++) { 
  154. $varvalue=split("=", $vars[$i]); 
  155. if (count($varvalue)==2) { 
  156. $varvalue[0] = trim($varvalue[0]); 
  157. $varvalue[1] = trim($varvalue[1]); 
  158. switch (strtolower($varvalue[0])) { 
  159. case "kmlparsing": 
  160. $this->kmlParsing = $varvalue[1]; 
  161. break; 
  162. case "ngg_gallery": 
  163. if (is_numeric($varvalue[1])) { 
  164. $this->nggalGalleries[] = intval($varvalue[1]); 
  165. break; 
  166. case "ngg_picture": 
  167. if (is_numeric($varvalue[1])) { 
  168. $this->nggalPics[] = intval($varvalue[1]); 
  169. break; 
  170. case "dragging": 
  171. $this->dragging = $varvalue[1]; 
  172. break; 
  173. case "doubleclickzoom": 
  174. $this->doubleClickZoom = $varvalue[1]; 
  175. break; 
  176. case "continuouszoom": 
  177. $this->continuousZoom = $varvalue[1]; 
  178. break; 
  179. case "googlebar": 
  180. $this->googleBar = $varvalue[1]; 
  181. break; 
  182. case "scrollwheelzoom": 
  183. $this->scrollWheelZoom = $varvalue[1]; 
  184. break; 
  185. case "urldisplaymode": 
  186. $this->urlDisplayMode = $varvalue[1]; 
  187. break; 
  188. case "maptype": 
  189. $this->viewStyle = $varvalue[1]; 
  190. break; 
  191. case "width": 
  192. if (is_numeric($varvalue[1])) { 
  193. $this->width = intval($varvalue[1]); 
  194. break; 
  195. case "height": 
  196. if (is_numeric($varvalue[1])) { 
  197. $this->height = intval($varvalue[1]); 
  198. break; 
  199. case "align": 
  200. $this->align = $varvalue[1]; 
  201. break; 
  202. case "panzoomcontrol": 
  203. $this->panZoomControl = $varvalue[1]; 
  204. break; 
  205. case "overviewmapcontrol": 
  206. $this->overViewMapControl = $varvalue[1]; 
  207. break; 
  208. case "scalecontrol": 
  209. $this->scaleControl = $varvalue[1]; 
  210. break; 
  211. case "maptypecontrol": 
  212. $this->mapTypeControl = $varvalue[1]; 
  213. break; 
  214. case "mapnormal": 
  215. $this->mapNormal = $varvalue[1]; 
  216. break; 
  217. case "maphybrid": 
  218. $this->mapHybrid = $varvalue[1]; 
  219. break; 
  220. case "mapsat": 
  221. $this->mapSatellite = $varvalue[1]; 
  222. break; 
  223. case "mapearth": 
  224. $this->mapEarth = $varvalue[1]; 
  225. break; 
  226. case "mapphysical": 
  227. $this->mapPhysical = $varvalue[1]; 
  228. break; 
  229. case "gpxinterval": 
  230. if (is_numeric($varvalue[1])) { 
  231. $this->gpxInterval = intval($varvalue[1]); 
  232. break; 
  233. case "gpxcheckpointtable": 
  234. $this->gpxCheckpointTable = $varvalue[1]; 
  235. break; 
  236. case "gpxcolor": 
  237. $this->gpxLineColor = myFunctions::colorName2Hex($varvalue[1]); 
  238. break; 
  239. case "gpxelevationcolor": 
  240. $this->gpxElevationLineColor = str_replace("#", "", myFunctions::colorName2Hex($varvalue[1])); 
  241. break; 
  242. case "gpxelevation": 
  243. $this->gpxElevationChart = $varvalue[1]; 
  244. break; 
  245. case "gpxelevationmeasurement": 
  246. case "measurement": 
  247. $this->measurement = $varvalue[1]; 
  248. break; 
  249. case "speedscale": 
  250. $this->speedscale = $varvalue[1]; 
  251. break; 
  252. case "gpxspeedchartcolor": 
  253. $this->gpxSpeedLineColor = str_replace("#", "", myFunctions::colorName2Hex($varvalue[1])); 
  254. break; 
  255. case "gpxspeedchart": 
  256. $this->gpxSpeedChart = $varvalue[1]; 
  257. break; 
  258. case "gpxlinewidth": 
  259. if (is_numeric($varvalue[1])) { 
  260. $this->gpxLineWidth = intval($varvalue[1]); 
  261. break; 
  262. case "gpxelevationlinewidth": 
  263. if (is_numeric($varvalue[1])) { 
  264. $this->gpxElevationLineWidth = intval($varvalue[1]); 
  265. break; 
  266. case "gpxelevationheight": 
  267. if (is_numeric($varvalue[1])) { 
  268. $this->gpxElevationChartHeight = intval($varvalue[1]); 
  269. break; 
  270. case "gpxcheckpointinterval": 
  271. if (is_numeric($varvalue[1])) { 
  272. $this->gpxCheckpointInterval = floatval($varvalue[1]); 
  273. break; 
  274. case "gpxcheckpointmarkercolor": 
  275. $this->gpxCheckpointMarkerColor = $varvalue[1]; 
  276. break; 
  277. case "gpxspeedchartlinewidth": 
  278. if (is_numeric($varvalue[1])) { 
  279. $this->gpxSpeedLineWidth = intval($varvalue[1]); 
  280. break; 
  281. case "gpxspeedchartheight": 
  282. if (is_numeric($varvalue[1])) { 
  283. $this->gpxSpeedChartHeight = intval($varvalue[1]); 
  284. break; 
  285. case "gpxlineopacity": 
  286. if (is_numeric($varvalue[1])) { 
  287. $this->gpxLineOpacity = intval($varvalue[1]); 
  288. break; 
  289. case "gpxdirectopenlink": 
  290. $this->gpxDirectOpenWPLink = $varvalue[1]; 
  291. break; 
  292. case "gpxview": 
  293. $this->gpxView = $varvalue[1]; 
  294. break; 
  295. case "maxlat": 
  296. if (is_numeric($varvalue[1])) { 
  297. $this->maxLat = doubleval($varvalue[1]); 
  298. $this->manualZoom++; 
  299. break; 
  300. case "maxlon": 
  301. if (is_numeric($varvalue[1])) { 
  302. $this->maxLon = doubleval($varvalue[1]); 
  303. $this->manualZoom++; 
  304. break; 
  305. case "minlat": 
  306. if (is_numeric($varvalue[1])) { 
  307. $this->minLat = doubleval($varvalue[1]); 
  308. $this->manualZoom++; 
  309. break; 
  310. case "minlon": 
  311. if (is_numeric($varvalue[1])) { 
  312. $this->minLon = doubleval($varvalue[1]); 
  313. $this->manualZoom++; 
  314. break; 
  315. case "zoom": 
  316. if (is_numeric($varvalue[1])) { 
  317. $this->zoom = intval($varvalue[1]); 
  318. break; 
  319. case "deltazoom": 
  320. if (is_numeric($varvalue[1])) { 
  321. $this->deltazoom = intval($varvalue[1]); 
  322. break;