getSettings() as $setting => $val) { if (! isset($visualizationSettings[$setting])) { $visualizationSettings[$setting] = $val; } } } if ($format == 'svg') { return $visualization->asSvg(); } elseif ($format == 'png') { return $visualization->asPng(); } elseif ($format == 'ol') { return $visualization->asOl(); } } } /** * Generate visualization for the GIS query results and save it to a file. * * @param array $data data for the status chart * @param array $visualizationSettings settings used to generate the chart * @param string $format format of the visulaization * @param string $fileName file name * * @return file File containing the visualization */ function PMA_GIS_saveToFile($data, $visualizationSettings, $format, $fileName) { include_once './libraries/gis/pma_gis_visualization.php'; include_once './libraries/gis/pma_gis_factory.php'; if (isset($data[0])) { $visualization = new PMA_GIS_Visualization($data, $visualizationSettings); if ($format == 'svg') { $visualization->toFileAsSvg($fileName); } elseif ($format == 'png') { $visualization->toFileAsPng($fileName); } elseif ($format == 'pdf') { $visualization->toFileAsPdf($fileName); } } } /** * Function to get html for the lebel column and spatial column * * @param string $column the column type. i.e either "labelColumn" * or "spatialColumn" * @param array $columnCandidates the list of select options * @param array $visualizationSettings visualization settings * * @return string $html */ function PMA_getHtmlForColumn($column, $columnCandidates, $visualizationSettings) { $html = ''; $html .= ''; $html .= ''; return $html; } /** * Function to get HTML for the option of using open street maps * * @param boolean $isSelected the default value * * @return string HTML string */ function PMA_getHtmlForUseOpenStreetMaps($isSelected) { $html = ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= PMA_URL_getHiddenInputs($url_params); $html .= ''; $html .= PMA_getHtmlForColumn( "labelColumn", $labelCandidates, $visualizationSettings ); $html .= PMA_getHtmlForColumn( "spatialColumn", $spatialCandidates, $visualizationSettings ); $html .= ''; $html .= '
isHttps()) { $isSelected = isset($visualizationSettings['choice']) ? true : false; $html .= PMA_getHtmlForUseOpenStreetMaps($isSelected); } $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
 
'; $html .= '
'; $html .= $visualization; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; return $html; } ?>