[mapserver-dev] imagemap outputdriver mapimagemap.c
Doug Willams
williams at mail.cs.montana.edu
Sat Apr 23 00:51:13 EDT 2011
Hello,
I am working on the outputformat imagemap output driver routines found in the mapimagemap.c source file.
For lines and polygons, mapimagemap.c receives a reference to the shape object. I thought the shape object would have many values, either for all the data fields or at least for the metadata result_fields defined for the layer in the map file. But there is only one value, for the classitem, in the values array. Can the other data items be accessed? Is it necessary to perform a query to produce a resultcache in order to get the data values? Here is how I write the values to a string, to see what is there ... works fine, but there is only ever one value, from the classitem field [and the index of course].
for (i = 0; i < shape->numvalues; i++) {
strlength += strlen(shape->values[i]);
}
test = malloc(strlength+51);
sprintf (test, "%d", (int)shape->index);
for (i = 0; i < shape->numvalues; i++) {
strcat(test,",");
strcat(test, shape->values[i]);
}
I must be missing something! How is the values array properly populated with the shape's data field values?
Thanks,
Doug
More information about the mapserver-dev
mailing list