[Geomoose-users] 3.x Layer Search Feature
Clinton Olsen
ClintonO at emery.utah.gov
Thu Sep 16 14:50:15 PDT 2021
Thanks Brent and Chris for those suggestions. I was overthinking this
problem.
On Thu, Sep 16, 2021 at 3:30 PM Brent Fraser <bfraser at geoanalytic.com>
wrote:
> Hi Clinton
>
> You need to ADD a "mapserver-wfs" mapsource to your mapbook, then edit
> the exisiting "mapserver" mapsource to use it for attribute queries by
> adding a query-as attribute to the layer tag:
>
> <map-source name="cdcem" type="mapserver" title="CD Cemetery">
> <file>./demo/castledale_cem/castledale.map</file>
> <param name="typename" value="ms:cdcem"/>
> <layer name="cdcem" selectable="true" title="CD Cemetery"
> *query-as="cdcem-wfs/cdcem*">
> <template name="identify"><![CDATA[
> <div>
> <div class="feature-class cdcem"><h3>Grave
> Information</h3></div>
> <div class="item"><b>Name:</b> {{ properties.Deceased_1 }}</div>
> <div class="item"><b>Birth Date:</b> {{ properties.Birth_Da_1
> }}</div>
> <div class="item"><b>Death Date:</b> {{ properties.Death_Da_1
> }}</div>
> </div>
> ]]></template>
> </layer>
> <param name="FORMAT" value="image/png"/>
> </map-source>
>
> <map-source name="cdcem-wfs" type="mapserver-wfs" title="CD Cemetery">
> <file>./demo/castledale_cem/castledale.map</file>
> <param name="typename" value="ms:cdcem"/>
> <layer name="cdcem" status="off" title="CD Cemetery">
> <template name="search"><![CDATA[
> <div class="search-result">
> <div class="search-label">{{ properties.Lname
> }}</div>
> <div class="search-action">
> <div style="padding: 2px"><a onClick="app.zoomToExtent([{{
> properties.boundedBy | join }}], 'EPSG:3857')" class="zoomto-link"><i
> class="fa fa-search"></i></a></div>
> </div>
> </div>
> ]]></template>
> </layer>
> </map-source>
>
> Note the status=off in the wfs layer so the geometry is not shown on the
> map.
>
> Best Regards,
> Brent Fraser
>
>
> ------------------------------
> *From*: "Clinton Olsen" <ClintonO at emery.utah.gov>
> *Sent*: 9/16/21 2:06 PM
> *To*: Brent Fraser <bfraser at geoanalytic.com>
> *Cc*: geomoose-users at lists.osgeo.org
> *Subject*: Re: [Geomoose-users] 3.x Layer Search Feature
>
> Hi Brent,
>
> I have the identify service working in the mapbook. The service I am
> running into trouble with is the layer search service for 3.9. In the demo
> mapbook I can do the drop down, and search for a parcel. I need that
> search feature for my mapbooks. In the code below my type is mapserver.
> In the demo code for parcels the type is mapserver-wfs. Mapserver-wfs is
> supported for the layer search feature but mapserver is not. Do I need to
> change my shapefile so it is either a wfs or mapserver-wfs? I hope I have
> explained better what I am trying to figure out. Thanks.
>
> <map-source name="cdcem" type="mapserver" title="CD Cemetery">
> <file>./demo/castledale_cem/castledale.map</file>
> <param name="typename" value="ms:cdcem"/>
> <layer name="cdcem" selectable="true" title="CD Cemetery">
> <template name="identify"><![CDATA[
> <div>
> <div class="feature-class cdcem"><h3>Grave Information</h3></div>
> <div class="item"><b>Name:</b> {{ properties.Deceased_1 }}</div>
> <div class="item"><b>Birth Date:</b> {{ properties.Birth_Da_1 }}</div>
> <div class="item"><b>Death Date:</b> {{ properties.Death_Da_1 }}</div>
> </div>
> ]]></template>
> <template name="search"><![CDATA[
> <div class="search-result">
> <div class="search-label">{{ properties.Lname }}</div>
> <div class="search-action">
> <div style="padding: 2px"><a onClick="app.zoomToExtent([{{
> properties.boundedBy | join }}], 'EPSG:3857')" class="zoomto-link"><i
> class="fa fa-search"></i></a></div>
> </div>
> </div>
> ]]></template>
> </layer>
> <param name="FORMAT" value="image/png"/>
> </map-source>
>
> On Thu, Sep 16, 2021 at 1:50 PM Brent Fraser <bfraser at geoanalytic.com>
> wrote:
>
> Hi Clinton
>
> Do you mean the Identify (mouse click) service, or the Search service
> (type in attribute value)?
>
> Best Regards,
> Brent Fraser
>
>
>
> ------------------------------
> *From*: "Clinton Olsen" <ClintonO at emery.utah.gov>
> *Sent*: 9/16/21 1:17 PM
> *To*: geomoose-users at lists.osgeo.org
> *Subject*: [Geomoose-users] 3.x Layer Search Feature
>
> I am working on updating Geomoose from 2.9 to 3.8. A problem I am running
> into is the layer search feature. The search operations feature is only
> supported on vector, geojson, ags-vector, wfs and mapserver-wfs map-source
> type. Do I need to do something different to the shapefiles I am using in
> order to get this feature to work, or just change the coding in the mapbook
> for it to work?
>
> Sample code:
> <map-source name="bookpage" type="mapserver" title="Plat Info">
> <file>./demo/book_page/book_page.map</file>
> <layer name="bookpage" status="off">
> <template name="identify"><![CDATA[
> <div>
> <div class="feature-class bookpage"><h3>Emery County Plat
> Info</h3></div>
> <div class="item"><b>Plat:</b> {{ properties.booktxt }}/{{
> properties.pagetxt }}</div>
> </div>
> ]]></template>
> </layer>
> <param name="FORMAT" value="image/png"/>
> </map-source>
>
> --
> --
> Clinton Olsen
> IS/GIS Technician
>
>
>
> --
> --
> Clinton Olsen
> *EMERY COUNTY*
> IS/GIS Technician
> 435-381-3592
>
--
--
Clinton Olsen
*EMERY COUNTY*
IS/GIS Technician
435-381-3592
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20210916/097b5520/attachment.html>
More information about the Geomoose-users
mailing list