MapServer Suggestion
Stephen Lime
steve.lime at dnr.state.mn.us
Sun Jan 30 09:31:29 PST 2000
Yes, this will work. However I think collisions with underlying labels will cause problems. A better approach will be to somehow add the scalebar to the label cache as annotation and use that mechanism to draw the scalebar. I think I will simply add a new layer type called scalebar and handle it that way. Look for it in 3.3.007.
s.
<<< "Grzegorz Myrda" <mapadm at polsl.gliwice.pl> 1/30 10:59a >>>
> 2. if the scale bar is available into the map;
> but keep the old functionality.
It can be done by simply inserting following code at the end of msDrawMap():
-------
/*
** Build the scalebar if the user wants it and a mapfile has been read
*/
if(map->scalebar.status == MS_ON) {
if((imgSB = msDrawScalebar(map)) == NULL)
writeError();
black = gdImageColorExact(imgSB, 255, 255, 255);
/* If black is present... */
if (black != (-1)) {
/* Make it transparent */
gdImageColorTransparent(imgSB, black);
}
gdImageCopy(img, imgSB, 0, 0, 0, 0, imgSB->sx, imgSB->sy);
gdImageDestroy(imgSB);
}
------
Grzegorz
More information about the MapServer-users
mailing list