[Mapserver-users] Embeded scalebar and Legend

Eduin Yesid Carriillo yecarrillo at hotmail.com
Fri Mar 28 00:54:54 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C2F4C4.A54FC130
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Can Anybody tell me how to embed scalebars and legends in mapscript?

I've tried this code without results...

function DrawMaptoPrint() {
    GLOBAL $gpoMap;
    GLOBAL $gAppletImgFmt;

    $gpoMap->scalebar->set(status , MS_EMBED);
    $gpoMap->scalebar->set(position , MS_UL);

    $img =3D $gpoMap->drawScaleBar();
    $gpoMap->embedScalebar($img);
   =20
    $img =3D $gpoMap->draw();
    $gpoMap->drawLabelCache($img);

    $url =3D $img->saveWebImage($gAppletImgFmt, 0, 0, -1);
    printf("<img src=3D%s width=3D%d height=3D%d>\n", $url, =
$gpoMap->width, $gpoMap->height);...
}

map file:

SCALEBAR
  IMAGECOLOR 255 255 255
...

 POSTLABELCACHE true

...

END

I could'n find nothing about this issue on the mailing list..

Thanks

Eduin

------=_NextPart_000_000D_01C2F4C4.A54FC130
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Can Anybody tell me how to embed =
scalebars and=20
legends in mapscript?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've tried this code without=20
results...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>function DrawMaptoPrint() =
{<BR>&nbsp;&nbsp;&nbsp;=20
GLOBAL $gpoMap;<BR>&nbsp;&nbsp;&nbsp; GLOBAL =
$gAppletImgFmt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
$gpoMap-&gt;scalebar-&gt;set(status , MS_EMBED);<BR>&nbsp;&nbsp;&nbsp;=20
$gpoMap-&gt;scalebar-&gt;set(position , MS_UL);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; $img =3D=20
$gpoMap-&gt;drawScaleBar();<BR>&nbsp;&nbsp;&nbsp;=20
$gpoMap-&gt;embedScalebar($img);<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
$img =3D $gpoMap-&gt;draw();<BR>&nbsp;&nbsp;&nbsp;=20
$gpoMap-&gt;drawLabelCache($img);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; $url =3D=20
$img-&gt;saveWebImage($gAppletImgFmt, 0, 0, -1);<BR>&nbsp;&nbsp;&nbsp;=20
printf("&lt;img src=3D%s width=3D%d height=3D%d&gt;\n", $url, =
$gpoMap-&gt;width,=20
$gpoMap-&gt;height);...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>map file:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SCALEBAR<BR>&nbsp; IMAGECOLOR 255 255=20
255<BR>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;POSTLABELCACHE true</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I could'n find nothing about this issue =
on the=20
mailing list..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Eduin</FONT></DIV></BODY></HTML>

------=_NextPart_000_000D_01C2F4C4.A54FC130--



More information about the mapserver-users mailing list