Al,

On 8/2/07, Al Byers <[EMAIL PROTECTED]> wrote:
> Thanks Andreas,
> This sort of code snippet is invaluable to me and anyone else who may need
> it.

Sorry, but it contains everything that is needed to get it working. It
is important that the models you merge really have the same XML
structure, otherwise MergeModel will fail.

Also worth noting is the fact that MergeModel is new, and hence there
is no documentation for it yet.

> I have some questions below.
>
> What is the advantage of using MergeModel vs. loading my layers into the
> mainPane owsContext ResourceList (which works. I can't get the  MergeModel
> approach to work. I am tracing thru to see what is going on). Do you only
> use MergeModel for doing WFS queries?

WFS queries are the reason why MergeModel was made, but it should work
with any model that has entries with unique ids. If you just want to
display vector layers, you do not need MergeModel. MergeModel is some
kind of workaround for SVG/VML not being able to pass events to layers
below. You only need it if you want to have interaction on the map
(like hover/click popups), because you can merge all geometries of all
source models into one SVG/VML layer.

> >   <idXPath>//gml:featureMember/*</idXPath>
> >   <idAttribute>fid</idAttribute>
>
> Are these two lines above required if I just want to display layers on the
> map?

ATM yes, because MergeModel always needs to set a sourceModel
attribute to the node that also holds the fid attribute. The above
will work if your source xml models look like this:

<wfs:FeatureCollection>
  <gml:featureMember>
    <mb:myFeature fid="feature_1">
       ...
    </mb:myFeature>
  </gml:featureMember>
</wfs:FeatureCollection>

idXPath is the xpath that points to mb:myFeature; idAttribute is the
name of the attribute that holds the feature id.

>     <Model id="central">
>       <defaultModelUrl>central.xml</defaultModelUrl>
>      </Model>
>     <MergeModel id="mergemodel">
>       <widgets>
>         <GmlRendererOL id="mergeGmlRenderer">
>           <htmlTagId>mainMapPane</htmlTagId>
>            <targetModel>mainMap</targetModel>
>           <mapContainerId>mainMapContainer</mapContainerId>
>           <lineColor>#FF0000</lineColor>
>           <lineWidth>1</lineWidth>
>           <pointDiameter>20</pointDiameter>
>         </GmlRendererOL>
>       </widgets>
>       <merges>
>         <merge>central</merge>
>       </merges>
>     </MergeModel>

htmlTagId is no property of GmlRendererOL, also mapContainerId, also
lineColor, also lineWidth, and also pointDiameter. For the current
parameters of GmlRendererOL, you can refer to context.xsd. But for the
most simple configuration, targetModel should be enough.

Regards,
Andreas.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

Reply via email to