本文整理汇总了PHP中ms_newMapObj函数的典型用法代码示例。如果您正苦于以下问题:PHP ms_newMapObj函数的具体用法?PHP ms_newMapObj怎么用?PHP ms_newMapObj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ms_newMapObj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: url_createLayer
private function url_createLayer()
{
if (!is_file($_SESSION['PM_TPL_MAP_FILE'])) {
error_log("P.MAPPER ERROR: cannot find template map. Check INI settings for 'tplMapFile'");
return false;
}
$tplMap = ms_newMapObj($_SESSION['PM_TPL_MAP_FILE']);
$poiLayer = $tplMap->getLayerByName("poi");
$txtLayer = ms_newLayerObj($this->map, $poiLayer);
$txtLayer->set("name", "url_txtlayer");
$txtLayer->set("type", 0);
$txtLayer->set("status", MS_ON);
$url_points = $_SESSION['url_points'];
foreach ($url_points as $upnt) {
// Create line, add xp point, create shape and add line and text, add shape to layer
//$pointList = explode(",", $f);
$px = $upnt[0];
$py = $upnt[1];
$txt = $upnt[2];
$newLine = ms_newLineObj();
$newLine->addXY($px, $py);
$newShape = ms_newShapeObj(0);
$newShape->add($newLine);
$newShape->set("text", $txt);
$txtLayer->addFeature($newShape);
}
}
示例2: __construct
function __construct($map_file = "", $perfil = "", $locaplic = "", $urli3geo = "", $editores = "", $idioma = "pt", $filtro = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
$perfil = str_replace(" ", ",", $perfil);
$this->perfil = explode(",", $perfil);
$this->locaplic = $locaplic;
$this->urli3geo = $urli3geo;
$this->idioma = $idioma;
$this->filtro = $filtro;
if ($map_file != "" && file_exists($map_file)) {
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = $map_file;
if ($this->mapa) {
$c = $this->mapa->numlayers;
for ($i = 0; $i < $c; ++$i) {
$this->layers[] = $this->mapa->getlayer($i);
}
}
}
//
//verifica o usuario logado esta cadastrado como um dos publicadores
//editores podem ver as coisas marcadas como não publicado
//no sistema de administração
//
$this->editor = false;
$this->editores = "";
$this->editor = $this->verificaPapelSessao(3);
}
示例3: __construct
function __construct($map_file, $locaplic = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
if (file_exists($locaplic . "/funcoes_gerais.php")) {
include_once $locaplic . "/funcoes_gerais.php";
} else {
include_once "funcoes_gerais.php";
}
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
}
示例4: drawKCCI
function drawKCCI($extents)
{
$width = "150";
$height = "150";
/** ----------------------- */
$map = ms_newMapObj("mosaic.map");
$map->set("width", $width);
$map->set("height", $height);
$map->setextent($extents[0], $extents[1], $extents[2], $extents[3]);
$map->setProjection("init=epsg:4326");
$counties = $map->getlayerbyname("counties_unproj");
$counties->set("status", MS_ON);
$radarL = $map->getlayerbyname("KCCI");
$radarL->set("status", MS_ON);
$img = $map->prepareImage();
$radarL->draw($img);
$counties->draw($img);
$url = $img->saveWebImage(MS_PNG, 0, 0, -1);
return $url;
}
示例5: __construct
function __construct($map_file, $tema = "", $locaplic = "", $ext = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
include_once dirname(__FILE__) . "/funcoes_gerais.php";
$this->locaplic = $locaplic;
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
$this->layer = "";
if ($tema != "" && @$this->mapa->getlayerbyname($tema)) {
$this->layer = $this->mapa->getlayerbyname($tema);
}
$this->nome = $tema;
if ($ext && $ext != "") {
$e = explode(" ", $ext);
$extatual = $this->mapa->extent;
$extatual->setextent(min($e[0], $e[2]), min($e[1], $e[3]), max($e[0], $e[2]), max($e[1], $e[3]));
}
}
示例6: markerclusterEstilos
function markerclusterEstilos($map_file, $layer, $tipoEstilos)
{
if ($tipoEstilos == "default") {
$tipoEstilos = '{"ponto":{url : i3GEO.configura.locaplic + "/imagens/google/symbol_blank.png",height : 20,width : 20},"estilos":[{url : i3GEO.configura.locaplic + "/imagens/google/m1.png",height : 53,width : 53},{url : i3GEO.configura.locaplic + "/imagens/google/m2.png",height : 56,width : 56},{url : i3GEO.configura.locaplic + "/imagens/google/m3.png",height : 66,width : 66},{url : i3GEO.configura.locaplic + "/imagens/google/m4.png",height : 78,width : 78},{url : i3GEO.configura.locaplic + "/imagens/google/m5.png",height : 90,width : 90}]}';
} else {
$tipoEstilos = array();
$mapa = ms_newMapObj($map_file);
$l = $mapa->getlayerbyname($layer);
$nc = $l->numclasses;
// a primeira classe e o ponto que nao entra no cluster
for ($c = 1; $c < $nc; $c++) {
$classe = $l->getclass($c);
$estilo = $classe->getstyle(0);
$tipoEstilos[] = array("url" => $estilo->symbol, "height" => $estilo->size, "width" => $estilo->size);
}
$classe = $l->getclass(0);
$estilo = $classe->getstyle(0);
$tipoEstilos = json_encode(array("ponto" => array("url" => $estilo->symbol, "height" => $estilo->size, "width" => $estilo->size), "estilos" => $tipoEstilos));
}
return $tipoEstilos;
}
示例7: heatmapGradiente
function heatmapGradiente($map_file, $layer, $tipoGradiente)
{
if ($tipoGradiente == "default") {
$gradiente = '{"gradient":{"0.45" : "rgb(0,0,255)","0.55" : "rgb(0,255,255)","0.65" : "rgb(0,255,0)","0.95" : "yellow","1.0" : "rgb(255,0,0)"}}';
} else {
$gradiente = array();
$mapa = ms_newMapObj($map_file);
$l = $mapa->getlayerbyname($layer);
$nc = $l->numclasses;
for ($c = 0; $c < $nc; $c++) {
$classe = $l->getclass($c);
$estilo = $classe->getstyle(0);
$nome = $classe->name;
$cor = $estilo->color;
$scor = "rgb(" . $cor->red . "," . $cor->green . "," . $cor->blue . ")";
$gradiente[$nome] = $scor;
}
//echo $map_file;exit;
$gradiente = json_encode(array("gradient" => $gradiente));
}
return $gradiente;
}
示例8: incluiWMC
function incluiWMC()
{
global $map_file, $arquivo;
$mapa = ms_newMapObj($map_file);
$proj = $mapa->getprojection();
$mapa->loadMapContext($arquivo, "MS_TRUE");
$layers = $mapa->getalllayernames();
foreach ($layers as $nome) {
$l = $mapa->getlayerbyname($nome);
$con = $l->connectiontype;
if (($con == 7 || $con == 9) && $l->getmetadata("tema") == "") {
if ($l->getmetadata("wms_title") != "") {
$l->setmetadata("tema", $l->getmetadata("wms_title"));
} else {
$l->setmetadata("tema", $l->getmetadata("wms_name"));
}
}
}
$mapa->setprojection($proj);
$mapa->save($map_file);
echo "Arquivo carregado com sucesso!";
}
示例9: Main
function Main($map)
{
$GLOBALS["goMap"] = ms_newMapObj("{$map}");
//batas koordinat seluruh peta, untuk tool 'zoom all'
$GLOBALS["gfMinX"] = (double) $GLOBALS["goMap"]->extent->minx;
$GLOBALS["gfMinY"] = (double) $GLOBALS["goMap"]->extent->miny;
$GLOBALS["gfMaxX"] = (double) $GLOBALS["goMap"]->extent->maxx;
$GLOBALS["gfMaxY"] = (double) $GLOBALS["goMap"]->extent->maxy;
//set nilai $aVars dengan nilai parameter URL
if (sizeof($_POST) > 0) {
$aVars = $_POST;
} else {
if (sizeof($_GET) > 0) {
$aVars = $_GET;
} else {
$aVars = array();
}
}
//tool navigasi default: zoom in
$GLOBALS["gszCurrentTool"] = "ZOOM_IN";
$GLOBALS["gShowQueryResults"] = FALSE;
//proses parameter URL
ProcessURLArray($aVars);
}
示例10: dl
if (array_search("MapScript", $exts) != TRUE) {
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
if (!@dl('php_mapscript_48.dll')) {
dl('php_mapscript.dll');
}
} else {
dl('php_mapscript.so');
}
}
require dirname(__FILE__) . "/../../classesphp/funcoes_gerais.php";
$nomes = nomeRandomico();
$temp = str_replace(".map", "xxx.map", $map_file);
$map = ms_newMapObj($map_file);
$map->save($temp);
substituiCon($temp, $postgis_mapa);
$map = ms_newMapObj($temp);
substituiCon($temp, $postgis_mapa);
$w = $map->width;
$h = $map->height;
$legenda = $map->legend;
$legenda->set("status", MS_EMBED);
//altera o nome das classes vazias
$temas = $map->getalllayernames();
foreach ($temas as $tema) {
$layer = $map->getlayerbyname($tema);
if ($layer->data != "" && strtolower($layer->getmetadata("escondido")) != "sim" && strtolower($layer->getmetadata("tema")) != "nao") {
if ($layer->numclasses > 0) {
$classe = $layer->getclass(0);
if ($classe->name == "" || $classe->name == " ") {
$classe->set("name", $layer->getmetadata("tema"));
}
示例11: array
$round = array("prec" => 2, "gdd50" => 0, "gdd32" => 0, "et" => 2, "sgdd50" => 0, "sgdd52" => 0, "sdd86" => 0, "srad" => 0);
$today = time();
if ($gs_end >= $today) {
$gs_end = $today;
}
$emonth = strftime("%m", $gs_end);
$eday = strftime("%d", $gs_end);
$smonth = strftime("%m", $gs_start);
$sday = strftime("%d", $gs_start);
$varDef = array("gdd50" => "Growing Degree Days (base=50)", "gdd32" => "Growing Degree Days (base=32)", "et" => "Potential Evapotranspiration", "prec" => "Precipitation", "srad" => "Solar Radiation (langleys)", "sgdd50" => "Soil Growing Degree Days (base=50)", "sgdd52" => "Soil Growing Degree Days (base=52)", "sdd86" => "Stress Degree Days (base=86)");
$rnd = array("gdd50" => 0, "gdd32" => 0, "et" => 2, "c11" => 2, "prec" => 2, "srad" => 0, "sgdd50" => 0, "sgdd52" => 0, "sdd86" => 0);
$myStations = $ISUAGcities;
$height = $height;
$width = $width;
$proj = "init=epsg:26915";
$map = ms_newMapObj("../../../../data/gis/base26915.map");
$map->setsize($width, $height);
$map->setProjection($proj);
$map->setextent(175000, 4440000, 775000, 4890000);
$counties = $map->getlayerbyname("counties");
$counties->set("status", MS_ON);
$snet = $map->getlayerbyname("station_plot");
$snet->set("status", MS_ON);
$iards = $map->getlayerbyname("iards");
$iards->set("status", MS_ON);
$bar640t = $map->getlayerbyname("bar640t");
$bar640t->set("status", MS_ON);
$ponly = $map->getlayerbyname("pointonly");
$ponly->set("status", MS_ON);
$states = $map->getlayerbyname("states");
$states->set("status", MS_ON);
示例12: iemdb
<?php
include "../../config/settings.inc.php";
include "../../include/database.inc.php";
$con = iemdb("postgis");
$sql = "SELECT max(valid) as valid from roads_current";
$rs = pg_query($con, $sql);
$row = pg_fetch_array($rs, 0);
$valid = substr($row["valid"], 0, 16);
$map = ms_newMapObj('roads.map');
//$map->setProjection("init=epsg:4326");
$map->setProjection("init=epsg:26915");
$map->selectOutputFormat("jpeg");
$map->setextent(122487.56, 4443095.235, 809431.656, 4919662.5);
$map->set("width", 720);
$map->set("height", 496);
$img = $map->prepareImage();
$background = $map->getlayerbyname("kwwlback");
$background->set("status", MS_ON);
$background->set("data", "images/26915/kcau.tif");
$background->draw($img);
//$counties = $map->getlayerbyname("counties");
//$counties->set("status", MS_ON);
//$counties->draw($img);
//$states = $map->getlayerbyname("states");
//$states->set("status", MS_ON);
//$states->draw($img);
$roads = $map->getlayerbyname("roads");
$roads->set("status", MS_ON);
if (isset($_GET["extreme"])) {
$roads->set("data", "geom from (select b.type as rtype, b.int1, b.oid as boid, b.segid, c.cond_code, b.geom from roads_base b, roads_2007_log c WHERE b.segid = c.segid and c.valid = '2007-03-02 00:11' and b.type > 1 ORDER by b.segid DESC) as foo using UNIQUE boid using SRID=26915");
示例13: elseif
} elseif (isset($_SESSION['rq_lei_f_idcat'])) {
$_REQUEST['rq_lei_f_idcat']=$_SESSION['rq_lei_f_idcat'];
}*/
// ========================================================================
// special hack: si paramètre spécial spcsc25=tux129 pass? en get (par l'url)
// utilise un fichier map specifique limousinhck.map)
$mapfile = PROOT . "/maps/{$mapfile}";
if (!empty($_REQUEST['spcsc25'])) {
if ($_REQUEST['spcsc25'] == "tux129") {
$_SESSION['spcsc25'] = "tux129";
} else {
unset($_SESSION['spcsc25']);
}
}
$mapfile = !empty($_SESSION['spcsc25']) ? PROOT . "/maps/limousinhck.map" : $mapfile;
$e_map = ms_newMapObj($mapfile);
// ces param?tres sont r?cup?r?s par d?faut dans le mapfile static
// ils seront maj si la variable extent est d?finie
// celle-ci est pass?e en hidden
$extminx = $extminxmf = $e_map->extent->minx;
$extminy = $extminymf = $e_map->extent->miny;
$extmaxx = $extmaxxmf = $e_map->extent->maxx;
$extmaxy = $extmaxymf = $e_map->extent->maxy;
// fonction qui d?sactivait dans le mapfile toutes les couches qui
// ne font pas partie du groupe "fond"
// Pourquoi ?????
/*$lay = array("fond");
$layers = $e_map->getAllGroupNames();
foreach ($layers as $l) {
$maplayer[] = $l;
$tl = $e_map->getLayersIndexByGroup($l);
示例14: header
if (getenv("HTTP_IF_MODIFIED_SINCE") == gmdate("D, d M Y H:i:s", $cache_time) . " GMT") {
header("HTTP/1.0 304 Not Modified");
$send_body = false;
}
//more headers
header("Expires: " . gmdate("D, d M Y H:i:s", $cache_time + $expires) . " GMT");
header("Cache-Control: max-age={$expires}, must-revalidate");
//header('Content-Length: ' . strlen($body));
//if we're not cacheing
if ($send_body) {
readfile($legendIconCacheFile);
}
exit;
}
}
$oMap = ms_newMapObj($_SESSION['maps'][$mapName]);
$oLayer = $oMap->getLayerByName($REQUEST_VARS['layername']);
$oClass = $oLayer->getClass($REQUEST_VARS['classindex']);
$width = $oMap->legend->keysizex;
$height = $oMap->legend->keysizey;
if ($width <= 0) {
$width = 16;
}
if ($height <= 0) {
$height = 16;
}
$oImg = $oClass->createLegendIcon($width, $height);
/* TODO: can we figure out what the content type is? */
header('Content-type: image/png');
if ($cacheLegendIcons) {
$oImg->saveImage($legendIconCacheFile);
示例15: array
$nomeMap = $locaplic . "/temas/" . $tema . ".map";
} else {
if (file_exists($tema)) {
$nomeMap = $tema;
} else {
// acontece caso o mapfile tenha sido gerado na pasta
// temporaria por algum sistema
if (file_exists($dir_tmp . "/" . $tema . ".map")) {
$nomeMap = $dir_tmp . "/" . $tema . ".map";
}
}
}
if ($nomeMap != "") {
$layersNomes = array();
$layers = array();
$maptemp = @ms_newMapObj($nomeMap);
if ($maptemp) {
$nlayers = $maptemp->numlayers;
for ($i = 0; $i < $nlayers; ++$i) {
$layern = $maptemp->getLayer($i);
//
//verifica se o layer contem ferramentas parametrizadas
//
foreach ($listaFerramentas as $lf) {
$meta = $layern->getmetadata($lf);
if ($meta != "") {
$ferramentas[] = "'" . $lf . "':" . $meta;
}
}
$ferramentas = '{' . implode(",", $ferramentas) . '}';
if ($layern->getmetadata("PLUGINI3GEO") != "") {