Exemplo n.º 1
0
 *          @SWG\Parameter(name="printlayout", in="query", required=false, type="string", description="The PrintLayout resource to use for plotting. Only applies if plotting to DWF"),
 *          @SWG\Parameter(name="title", in="query", required=false, type="string", description="The title to put in the plot"),
 *          @SWG\Parameter(name="type", in="path", required=true, type="string", description="The plot type", enum={"dwf", "pdf"}),
 *        @SWG\Response(response=400, description="You supplied a bad request due to one or more missing or invalid parameters"),
 *        @SWG\Response(response=401, description="Session ID or MapGuide credentials not specified"),
 *        @SWG\Response(response=500, description="An error occurred during the operation")
 *     )
 */
$app->get("/library/:resourcePath+.MapDefinition/plot.:format", function ($resourcePath, $format) use($app) {
    $count = count($resourcePath);
    if ($count > 0) {
        $resourcePath[$count - 1] = $resourcePath[$count - 1] . ".MapDefinition";
    }
    $resId = MgUtils::ParseLibraryResourceID($resourcePath);
    $ctrl = new MgMappingServiceController($app);
    $ctrl->GeneratePlotFromMapDefinition($resId, $format);
});
//================================= Rendering Service APIs ==================================
/**
 *     @SWG\Get(
 *        path="/library/{resourcePath}.MapDefinition/image.{type}",
 *        operationId="RenderMapDefinition",
 *        summary="Renders an image of the specified map definition",
 *        tags={"library"},
 *          @SWG\Parameter(name="session", in="query", required=false, type="string", description="Your MapGuide Session ID"),
 *          @SWG\Parameter(name="resourcePath", in="path", required=true, type="string", description="The path of the Map Definition"),
 *          @SWG\Parameter(name="x", in="query", required=true, type="integer", description="The X coordinate of the map center to render"),
 *          @SWG\Parameter(name="y", in="query", required=true, type="integer", description="The Y coordinate of the map center to render"),
 *          @SWG\Parameter(name="scale", in="query", required=true, type="number", description="The map scale to render"),
 *          @SWG\Parameter(name="width", in="query", required=true, type="integer", description="The width of the image"),
 *          @SWG\Parameter(name="height", in="query", required=true, type="integer", description="The height of the image"),