mapping query results with dbox and mapserv.js

william paul williampaul28 at YAHOO.COM
Sun Dec 10 09:05:26 EST 2006


Hi Rich:
   
  I have modified the map file as you told me:
   
  HEADER main.html
  TEMPLATE empty.html
  CLASS
   
  END
   
  When I try to display the query results I get only the main.html without any data inside, like I just want to display the html file. 

  The emty.html:
   
  <html><head></head><body></body></html>
   
  If I try to query from the map I get the same result: the main.html page without any data inside
   
  Where I do wrong?
   
  Thank you again
   
  William
  
Richard Greenwood <richard.greenwood at gmail.com> wrote:
  On 12/10/06, william paul wrote:
> Hello:
> I am using dBox, the example from
> http://maps.dnr.state.mn.us/tools/dbox/example/example.html.
> I have a database on Sql ServerExpress and I am using ASPX to query the
> database and display the results
> I want to map some of the results, but I don't know how to do it. I tried
> with the example provided by Rich:
>
> mapserv.exe?map=my.map
> &mode=itemnquery
> &qitem=pidn
> &qlayer=join_region_spatial
> &mapext=shapes
> &savequery=true
> &qstring=22-41-16-33-4-11-004
>
> but instead of mapping the result I get a basic mapserver query results,
> like they were queried from the map
>
> How can I map the query results from a database with dbox.js and mapserv.js
> on the example from
> http://maps.dnr.state.mn.us/tools/dbox/example/example.html?
>
> Thank you in advance
>
> William

You need to set a template for the queried layer to display the map.
In other words, the template for your query layer has to be an html
page with a map in it. You set this in the .map file.

The map file definition for the query string above is shown below. The
HEADER just references my main html map page (it is not a special
page). The TEMPLATE is an empty file. The reason for this is that if a
query result returns more than one object you will get one map for
each object if you reference the html map page with the TEMPLATE key
word, but referencing it with the HEADER causes all queried objects to
be drawn on one map, and zoomed to an extent including all of the
objects.


Layer
NAME "join_region_spatial"
STATUS OFF # either set to DEFAULT, or explicitly call for it
TYPE polygon
DATA "ownership_region.shp"
FILTERITEM Pidn
Filter "%pidn%"
HEADER "sc_map.html"
TEMPLATE "empty2.html"
CLASS
OUTLINECOLOR 255 255 0
SYMBOL 'solid' SIZE 6
END # class
END # layer



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


 
---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061210/191b9db1/attachment.html


More information about the mapserver-users mailing list