Hi,
    i am looking at the MapViewer demo in relation to my project and taking
ideas from their into mine, in particular the load function. At present, 
the application uses a file->open technique where the user selects the .shp
file to use and displays it, which it does successfully. But, in doing so,
the app also reads the .sld file where the location has been hard coded into
the app and read it. Right now, the app does not show the road names from my
.dbf file which is the problem. The function code snippet is as follows: 


 public void displayShapeFile(File shpFile, File sldFile)
    {
       StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);

             // Create parser to parse SLD File and a style factory
              SLDParser stylereader = new SLDParser(factory,sldFile);

              // create an array style to read the xml
              org.geotools.styling.Style[] style = stylereader.readXML();

              // add layter for style and features
              mapContext.addLayer(source,style[0]);

            mapPane.repaint();
             // Use this to define the "context" which holds the displayed
layers
          // defines contents
           mapPane.setContext(mapContext);
mapPane.setReset(true);

// catc/try statenment ended.

I've been following the demo the best i can, but clearly something is
missing. Can somebody  tell me why it is not displaying my road names
please. I've given the .sld for referrence.
http://n2.nabble.com/file/n3095423/roadText.sld roadText.sld 
-- 
View this message in context: 
http://n2.nabble.com/Layer-Not-Showing-tp3095423p3095423.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to