Rendering Service

The Rendering Service creates bit-mapped images of a map suitable for displaying in a browser or saving to a file. The image is returned as an MgByteReader object, which can be sent to a browser or saved to a file.

For example, to create a PNG image of a map area, perform the following operations. Note that the aspect ratio of the envelope should match the image dimensions or the image will be distorted.

    $byteReader = $renderingService->RenderMap($map, $selection,

      $envelope, $imageWidth, $imageHeight, $color, 'PNG');

    header("Content-type: " . $byteReader->GetMimeType() );

    $buffer = '';

    while ($byteReader->Read($buffer, 50000) != 0)

    {

      echo $buffer;

    }