[mapguide-internals] Symbol Library and DWF
traian.stanev at autodesk.com
Tue May 19 11:57:19 EDT 2009
Yes, DWF symbols are overkill if all you want is image symbols. I highly recommend using the new SymbolDefinitions instead, which even allows you to embed images in the symbol XML itself. We used DWF as an image store initially, before we had the SymbolDefinitions.
If you want support for the old DWF-style symbol libraries -- it would be somewhat of a pain to do so in Maestro, since you will have to write quite a bit of code against the DWF toolkit, which is C++. The code stores multiple W2D sections inside a DWF package. A DWF package is a zip file in disguise. A W2D is a graphical resource within the DWF package. For image symbols, each W2D contains an image. As you know MapGuide Studio can create symbols from other types of files as well (WMF for example). Those are converted to W2D also.
The transform is constant -- coordinates inside each symbol W2D are made to fit in a bounding box of 0 to 2000000 (if I remember this correctly). However, the rendering code on the server does not assume this transform -- it obtains it from the Viewport element stored in the W2D. There are some comments in the rendering code explaining that. Search for "IsSymbolW2D" in AGGW2DRewriter.cpp for example.
In summary, my recommendation is that if you don't absolutely have to have DWF symbol support, it's better to implement symbol libraries using the new SymbolDefinitions.
From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Kenneth Skovhede, GEOGRAF A/S
Sent: Sunday, May 17, 2009 10:16 AM
To: MapGuide Internals Mail List
Subject: [mapguide-internals] Symbol Library and DWF
I am working on implementing Symbol Library support for Maestro.
I have found no documentation explaining how Symbol Libraries work,
if documents exist, a link would be appreciated.
I have looked at the examples from the Sheboygan package,
and I can deduce that they work by having an xml document
listing the avalible file names.
I would then expect that the filenames refer to attached resource data,
but instead, there seems to be a DWF file named "symbols.dwf"
attached as the only resource data, and the filename seems to be fixed.
It seems as if the DWF file is just being used as an archive for
files, and the images are stored in "w2d" format.
There also seems to be some transformation data present.
Are the transformation data constant?
Are they parsed/used by MapGuide?
I find the DWF format a bit overkill for simply storing images,
so I suspect that there is something I have overlooked.
What is the benefit of using DWF as opposed to just storing images,
as resource data, and transformation data in the xml resource directly?
Regards, Kenneth Skovhede, GEOGRAF A/S
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
More information about the mapguide-internals