(intermittent) poor text quality on ANNOTATION layers
Hal Mueller
hal at MOBILEGEOGRAPHICS.COM
Fri Nov 10 00:31:28 PST 2006
Well I apparently don't understand how the label cache works. That
is in fact the cause of my problems. i can cure or cause the error
by not calling or calling $map->drawlabelcache().
http://www.sailwx.info/shiptrack/maptest.phtml has a much-simplified
test case done with PHP Mapscript.
The upper map has fuzzy text. The lower map is correct. The only
difference is a call to drawlabelcache() in the fuzzy-text map.
The maps are generated with
$image=$map->draw();
$map->drawlabelcache($image);
$url=$image->saveWebImage();
echo "<img src=\"$url\">";
$image2=$map2->draw();
$url2=$image2->saveWebImage();
echo "<img src=\"$url2\">";
The complication is that for the real maps, I have both static data
(defined in shapefiles and .map file) and dynamic data (rendered onto
the map after the base map has been drawn).
The flow of the programs is (distilled down):
$map = ms_newMapObj()
$image = $map->draw();
$dynamicLayer = $map->getLayerByName("dynamic");
and then many calls to
$point->draw($map, $dynamicLayer, $image...);
If I delete the call to drawlabelcache(), my annotations on the
dynamic data are lost. If I keep the call to drawlabelcache() the
static layers are labeled twice. What am I missing? Is there a
better approach?
Hal
More information about the MapServer-users
mailing list