[geotk] Adding GraphicBuilder to its own MapLayer

Thys Meintjes sthysel at gmail.com
Mon Jul 25 09:09:58 EDT 2011


Hi Johann,

On Mon, Jul 25, 2011 at 12:24 PM, Sorel <johann.sorel at geomatys.fr> wrote:

> **
> Hello,
>
> The code looks correct (don't forget to call context.switchToDisplayCRS()
> or switchToDisplayCRS() to set the system in which you are painting), if you
> need more examples you can have a look at the
> WMS/WMTS/OSM-TMS/KML Clients modules, they all use custom subclasses of
> MapLayer and GraphicBuilders.
>
> When you say it doesn't work. does it pass in the targetgraphic or builder
> code ? or not at all ?
>

When i add the builder to the layer as below, nothing is displayed not the
coverage or the custom graphics.
When I comment out the  targetLayer.graphicBuilders().add(builder) line, the
map is displayed
as normal.

    public void addTargetGraphicsBuilder(TargetGraphicBuilder builder) {
        CoverageMapLayer targetLayer = (CoverageMapLayer)
context.layers().get(0);
        targetLayer.setVisible(true);
        targetLayer.graphicBuilders().add(builder);
    }

There are no logs to indicate an error condition....

- try adding the graphicbuilder before you add it in the map . (maybe a
> cache issue)
>

I'm trying this next...


> - ensure the layer is visible.
>
>
> johann
>
>
Thanks

-- 
Thys Meintjes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20110725/ac325b79/attachment-0001.html


More information about the Geotoolkit mailing list