[mapguide-internals] Symbol Library and DWF
traian.stanev at autodesk.com
Wed May 20 15:36:33 EDT 2009
Sure, but you can pick a narrow subset of the SymbolDefinitions, a subset which lets you define image symbols only -- similar to what you would do with DWF anyway. Generic DWF support would be at least as complex and overwhelming as generic SymbolDefinition support.
You can write W2D yourself, without the DWF toolkit too, particularly if you write it out in the ASCII W2D format -- it will probably take a bit of effort to get it right. May be you can reverse-engineer an existing symbol DWF, uncompress it, replace certain strings within the constituent files, and then zip it again -- this is something I've never tried but it might work.
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: Wednesday, May 20, 2009 3:15 AM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] Symbol Library and DWF
I was thinking of doing the Zip/Xml/W2D stuff without the DWF library to
avoid a crossplatform issue with the DWF library.
If I understand your answer correctly it should be possible to generate
the Xml/Zip using a form of template with fixed transformation values.
That leaves out the W2D format for the images, which is do-able (I hope).
The SymbolDefinition is much cleaner, and looks more like what I would
expect, but it's also a very complex item
to build an editor for.
The number of potential settings seems overwhelming, which is why I had
hoped that SymbolLibraries was simpler to implement.
Regards, Kenneth Skovhede, GEOGRAF A/S
Traian Stanev skrev:
> Hi Kenneth,
> 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.
> -----Original Message-----
> 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?
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
More information about the mapguide-internals