public function __construct($map, $pluginConfig = null) { $this->pluginConfig = array(); if (!$pluginConfig && array_key_exists('ms_auto_refmap', $_SESSION['pluginsConfig'])) { $pluginConfig = $_SESSION['pluginsConfig']['ms_auto_refmap']; } $this->pluginConfig = $pluginConfig; $this->loadConfigValues(); $this->globalMap = $map; if (isset($_SESSION['MS_VERSION'])) { $this->msVersion = $_SESSION['MS_VERSION']; } else { $ms_Version = ms_GetVersion(); $msvL = explode('.', substr($ms_Version, strpos($ms_Version, "version") + 8, 5)); $this->msVersion = (double) "{$msvL[0]}.{$msvL[1]}{$msvL[2]}"; } $this->internalMap = $this->msVersion < 6 ? $map->clone() : clone $map; // bug in MS 6 ? if ($_SESSION['MS_VERSION'] >= 6) { $this->internalMap->set('defresolution', $map->defresolution); } $this->initMapValues(); }
\t\tcomo o SAIKU e ferramentas que precisam de softwares específicos, veja o link \t\t<a href='http://moodle.gvsig-training.com/course/view.php?id=11' >http://moodle.gvsig-training.com/course/view.php?id=11 \t\t</a></div> \t\t<div class="alert alert-success" role="alert"> \t\t\t<li>Seu endereço IP <span class="label label-default">{$ip}</span></li> \t\t\t<li>Sistema operacional <span class="label label-default">{$os}</span></li> \t\t\t<li>PHP (a versão deve ser a 5x) <span class="label label-default">{$phpversion}</span></li> \t\t</div> HTML; include_once "../classesphp/carrega_ext.php"; include_once "../classesphp/funcoes_gerais.php"; $versao = versao(); $versao = $versao["principal"]; $exts = get_loaded_extensions(); echo "<h3>MapServer:</h3><pre>"; echo ms_GetVersion(); echo "</pre>"; echo "<h3>Array que armazena os parâmetros da versão:</h3><pre>"; var_dump(versao()); echo "</pre>"; echo "<h3>Configuração da projeção default: (<a href='http://moodle.gvsig-training.com/mod/book/view.php?id=5090&chapterid=114'>saiba mais</a>)</h3>"; if (!isset($i3GeoProjDefault)) { echo '<div class="alert alert-warning" role="alert">A variável de configuração i3GeoProjDefault não existe no ms_configura.php. Será utilizada a projeção 4326</div>'; } echo "<pre>"; var_dump(pegaProjecaoDefault()); echo "</pre>"; if (!function_exists("ms_GetVersion")) { echo '<div class="alert alert-warning" role="alert">PARECE QUE O MAPSERVER NAO ESTA INSTALADO!!!</div>'; } if (get_cfg_var("safe_mode") == 1) {
function versao() { $v = "5.0.0"; $vs = explode(" ", ms_GetVersion()); $cvs = count($vs); for ($i = 0; $i < $cvs; ++$i) { if (trim(strtolower($vs[$i])) == "version") { $v = $vs[$i + 1]; } } $versao["completa"] = $v; $v = explode(".", $v); $versao["principal"] = $v[0]; $versao["inteiro"] = ms_GetVersionInt(); return $versao; }
/** * Check INI settings for errors */ private function _initConfig() { /*** Test if resolution tag is set ***/ if ($this->map->resolution != "96") { pm_logDebug(1, "P.MAPPER-ERROR: RESOLUTION tag not set to 96. This value is needed for proper function of PDF print."); } /*** LAYERS ***/ // Test for groups with blanks $gList = $this->map->getAllGroupNames(); foreach ($gList as $gr) { if (preg_match('/\\s/', $gr)) { pm_logDebug(0, "P.MAPPER-ERROR: Group '{$gr}' defined in the map file has blanks in its name. This is not possible for the p.mapper application. Remove blanks or substitute with e.g. '_'."); } } // Test for layers with blanks $gList = $this->map->getAllLayerNames(); foreach ($gList as $ly) { if (preg_match('/\\s/', $ly)) { pm_logDebug(0, "P.MAPPER-ERROR: Layer '{$ly}' defined in the map file has blanks in its name. This is not possible for the p.mapper application. Remove blanks or substitute with e.g. '_'."); } } /*** USER AGENT (Browser type) ***/ $ua = $_SERVER["HTTP_USER_AGENT"]; if (preg_match("/gecko/i", $ua)) { $_SESSION['userAgent'] = "mozilla"; } elseif (preg_match("/opera/i", $ua)) { $_SESSION['userAgent'] = "opera"; } elseif (preg_match("/MSIE/i", $ua)) { $_SESSION['userAgent'] = "ie"; } $_SESSION['web_imagepath'] = str_replace('\\', '/', $this->map->web->imagepath); $_SESSION['web_imageurl'] = str_replace('\\', '/', $this->map->web->imageurl); $ms_Version = ms_GetVersion(); $msvL = explode('.', substr($ms_Version, strpos($ms_Version, "version") + 8, 5)); $_SESSION['MS_VERSION'] = (double) "{$msvL[0]}.{$msvL[1]}{$msvL[2]}"; // MS >= 6 if ($_SESSION['MS_VERSION'] >= 6) { if ($this->map->defresolution != "96") { pm_logDebug(1, "P.MAPPER-ERROR: DEFRESOLUTION tag not set to 96. This value is needed for proper function of PDF print."); } } }
} /* a filter expression to apply, in the form of an MapServer expression statement */ $filter = isset($_REQUEST['filter']) ? html_entity_decode(urldecode($_REQUEST['filter'])) : false; $filterItem = isset($_REQUEST['filterItem']) ? html_entity_decode(urldecode($_REQUEST['filterItem'])) : false; //echo "<!-- filter: $filter -->\n"; /* a spatial filter in the form on a WKT geometry */ $spatialFilter = isset($_REQUEST['spatialfilter']) && $_REQUEST['spatialfilter'] != '' ? urldecode($_REQUEST['spatialfilter']) : false; //echo "spatial filter is $spatialFilter<BR>"; if (!isset($mapName)) { die('mapname not set'); } if (isset($_SESSION['maps']) && isset($_SESSION['maps'][$mapName])) { $oMap = ms_newMapObj($_SESSION['maps'][$mapName]); } //extension of query template changed as of v5.2.2 $msVersion = ms_GetVersion(); //MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE $versArray = explode(" ", $msVersion); $versNumber = $versArray[2]; $versParts = explode(".", $versNumber); $queryTemplate = "query.qy"; //convert to an integer value to make the comparison easier $versValue = $versParts[0] * 100 + $versParts[1] * 10 + $versParts[2]; if ($versValue >= 522) { $queryTemplate = "query.qy"; } /* add the spatial filter if provided. It is expected to come as a WKT string, so we need to convert it to a shape */ if ($spatialFilter !== false) { $oSpatialFilter = ms_shapeObjFromWkt($spatialFilter); }