[mapguide-users] Studio: reset to defaults?
tom.fukushima at autodesk.com
Tue Apr 4 12:06:38 EDT 2006
During development we had thought about the following: When changing the
feature class for the layer, first scan the LayerDefinition and find all
properties used in expressions. Then check that these properties match
properties in the new feature class. If they do match, then we consider
them to be compatible and then allow the layer author to continue. Then
to go a bit further, when changing feature sources, we would try to find
a compatible feature class in that new feature source to use. Doing
this, was just a matter of time really.
And of course, there is also the approach of having a "I know what I'm
doing, leave things as is" button on the "Incompatible data sources"
dialog. However, this requires thorough testing to make sure that
anything that gets through does not cause subsequent failures in Studio.
Again, just a matter of time.
Editing the layer definition externally from Studio is possible and here
is one recipe for it.
1) Make a copy of the layer definition
2) Open the layer definition and do a File > Save As XML...
3) Close the layer definition editor.
In your favorite XML editor
4) Open the saved file
5) In the XML, find the FeatureSource used by the layer. It will be
enclosed in ResourceId tags. Change the resource to point to the
correct feature source.
6) Save the file.
Using Internet Explorer
7) Open the server web pages:
8) Click on the SetResource link in the bottom left pane.
9) In the Resource ID field, type the name of the layer definition.
This will have the form Library://path/layer.LayerDefinition.
10) In the Content field, click the Browse button and find the XML file
that you edited in step 5.
11) Leave the Header blank.
12) Press Submit.
You should now be able to open and edit the changed layer definition in
From: Andy Morsell [mailto:amorsell at spatialgis.com]
Sent: Friday, March 31, 2006 5:41 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Studio: reset to defaults?
This is a Studio issue, not a MGOS issue. I am authoring several
different road layers from Shape files (converted to SDF during load).
These are all standardized in terms of the defined feature types (major,
minor, local roads, etc). I have defined a layer based on one that has
multiple scale ranges, each with the thematic definition. I then copy
this layer definition to another location to use as a template for a
different data source. This seems to work OK (despite several .NET and
JIT warnings) for the most part.
However, it appears that if the feature source being chosen has any
difference in field definitions from the feature source that the layer
was originally created from, then Studio pops up a dialog that says:
"Reset to defaults? - You're about to change to an incompatible data
resource. Proceed and reset the layer to defaults?". If I say OK, all
of the styles already in place are reset to scratch. I don't understand
why it would do this since the field that is being themed is the same
name and type in both feature sources.
I don't see any way around this. I don't believe the layer definition
can be edited externally from Studio, or can it? Can this behavior be
changed in a future release of Studio so that we can have more control
over style "templates"?
Andy Morsell, P.E.
Spatial Integrators, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mapguide-users