Skip to content
Browse files

fix title labelling

  • Loading branch information...
1 parent 5a5ac7e commit 2e04a134e59a4c9049221176fdd1fccad230e9d2 @akrherz committed May 31, 2012
Showing with 25 additions and 11 deletions.
  1. +23 −9 htdocs/GIS/apps/rview/lib.php
  2. +1 −1 htdocs/GIS/apps/rview/warnings.phtml
  3. +1 −1 htdocs/GIS/apps/rview/warnings_plot.php
View
32 htdocs/GIS/apps/rview/lib.php
@@ -33,15 +33,29 @@ function tv_logo($map, $imgObj, $titlet)
}
-function mktitle($map, $imgObj, $titlet) {
- $layer = $map->getLayerByName("credits");
-
- // point feature with text for location
- $point = ms_newpointobj();
- $point->setXY(10, 15);
-
- $point->draw($map, $layer, $imgObj, 0,
- $titlet);
+function mktitle($map, $imgObj, $titlet, $subtitle="", $width=640) {
+ $height = ($subtitle == "")? 36: 53;
+ $layer = ms_newLayerObj($map);
+ $layer->set("status", MS_ON );
+ $layer->set("type", MS_LAYER_POLYGON );
+ $layer->set("transform", MS_OFF );
+ $wkt = "POLYGON((0 0, 0 $height, $width $height, $width 0, 0 0))";
+ $layer->addFeature(ms_shapeObjFromWkt($wkt));
+
+ $layerc0 = ms_newClassObj($layer);
+ $layerc0s0 = ms_newStyleObj($layerc0);
+ $layerc0s0->color->setRGB(0,0,0);
+ $layer->draw($imgObj);
+
+ $tlayer = $map->getLayerByName("iem_headerbar_title");
+ $point = ms_newpointobj();
+ $point->setXY(82, 22);
+ $point->draw($map, $tlayer, $imgObj, 0, $titlet);
+ if ($subtitle != ""){
+ $point = ms_newpointobj();
+ $point->setXY(82, 39);
+ $point->draw($map, $tlayer, $imgObj, 1, $subtitle);
+ }
}
function mklogolocal($map, $imgObj) {
View
2 htdocs/GIS/apps/rview/warnings.phtml
@@ -158,7 +158,7 @@ if ($autopilot) $BODYEXTRA = "onLoad=\"handsOff2();\"";
$heightadd = 0;
-$maptitle = "IEM NEXRAD composite base reflect valid:";
+$maptitle = "IEM NEXRAD Composite Base Reflectivity";
if (intval($loop) == 1){
$urls = Array();
View
2 htdocs/GIS/apps/rview/warnings_plot.php
@@ -294,8 +294,8 @@
if (! isset($_GET["iem"])) {
$map->embedScalebar($img);
- mktitle($map, $img, " $maptitle $d");
$map->drawLabelCache($img);
+ mktitle($map, $img, $maptitle, "Valid: $d", $width);
mklogolocal($map, $img);
} else {
tv_logo($map,$img, " $d");

0 comments on commit 2e04a13

Please sign in to comment.
Something went wrong with that request. Please try again.