Hi, I would like to know how to make a map where I can click on a feature
and have it return the feature's record in either WMS or WFS. I have been
through the tutorials and this forum, but I do not see how this should work.
My Config.xml file is below for a WMS service. I am trying to make the click
happen with the featureInfoRequest as shown below. Thank you, Lela 


<?xml
version="1.0" encoding="utf-8" standalone="no"?>

<MapbuilderConfig version="0.2.1" id="simpleTemplate"
xmlns="http://mapbuilder.sourceforge.net/mapbuilder";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://mapbuilder.sourceforge.net/mapbuilder
../../lib/schemas/config.xsd">

  <models>


Context for the main map 

    <OwsContext id="mainMap">


Pointer to the Context XML file holding the
layers

     
<defaultModelUrl>doarContext.xml</defaultModelUrl>


      <widgets>


Draws the main map in the "mainMapPane" div
tag

        <MapPaneOL
id="mainMapWidget">

         
<htmlTagId>mainMapPane</htmlTagId>


Pegs the size of the map to the window specified in
the Context XML file - if this is "false," the
map will be full screen

         
<fixedSize>true</fixedSize>


WMS layers will tile outside of the display for
faster rendering when panning

         
<displayOutsideMaxExtent>true</displayOutsideMaxExtent>


Reprojects WMS layers

         
<imageReproject>true</imageReproject>

        </MapPaneOL>


Draws the legend in the "legend" div
tag

    <Legend id="contextLegend">

      <htmlTagId>legend</htmlTagId>

    </Legend>


      </widgets>

      <tools>


Remembers the zoom history to enable the "Back" and
"Forward" buttons below

    <History id="extentHistory"/>


Part of the not working click feature - Initiates a WFS GetFeature request
from
the target model "featureInfoRequest" below -  I think this part
working
(look in Firebug and the WFS request is being made) but it returns no data.
This
could be because there are no WFS layers on the map right now, or it could
be
that the area of the click is too small, or it could be that the area (set
in
the "tolerance" tag in the
"GetFeatureInfoWSR"
widget below) is too big and can't return just one feature. We could test
this
by removing the "featureCount" tag in this
request.

   
<WebServiceRequest id="featureInfoController">

     
<targetModel>featureInfoResponse</targetModel>

     
<requestName>wfs:GetFeature</requestName>

     
<infoFormat>application/vnd.ogc.gml</infoFormat>

      <featureCount>1</featureCount>

    </WebServiceRequest>


      </tools>


I think the
nodeSelectXpath
sets where layers are located in the Context file - this is an optional
file,
and I'm not really sure of it's purpose. It could be that if we remove the
"/wmc:Layer" text, we might be able to see WFS layers that are added in the
legend. WFS layers are added in the Context file with the "FeatureType" tag
and
not the "Layer"
tag.

     
<nodeSelectXpath>/wmc:ViewContext/wmc:ResourceList/wmc:Layer</nodeSelectXpath>

    </OwsContext>


This model is also part of the not working click
feature - this places the output of the above "WebServiceRequest" into the
"workspace" div tag on the html page. Unsure what the "outputNodeId" tag is
doing. I also don't fully understand the what the
"namespace" tag is all
about.

    <Model id="featureInfoResponse">

      <widgets>

    <FeatureInfo id="features">

      <htmlTagId>workspace</htmlTagId>

     
<outputNodeId>workspaceCanvas</outputNodeId>

    </FeatureInfo>

      </widgets>

      <namespace>

xmlns:gml='http://www.opengis.net/gml'
xmlns:wfs='http://www.opengis.net/wfs'
xmlns:topp='http://www.openplans.org/topp'

      </namespace>

    </Model>

  </models>


These widgets set up the buttons in the button bar
("mainButtonBar" div tag on the html page)

  <widgets>


Identify tool button. Points to the
"featureInfoControler" web service request above. 

     <GetFeatureInfoWSR id="getFeatureInfo">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>RadioButton</class>

    <tolerance>10</tolerance>

   
<enabledSrc>/images/QueryEnable.png</enabledSrc>

   
<disabledSrc>/images/QueryDisable.png</disabledSrc>

   
<controller>featureInfoController</controller>

     </GetFeatureInfoWSR>


Zoom in

     <ZoomIn id="zoomIn">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>RadioButton</class>

    <selected>true</selected>

   
<enabledSrc>/images/ZoomInEnable.png</enabledSrc>

   
<disabledSrc>/images/ZoomInDisable.png</disabledSrc>

     </ZoomIn>


Zoom out

     <ZoomOut id="zoomOut">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>RadioButton</class>

   
<enabledSrc>/images/ZoomOutEnable.png</enabledSrc>

   
<disabledSrc>/images/ZoomOutDisable.png</disabledSrc>

     </ZoomOut>


Pan

     <DragPan id="dragPan">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>RadioButton</class>

   
<enabledSrc>/images/PanEnable.png</enabledSrc>

   
<disabledSrc>/images/PanDisable.png</disabledSrc>

     </DragPan>


Go back in zoom history

    <Back id="back">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>Button</class>

   
<disabledSrc>/images/UndoDisable.png</disabledSrc>

     </Back>


Go forward in zoom history

     <Forward id="forward">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>Button</class>

   
<disabledSrc>/images/RedoDisable.png</disabledSrc>

     </Forward>


Zoom out to the full extent

     <Reset id="reset">

    <buttonBar>mainButtonBar</buttonBar>

    <targetModel>mainMap</targetModel>

    <class>Button</class>

   
<disabledSrc>/images/ResetExtentDisable.png</disabledSrc>

     </Reset>

  </widgets>


Skin - not sure what this does or if we could
customize

 
<skinDir>http://maps.nijel.org/mapbuilder/lib/skin/default</skinDir>

</MapbuilderConfig>






-- 
View this message in context: 
http://www.nabble.com/Click-on-Features-in-Mapbuilder-and-get-a-corresponding-record-to-show-up-tp16930110p16930110.html
Sent from the MapBuilder Users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

Reply via email to