[mapguide-internals] fusion legend and sprited legend images
Paul Spencer
pspencer at dmsolutions.ca
Thu Oct 8 13:05:48 EDT 2009
I've been working on implementing http://trac.osgeo.org/fusion/ticket/131
which allows for the possibility of generating a sprite containing
all the legend icons and thus eliminating the individual calls to
generate legend icons for each layer/class. This is now implemented
and working for MapServer and the wiring is in place for it to work
with MapGuide.
This code provides a big apparent performance boost for maps with lots
of layers/themed layers by using a single image for all (or most)
legend icon images and using the CSS sprite technique for positioning
the image such that the correct sub-image is visible for the
appropriate layer/class/scale range.
If there is interest in having this feature supported for MapGuide
maps, I need some help from MapGuide gurus to modify fusion/Layers/
MapGuide/php/LoadScaleRanges.php to do the following:
1) create an image that contains all the icons for each layer/class/
scale range combination
* The image can be organized either vertically or horizontally
* the individual images need to be the same size within the strip
2) save the image to a web-accessible location and add the url and
size of each icon to the output json object, i.e.
"icons_url":"http:\/\/localhost\/ms_tmp\/4ace0feb_1a23_0.png",
"icons_width":18,
"icons_height":12
3) each scale range that has an image in the strip needs to add to its
json representation values for icon_x and icon_y which are the offsets
into the image that the icon can be found at
If a scale range doesn't have icon_x/_y then the legend will retrieve
the legend image using the existing mechanism
There is php code in MapServer's LoadScaleRanges.php which can do the
image manipulation to create the strip etc, just need to figure out
how to get MapGuide to generate the individual icons.
I am willing to work with someone on this code but I need a MapGuide-
savvy developer to figure out how to make the individual icons
Cheers
Paul
__________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://research.dmsolutions.ca/
More information about the mapguide-internals
mailing list