Hi!!!<br><br>I try what you said, but the method setColor in classObj doesn't exist, then i didn't modify the part of the style. However running the program it draws the map with the same labels.<br><br>here's the mapfile and the map image.
<br><br>thanks for your help !!!!!<br><br><br><div><span class="gmail_quote">On 7/23/06, <b class="gmail_sendername">Umberto Nicoletti</b> <<a href="mailto:umberto.nicoletti@gmail.com">umberto.nicoletti@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Try this modifications:<br><br>Capa = new layerObj(Mapa);<br> Capa.setName
("Vias");<br> Capa.setType(mapscriptConstants.MS_LAYER_LINE);<br> Capa.setStatus(mapscriptConstants.MS_ON );<br> String Comando = new String("the_geom FROM (select gid,<br>the_geom, nomb_comun||' '||nomvial as Nombre FROM "+Localidad+" WHERE
<br>codigo IN ("+CodigoVia+","+CodigoInterseccion+")) AS ViasMapa USING<br>UNIQUE gid USING SRID=-1");<br> Capa.setData(Comando);<br> Capa.setLabelitem("Nombre");<br>
Capa.setConnection("user=geotrans dbname=Geotrans host=localhost");<br> Capa.setConnectiontype (mapscriptConstants.MS_POSTGIS);<br> Clase = new classObj(Capa);<br>// CHANGE FROM HERE
<br> Clase.setName('Pick a name');<br>// comment out the style<br>// Estilo = new styleObj(Clase);<br>// Estilo.setColor(new colorObj(255,0,0,0));<br>// and use this to set the color instead
<br> Clase.setColor(new colorObj(255,0,0,0));<br>// END OF CHANGE<br> labelObj Etiquetas = new labelObj();<br> Etiquetas.setSize(18);<br> Etiquetas.setColor(new colorObj(0,255,255,0));
<br> Etiquetas.setType(mapscriptConstants.MS_TRUETYPE);<br> Etiquetas.setAntialias(mapscriptConstants.MS_TRUE );<br> Etiquetas.setPosition(mapscriptConstants.MS_CL);<br> // CHANGE: comment this too
<br> //Etiquetas.setPartials(mapscriptConstants.MS_FALSE);<br> //Etiquetas.setMindistance(300);<br> Etiquetas.setFont("vera");<br> Clase.setLabel(Etiquetas);<br>
Mapa.draw().save("/usr/local/tomcat/webapps/geotrans/Mapas/mapaAcc",null);<br><br>You could also try to save the map to a file to make sure everything<br>got setup properly in mapscript. To do this simply call<br>
Mapa.save('filename'); then post the map file to the list.<br><br>Regards,<br>Umberto<br><br><br>On 7/23/06, Alejandro Rico <<a href="mailto:jarg58@gmail.com">jarg58@gmail.com</a>> wrote:<br>><br>> ><br>> > Hi !!!
<br>> > I try with your suggestions but it doesn't work.<br>> > here's a sample image of the map generated, and the fontset file<br>> ><br>> > thanks !!!<br>> ><br>> ><br>> ><br>> > On 7/22/06, Umberto Nicoletti <
<a href="mailto:umberto.nicoletti@gmail.com">umberto.nicoletti@gmail.com</a>> wrote:<br>> > > Can you post a sample generated image with only this layer on and your<br>> > > fontset file?<br>> > > You could also try to remove mindistance and to set the layer's status
<br>> > > to MS_DEFAULT.<br>> > ><br>> > > Regards,<br>> > > Umberto<br>> > ><br>> > > On 7/21/06, Alejandro Rico < <a href="mailto:jarg58@gmail.com">jarg58@gmail.com
</a>> wrote:<br>> > > > Hi !!!<br>> > > ><br>> > > > I'm working with a vector map made in Java Mapscript, with 2 layers,<br>> and i<br>> > > > need that one of them has labels to identify a way, but when the
<br>> program<br>> > > > runs, mapserver draws a very little ununderstandable labels, and it<br>> doesn't<br>> > > > take the font size change. Someone can help me with this??? thanks.<br>> > > >
<br>> > > > here's my code:<br>> > > ><br>> > > > Capa = new layerObj(Mapa);<br>> > > > Capa.setName("Vias");<br>> > > ><br>> Capa.setType
(mapscriptConstants.MS_LAYER_LINE);<br>> > > > Capa.setStatus(mapscriptConstants.MS_ON );<br>> > > > String Comando = new String("the_geom FROM (select gid,<br>> > > > the_geom, nomb_comun||' '||nomvial as Nombre FROM "+Localidad+" WHERE
<br>> codigo<br>> > > > IN ("+CodigoVia+","+CodigoInterseccion+")) AS<br>> ViasMapa<br>> > > > USING UNIQUE gid USING SRID=-1");<br>> > > > Capa.setData
(Comando);<br>> > > > Capa.setLabelitem("Nombre");<br>> > > > Capa.setConnection("user=geotrans dbname=Geotrans<br>> > > > host=localhost");<br>
> > > > Capa.setConnectiontype (mapscriptConstants.MS_POSTGIS);<br>> > > > Clase = new classObj(Capa);<br>> > > > Estilo = new styleObj(Clase);<br>> > > >
Estilo.setColor(new colorObj(255,0,0,0));<br>> > > > labelObj Etiquetas = new labelObj();<br>> > > > Etiquetas.setSize(18);<br>> > > > Etiquetas.setColor
(new colorObj(0,255,255,0));<br>> > > > Etiquetas.setType(mapscriptConstants.MS_TRUETYPE);<br>> > > > Etiquetas.setAntialias(mapscriptConstants.MS_TRUE );<br>> > > >
Etiquetas.setPosition(mapscriptConstants.MS_CL);<br>> > > > Etiquetas.setPartials(mapscriptConstants.MS_FALSE);<br>> > > > Etiquetas.setMindistance (300);<br>> > > >
Etiquetas.setFont("vera");<br>> > > > Clase.setLabel(Etiquetas);<br>> > > ><br>> > > ><br>> Mapa.draw().save("/usr/local/tomcat/webapps/geotrans/Mapas/mapaAcc",null);
<br>> > > > --<br>> > > > Alejandro Rico<br>> > ><br>> ><br>> ><br>> ><br>> ><br>> > --<br>> ><br>> > Alejandro Rico<br>> ><br>><br>><br>
><br>> --<br>> Alejandro Rico<br>><br></blockquote></div><br><br clear="all"><br>-- <br>Alejandro Rico