[mapserver-commits] r12986 - sandbox/sdlime/rfc-77
svn at osgeo.org
svn at osgeo.org
Mon Jan 16 00:00:24 EST 2012
Author: sdlime
Date: 2012-01-15 21:00:23 -0800 (Sun, 15 Jan 2012)
New Revision: 12986
Modified:
sandbox/sdlime/rfc-77/mapdraw.c
sandbox/sdlime/rfc-77/mapfile.c
sandbox/sdlime/rfc-77/maplabel.c
sandbox/sdlime/rfc-77/maptemplate.c
Log:
Few more changes... can render features but not text (yet).
Modified: sandbox/sdlime/rfc-77/mapdraw.c
===================================================================
--- sandbox/sdlime/rfc-77/mapdraw.c 2012-01-16 00:04:22 UTC (rev 12985)
+++ sandbox/sdlime/rfc-77/mapdraw.c 2012-01-16 05:00:23 UTC (rev 12986)
@@ -1439,6 +1439,7 @@
cliprect.maxx = map->extent.maxx + 2*map->cellsize;
cliprect.maxy = map->extent.maxy + 2*map->cellsize;
*/
+ fprintf(stderr, "in msDrawShape()...\n");
msDrawStartShape(map, layer, image, shape);
@@ -2038,7 +2039,7 @@
if(layer->labelcache) {
if (bLabelNoClip == MS_TRUE) msComputeBounds(shape); /* compute the bounds, previous bounds were calculated on a non transformed shape */
- if(msAddLabelGroup(map, c, layer->index, shape, &annopnt, MS_MIN(shape->bounds.maxx-shape->bounds.minx,shape->bounds.maxy-shape->bounds.miny)) != MS_SUCCESS) return (MS_FAILURE);
+ if(msAddLabelGroup(map, layer->index, c, shape, &annopnt, MS_MIN(shape->bounds.maxx-shape->bounds.minx,shape->bounds.maxy-shape->bounds.miny)) != MS_SUCCESS) return (MS_FAILURE);
} else {
for(l=0; l<layer->class[c]->numlabels; l++)
msDrawLabel(map, image, annopnt, layer->class[c]->labels[l]->annotext, layer->class[c]->labels[l], layer->scalefactor);
@@ -2237,6 +2238,7 @@
int msDrawLabelCache(imageObj *image, mapObj *map)
{
int nReturnVal = MS_SUCCESS;
+
if(image) {
if(MS_RENDERER_PLUGIN(image->format)) {
pointObj p;
@@ -2261,6 +2263,8 @@
const char *value;
+ fprintf(stderr, "in msDrawLabelCache()...\n");
+
labelPoly.line = &labelPolyLine; /* setup the label polygon structure */
labelPoly.numlines = 1;
labelPoly.line->point = labelPolyPoints;
@@ -2275,6 +2279,8 @@
if(map->debug) msDebug("msDrawLabelCache(): labelcache_map_edge_buffer = %d\n", map_edge_buffer);
}
+ fprintf(stderr, " map_edge_buffer=%d\n", map_edge_buffer);
+
for(priority=MS_MAX_LABEL_PRIORITY-1; priority>=0; priority--) {
labelCacheSlotObj *cacheslot;
cacheslot = &(map->labelcache.slots[priority]);
Modified: sandbox/sdlime/rfc-77/mapfile.c
===================================================================
--- sandbox/sdlime/rfc-77/mapfile.c 2012-01-16 00:04:22 UTC (rev 12985)
+++ sandbox/sdlime/rfc-77/mapfile.c 2012-01-16 05:00:23 UTC (rev 12986)
@@ -2873,7 +2873,7 @@
}
msFree(class->styles);
- for(i=0;i<class->numstyles;i++) { /* each label */
+ for(i=0;i<class->numlabels;i++) { /* each label */
if(class->labels[i]!=NULL) {
if(freeLabel(class->labels[i]) == MS_SUCCESS) {
msFree(class->labels[i]);
Modified: sandbox/sdlime/rfc-77/maplabel.c
===================================================================
--- sandbox/sdlime/rfc-77/maplabel.c 2012-01-16 00:04:22 UTC (rev 12985)
+++ sandbox/sdlime/rfc-77/maplabel.c 2012-01-16 05:00:23 UTC (rev 12986)
@@ -313,6 +313,10 @@
layerPtr = (GET_LAYER(map, layerindex)); /* set up a few pointers for clarity */
classPtr = GET_LAYER(map, layerindex)->class[classindex];
+ fprintf(stderr, "in msAddLabelGroup()... numlabels=%d\n", classPtr->numlabels);
+
+ if(classPtr->numlabels == 0) return MS_SUCCESS; /* not an error just nothing to do */
+
/* if the number of labels is 1 then call msAddLabel() accordingly */
if(classPtr->numlabels == 1) {
msAddLabel(map, classPtr->labels[0], layerindex, classindex, shape, point, NULL, featuresize);
@@ -454,6 +458,8 @@
layerObj *layerPtr=NULL;
classObj *classPtr=NULL;
+ fprintf(stderr, "in msAddLabel()...\n");
+
if(!label) return(MS_FAILURE); // RFC 77 TODO: set a proper message
if(!label->annotext) return(MS_SUCCESS); /* not an error */
Modified: sandbox/sdlime/rfc-77/maptemplate.c
===================================================================
--- sandbox/sdlime/rfc-77/maptemplate.c 2012-01-16 00:04:22 UTC (rev 12985)
+++ sandbox/sdlime/rfc-77/maptemplate.c 2012-01-16 05:00:23 UTC (rev 12986)
@@ -1672,9 +1672,9 @@
if(use_label_settings == MS_TRUE) {
/* RFC 77: classes (and shapes) can have more than 1 piece of annotation, here we only use the first (index=0) */
- if(shape->numtext > 0 && shape->text[0] && shape->classindex >= 0) {
+ if(shape->classindex >= 0 && layer->class[shape->classindex]->numlabels > 0) {
label = layer->class[shape->classindex]->labels[0];
- if(msGetLabelSize(layer->map, label, shape->text[0], label->size, &r, NULL) == MS_SUCCESS) {
+ if(msGetLabelSize(layer->map, label, label->annotext, label->size, &r, NULL) == MS_SUCCESS) {
label_offset_x = (int)(label->offsetx*layer->scalefactor);
label_offset_y = (int)(label->offsety*layer->scalefactor);
More information about the mapserver-commits
mailing list