Example #1
0
 int setLayerDisplayed(Layer* pLayer, int displayed)
 {
    if (pLayer == NULL)
    {
       setLastError(SIMPLE_BAD_PARAMS);
       return 1;
    }
    SpatialDataView* pView = dynamic_cast<SpatialDataView*>(pLayer->getView());
    if (pView == NULL)
    {
       setLastError(SIMPLE_WRONG_VIEW_TYPE);
       return 1;
    }
    bool success = true;
    if (displayed != 0)
    {
       if (!pView->isLayerDisplayed(pLayer))
       {
          success = pView->showLayer(pLayer);
       }
    }
    else
    {
       if (pView->isLayerDisplayed(pLayer))
       {
          success = pView->hideLayer(pLayer);
       }
    }
    if (!success)
    {
       setLastError(SIMPLE_OTHER_FAILURE);
       return 1;
    }
    setLastError(SIMPLE_NO_ERROR);
    return 0;
 }
Example #2
0
 int isLayerDisplayed(Layer* pLayer)
 {
    if (pLayer == NULL)
    {
       setLastError(SIMPLE_BAD_PARAMS);
       return 0;
    }
    SpatialDataView* pView = dynamic_cast<SpatialDataView*>(pLayer->getView());
    if (pView == NULL)
    {
       setLastError(SIMPLE_WRONG_VIEW_TYPE);
       return 0;
    }
    setLastError(SIMPLE_NO_ERROR);
    return static_cast<int>(pView->isLayerDisplayed(pLayer));
 }