Sachin,

This is just a guess, but try adding the AnnotationLayer after loading the
geoset.  I think what's happening is that by loading the geoset, you are
clearing out any layers that might have already been added.

Gary.

[EMAIL PROTECTED] wrote:

> Hi Listers,
> I am working with MapXtreme3.0 for Java and quite new to it. I am trying to
> add a simple layer(of blue color) over a GST. I can see only the gst but not
> the layer...!
> this is what i am doing
>
> myMap = new MapJ();
> myMap.setDeviceBounds(new DoubleRect(0, 0, 400, 400));
>
> AnnotationDataProviderHelper DPHelper = new AnnotationDataProviderHelper();
> AnnotationTableDescHelper TabDesc = new AnnotationTableDescHelper("LA");
> LocalDataProviderRef MXDPRef = new LocalDataProviderRef(DPHelper);
> Layer LALayer = myMap.getLayers().insert(MXDPRef, TabDesc, 0, "LA");
>
> FeatureFactory ff = myMap.getFeatureFactory();
> Attribute att1[] = new Attribute[1];
> Rendition rend = new Rendition();
> att1[0] = new Attribute("Feature1");
> rend.setValue(Rendition.FILL, java.awt.Color.blue);
> rend.setValue(Rendition.FILL_OPACITY, new Float(0.1));
> double pnts[] = {-200,-200, 200,-200, 200,200, -200,200 };
> LALayer.addFeature(ff.createRegion(pnts, rend, att1, null));
>
> String MapXURL = "<http://localhost:8080/mapxtreme/servlet/MapX>";
> myMap.loadGeoset("c:\\mapinfo\\data\\gb.gst", "c:\\mapinfo\\data", MapXURL);
> MapXtremeImageRenderer renderer = new MapXtremeImageRenderer(MapXURL);
> myMap.render(renderer);
> res.setContentType("image/gif");
> renderer.toStream(res.getOutputStream());
> renderer.dispose();
>
> if I remove the "myMap.loadGeoset(..." line, I can see the layer.
> but if I add it I can see only the geoset, not the layer.
> Can anyone tell how to do it or what wrong am i doing or how can I get it
> right?
> Thnx in advance
> Sachin
>
> _______________________________________________________________________
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to