Exemplo n.º 1
0
  /** Called when a map layer has changed, e.g. features added to a displayed feature collection */
  public void layerChanged(MapLayerListEvent event) {
    if (layerTable != null) {
      layerTable.repaint(event.getElement());
    }
    redrawBaseImage = true;

    int reason = event.getMapLayerEvent().getReason();

    if (reason == MapLayerEvent.DATA_CHANGED) {
      setFullExtent();
    }

    if (reason != MapLayerEvent.SELECTION_CHANGED) {
      if (!isDisposed()) redraw();
    }
  }
Exemplo n.º 2
0
  /**
   * Overrides the default behavior of layerChanged. The repaint() is commented so when the layer is
   * changed and the map is refreshed the image is not reseted completely.
   */
  @Override
  public void layerChanged(MapLayerListEvent event) {
    paramsLock.writeLock().lock();
    try {
      int reason = event.getMapLayerEvent().getReason();

      if (reason == MapLayerEvent.DATA_CHANGED) {
        setFullExtent();
      }

      if (reason != MapLayerEvent.SELECTION_CHANGED) {
        clearLabelCache.set(true);
        drawLayers(false);
      }

    } finally {
      paramsLock.writeLock().unlock();
    }

    // repaint();
  }