public function GetTileModificationDate($mapDefIdStr, $groupName, $scaleIndex, $row, $col)
 {
     $tileCacheName = str_replace("Library://", "", $mapDefIdStr);
     $tileCacheName = str_replace(".MapDefinition", "", $tileCacheName);
     $tileCacheName = str_replace("/", "_", $tileCacheName);
     $path = sprintf("%s/%s/S%s/%s/%s/%s/%s_%s.%s", $this->app->config("MapGuide.PhysicalTilePath"), $tileCacheName, $scaleIndex, $groupName, MgTileServiceController::GetFolderName("R", $row), MgTileServiceController::GetFolderName("C", $col), MgTileServiceController::GetTileIndexString($row), MgTileServiceController::GetTileIndexString($col), $this->app->config("MapGuide.TileImageFormat"));
     //var_dump($path);
     //die;
     $path = str_replace("/", DIRECTORY_SEPARATOR, $path);
     if (file_exists($path)) {
         return filemtime($path);
     } else {
         //$this->app->response->header("X-Debug-Message", "Could not fetch mtime of $path. File does not exist");
         return false;
     }
 }
Пример #2
0
 *        tags={"session"},
 *          @SWG\Parameter(name="session", in="path", required=true, type="string", description="Your MapGuide Session ID"),
 *          @SWG\Parameter(name="resName", in="path", required=true, type="string", description="The name of the Map Definition"),
 *          @SWG\Parameter(name="groupName", in="path", required=true, type="string", description="The tiled group of the Map Definition"),
 *          @SWG\Parameter(name="scaleIndex", in="path", required=true, type="integer", description="The finite scale index"),
 *          @SWG\Parameter(name="col", in="path", required=true, type="integer", description="The column of the tile to fetch"),
 *          @SWG\Parameter(name="row", in="path", required=true, type="integer", description="The row of the tile to fetch"),
 *          @SWG\Parameter(name="type", in="path", required=true, type="string", description="The tile type", enum={"img"}),
 *        @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("/session/:sessionId/:resName.MapDefinition/tile.:format/:groupName/:scaleIndex/:col/:row", function ($sessionId, $resName, $format, $groupName, $scaleIndex, $col, $row) use($app) {
    $resId = new MgResourceIdentifier("Session:{$sessionId}//{$resName}.MapDefinition");
    $ctrl = new MgTileServiceController($app);
    $ctrl->GetTile($resId, $groupName, $scaleIndex, $col, $row, $format);
});
//============================== Mapping Service APIs =====================================
/**
 *     @SWG\Get(
 *        path="/session/{session}/{resName}.LayerDefinition/legend/{scale}/{geomType}/{themecat}/icon.{type}",
 *        operationId="GenerateLegendImage",
 *        summary="Generates the specified icon for the given Layer Definition",
 *        tags={"session"},
 *          @SWG\Parameter(name="session", in="path", required=true, type="string", description="Your MapGuide Session ID"),
 *          @SWG\Parameter(name="resName", in="path", required=true, type="string", description="The name of the Layer Definition"),
 *          @SWG\Parameter(name="scale", in="path", required=true, type="number", description="The scale at which the symbolization is requested"),
 *          @SWG\Parameter(name="geomType", in="path", required=true, type="integer", description="The type of symbolization required: 1=Point, 2=Line, 3=Area, 4=Composite"),
 *          @SWG\Parameter(name="themecat", in="path", required=true, type="integer", description="The value indicating which theme category swatch to return. Used when there is a theme defined at this scale"),
 *          @SWG\Parameter(name="width", in="query", required=true, type="integer", description="The requested image width in pixels"),