Hello, I'm trying to create a map using Mysql data. I've obtained one with the points on the map, but I would like to have the name of each point. I'd made the map adding a shape with the points in a layer, but I don't know how to put a name in each point (column 'nom' of the query), there is no "name" field or similar in the PointObj object.
<br><br><br>function consultar($query) {<br><br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; @mysql_connect(&quot;localhost&quot;, &quot;gis&quot;, &quot;*****&quot;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; or die(&quot;Could not connect to MySQL server!&quot;);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; @mysql_select_db(&quot;db&quot;)
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; or die(&quot;Could not select database&quot;);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $result = mysql_query($query);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $i = 0;<br>&nbsp;&nbsp;&nbsp; while ( $row = mysql_fetch_array($result) )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $qresult[$i] = $row;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $i++;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return $qresult;<br><br>}<br><br>function llegirTrampes ($finca, $parcela ) {<br><br>&nbsp;&nbsp;&nbsp; global $mapa;<br>&nbsp;&nbsp;&nbsp; $this_layer = $mapa-&gt;getLayerByName('Trampes');<br>&nbsp;&nbsp;&nbsp; // Canviar x $finca i $parcela
<br>&nbsp;&nbsp;&nbsp; $qresult = consultar(&quot;SELECT nom, round(utmx,2) as utmx, round(utmy,2) as utmy FROM trampa t where idfinca=$idfinca and idparcela=$idparcela&quot;);<br>&nbsp;&nbsp;&nbsp; $shape = ms_newShapeObj(MS_SHAPE_POINT);&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; foreach($qresult as $row) {
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $punt = ms_newPointObj();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $linia =&nbsp; ms_newLineObj();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $punt-&gt;setXY($row[1],$row[2]);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $linia-&gt;add($punt);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $shape-&gt;add($linia);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; $this_layer-&gt;addFeature( $shape );
<br>&nbsp;&nbsp;&nbsp; return;<br>}<br><br><br>I'd like to change the symbol of the point depending the feature... Some ideas?<br>Thanks alot, I'm a little lost<br>(sorry for my english)<br><br>