[mapserver-users] LABELS ON THE MAP CAN NOT BE DISPLAYED

lovelietha armaluvly_88 at yahoo.com
Tue Jul 26 01:40:48 PDT 2011


Hi everyone,
I used a Chameleon framework to make webGIS,i want to add labels on my
tematic map,but i'm wondering why my map and the label can't be displayed in
the browser when i run it..
Besides,the cursorpos is working,but the map and the label can't be
displayed..
What should i do??

Any suggestions?

The codes is below :

*Mapfile code :*
MAP 
	IMAGETYPE PNG
	EXTENT 114.522156 -3.381501 114.664684 -3.267320
	STATUS ON
	UNITS METERS
	SIZE 450 350
	IMAGECOLOR 255 255 0
	
#
# Mulai pendefinisian layers
#

	LAYER
		NAME Peta_Kota_region
		STATUS DEFAULT
		TYPE POLYGON
		TEMPLATE "../legend_template.html"
		CONNECTIONTYPE POSTGIS
		CONNECTION "user=postgres password=root dbname=DBD host=localhost
port=5432"
		DATA "the_geom FROM tb_dbd USING UNIQUE gid"
		CLASS
			NAME "Peta Kota"
			STYLE
				COLOR 186 241 152
				OUTLINECOLOR 0 0 0
			END # style
		END # class
	END # layer
		
	
	LAYER
		NAME "Anotasi"
		STATUS DEFAULT
		TYPE annotation
		TEMPLATE "../legend_template.html"
		CONNECTIONTYPE POSTGIS
		CONNECTION "user=postgres password=root dbname=DBD host=localhost
port=5432"
		DATA "the_geom FROM tb_dbd USING UNIQUE gid"
		LABELITEM "kel"
		CLASS
			#TEXT ([kel])
			LABEL
				
				COLOR 0 0 0
				TYPE Truetype
				FONT arial
				SIZE 11
				MINSIZE 8
				ANGLE Auto
				POSITION UC
				ANTIALIAS True
			END # label
		END # class
	END # akhir definisi layer
END # Akhir mapfile


*Peta1.html code :*
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body OnLoad="CWC2OnLoadFunction()">
<table border = "0" width="1000" align="center" cellspacing="0">
<th colspan = "5" > ../images/banner.png </th>
	<tr>
		<th  width= " 200" height="60"> Home.phtml  Home  </th>
		<th >  Peta.phtml  Map  </th>
		<th >  Analisis.phtml  Analisis  </th>
		<th >  Login.phtml  Login  </th>
		<th >  Contact.phtml  Contact  </th>
	</tr>
		<tr>
			<th bgcolor="FFFF66" align="center">
			 Peta Spasial dengan indikator Jumlah Penduduk menggunakan perhitungan
LISA</th>
	<form>
			<td align="center" width= "200">
			*
			<CWC2 TYPE="Title"
				VISIBLE="true"
				LABEL="Utara & Legenda"
				LABELCLASS="CWCHelpTitle1"/>
			*
			</td>
			<td colspan ="2" align="center" width="300">
			* 
			<CWC2 TYPE="Title"
				VISIBLE="true"
				LABEL="Peta Banjarmasin"
				LABELCLASS="CWCHelpTitle1"/>
			*
			</td>
			<td align="center">
			*
			<CWC2 TYPE="Title"
				VISIBLE="true"
				LABEL="Keymap &  Navigasi"
				LABELCLASS="CWCHelpTitle1"/>
				*
			</td>
		</tr>
		
		<tr>
			<td  bgcolor="FFFF66" align="center">
			  Peta1.phtml  Data Tahun 2005 </td>
		
			<td valign="top" rowspan="10">
			  ../images/true_north.png <br><br>
			 <CWC2 TYPE="LegendTemplate"
			 	visible="true"
				enabled="true"
				embedded="true"
				popupwidth="100"
				popupheight="50"
				template="./tmpl_leg.html" /><br>
			</td>
		
			<td colspan="2" rowspan="10">
			<CWC2 TYPE="MapDHTML"
				VISIBLE="true"
				WIDTH="384"
				HEIGHT="204"
				ALLOWRESIZE="true"
				MARQUEECOLOR="#FF3333"
				MARQUEEWIDTH="2"
				MINSCALE="1"/>
			</td>
			<td valign="top" rowspan="10">
	
			<CWC2 TYPE="ZoomIn"
				VISIBLE="true"
				IMAGETIP="Zoom In: box atau klik"
				TOOLSET="Navigation"
				IMAGEWIDTH="20"
				IMAGEHEIGHT="20">
				<IMAGE STATE="normal"
				IMAGE="images/tool_zoomin_off.gif"/>
			
			</CWC2>
			* Zoom in * <BR>
			<CWC2 TYPE="Recenter"
				VISIBLE="true"
				IMAGETIP="Menggeser Tampilan Peta"
				TOOLSET="Navigation"
				IMAGEWIDTH="20"
				IMAGEHEIGHT="20"
				IMAGE="images/tool_recentre_off.gif"/>
				</CWC2>
			*Recenter*<br>
			<cwc2 type="PanMap"
				visible="true"
				imagetip="Menggeser : drag"
				toolset="Navigation"
				imagewidth="20"
				imageheight="20"
				image="images/tool_pan_off.gif"/>
			</cwc2>
			*Drag*<br>
				<CWC2 TYPE="ZoomOut"
				VISIBLE="true"
				IMAGETIP="Memperkecil tampilan peta"
				TOOLSET="Navigation"
				IMAGEWIDTH="20"
				IMAGEHEIGHT="20"
				IMAGE="images/tool_zoomout_off.gif"/>
			</CWC2>
			*Zoom out*<br>
			<cwc2 type="Query"
				visible="true"
				imagetip="Identifikasi Unsur"
				toolset="Navigation"
				IMAGEWIDTH="20"
				IMAGEHEIGHT="20"
				image="images/icon_query.gif"
				popupwidth="400"
				popupheight="200"
				radius="3"
				maxfeatures="15">
			</cwc2>
		*Query*<br>
			<CWC2 TYPE="ZoomAllLayers"
				enabled="true"
				VISIBLE="TRUE"
				imagetip="Zoom full extent"
				toolset="Navigation"
				IMAGEWIDTH="20"
				IMAGEHEIGHT="20"
				IMAGE="images/tool_zoomfull_off.gif"/>
				</CWC2>
				*Full extent*<br>
			</tr>
		
		<tr>
			<td bgcolor="FFFF66" align="center" >
			 Peta1.phtml Data Tahun 2006 </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data Tahun 2007 </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data Tahun 2008 </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			  Data Tahun 2009 </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data I </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data II </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data III </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data IV </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" align="center">
			 Peta1.phtml Data V </td>
		</tr>
		<tr>
			<td bgcolor="FFFF66" ></td>
		
		
			<td>
				<cwc2 type="UpdateMap"
					visible="true"
					imagetip="Mengupdate/refresh tampilan peta"
					image="images/icon_txt_update.gif"
					label="Redraw Map"
					imagewidth="90"
					imageheight="22">
				</cwc2>
			</td>
				<td colspan="2">
					Nilai skala <CWC2 TYPE="Scale"VISIBLE="true"/><br>
					Skala batang <CWC2 TYPE="Scalebar"VISIBLE="true"/><br>
					</td>
				<td>
					<cwc2 type="CursorPos"
						axis="X"
						label="Bujur:"
						labelposition="8"
						labelvalign="middle"
						labelclass="label"
						widgetclass="inputBox"/>
						<cwc2 type="CursorPos"
							axis="Y"
							label="Lintang:"
							labelposition="8"
							labelvalign="middle"
							labelclass="label"
							widgetclass="inputBox"/>
				</td>
			</tr>
			</td>
	
	<CWC2 TYPE="ErrorReport"
		POPUPWIDTH="500"
		POPUPHEIGHT="400"
		TOOLBAR="false"
		STATUS="false"
		MENUBAR="false"
		VISIBLE="false"
		IMAGE="./images/icon_error.png" IMAGEWIDTH="18"
		IMAGEHEIGHT="18"
		IMAGETIP="Display Error Report" LABEL="Error Report" />
		
		<tr>
			<td colspan="5"></td>
		</tr>
       </form>
</table>
</body>
</html>


*Peta1.phtml code :*
<?php
include("./chameleon.php");
$szTemplate="./Template Web/Peta1.html";
$szMapFile="../Map/LISA_epi05.map";
class SampleApp extends Chameleon
{
	function SampleApp()
	{
		parent::Chameleon();
		$this ->moMapSession = new MapSession_RW;
		$this ->moMapSession-> setTempDir ( getSessionSavePath());
	}
}
$oApp= new SampleApp();
$oApp-> registerSkin('skins/sample');
$oApp->CWCInitialize($szTemplate,$szMapFile);
$oApp->CWCExecute();
?>

Any suggestions would be helpful. Thanks.


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/LABELS-ON-THE-MAP-CAN-NOT-BE-DISPLAYED-tp6621419p6621419.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list