Ejemplo n.º 1
0
        //only output layers that are part of the 'Normal Group' and
        //not the base map group used for tile maps.
        echo $layerSep . '{';
        OutputLayerInfo($layer, $resourceService, $featureService);
        echo '}';
        $layerSep = ',';
    }
    echo "],";
    //Get layer groups as xml
    $groups = $map->GetLayerGroups();
    echo "groups:[";
    $groupSep = '';
    for ($i = 0; $i < $groups->GetCount(); $i++) {
        $group = $groups->GetItem($i);
        echo $groupSep . '{';
        OutputGroupInfo($group);
        echo '}';
        $groupSep = ',';
    }
    echo "],";
    //FiniteDisplayScales for tiled maps
    echo "FiniteDisplayScales:[";
    for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++) {
        if ($i > 0) {
            echo ",";
        }
        echo $map->GetFiniteDisplayScaleAt($i);
    }
    echo "]";
    echo "}";
} catch (MgException $e) {
Ejemplo n.º 2
0
        /*get the min/max scale for the layer*/
        $nCount = count($oScaleRanges);
        $layerObj->minScale = $oScaleRanges[0]->minScale;
        $layerObj->maxScale = $oScaleRanges[0]->maxScale;
        for ($j = 1; $j < $nCount; $j++) {
            $layerObj->minScale = min($layerObj->minScale, $oScaleRanges[$j]->minScale);
            $layerObj->maxScale = max($layerObj->maxScale, $oScaleRanges[$j]->maxScale);
        }
        array_push($mapObj->layers, $layerObj);
    }
    //Get layer groups as xml
    $groups = $map->GetLayerGroups();
    $mapObj->groups = array();
    for ($i = 0; $i < $groups->GetCount(); $i++) {
        $group = $groups->GetItem($i);
        array_push($mapObj->groups, OutputGroupInfo($group));
    }
    $mapObj->FiniteDisplayScales = array();
    //FiniteDisplayScales for tiled maps
    for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++) {
        array_push($mapObj->FiniteDisplayScales, $map->GetFiniteDisplayScaleAt($i));
    }
    echo var2json($mapObj);
} catch (MgException $e) {
    echo "ERROR: " . $e->GetExceptionMessage() . "\n";
    echo $e->GetDetails() . "\n";
    echo $e->GetStackTrace() . "\n";
}
exit;
/************************************************************************/
/*                     GetLayerTypesFromResourceContent                 */