[Mapserver-users] Find and ZoomTo shape file record

Steve McCrone ms57 at streamyx.com
Wed Oct 1 03:00:51 EDT 2003


This is a multi-part message in MIME format.

--Boundary_(ID_Np4G7A8NpGVZU5fFEswMBw)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

On my previous application the user was able to find a record in the shape
file and the map would zoom into that record and colour it red. I did this
by having a java script function -

function findBuilding(inBuilding){
  var aForm = document.forms[0]
  aForm.building.value  = inBuilding;

  aForm.mode.value = "itemquery";
  aForm.qlayer.value = "building_query";
  aForm.mapext.value = "shapes";
  aForm.buffer.value = "0.005";
  aForm.submit()
}

and in my map file -

LAYER   # this layer just displays one building when it has been queried
  NAME "building_query"
  DATA Build
  TYPE  POLYGON
  STATUS OFF
  FILTERITEM Bldg_name
  FILTER "%building%"
  CLASS
    TEMPLATE "demo.html"        # Use to display map
    #COLOR 255 0 0
    #OUTLINECOLOR 255 0 0
  END # CLASS
END # LAYER

And it works fine.
========================================
Now, I am working with the sample - DHTML rubber-band zoom sample from
http://maps.dnr.state.mn.us/mapserver_demos/workshop

An I am trying to achive the same functionality. Note: I cannot "fix" the
extents of the map area I want to zoom because the spatial coordinates of
the shape fuile records are constantly changing. Thanks


--Boundary_(ID_Np4G7A8NpGVZU5fFEswMBw)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>On my previous 
application the user was able to find a record in the shape<BR>file and the map 
would zoom into that record and colour it red. I did this<BR>by having a java 
script function -<BR><BR>function findBuilding(inBuilding){<BR>&nbsp; var aForm 
= document.forms[0]<BR>&nbsp; aForm.building.value&nbsp; = 
inBuilding;<BR><BR>&nbsp; aForm.mode.value = "itemquery";<BR>&nbsp; 
aForm.qlayer.value = "building_query";<BR>&nbsp; aForm.mapext.value = 
"shapes";<BR>&nbsp; aForm.buffer.value = "0.005";<BR>&nbsp; 
aForm.submit()<BR>}<BR><BR>and in my map file -<BR><BR>LAYER&nbsp;&nbsp; # this 
layer just displays one building when it has been queried<BR>&nbsp; NAME 
"building_query"<BR>&nbsp; DATA Build<BR>&nbsp; TYPE&nbsp; POLYGON<BR>&nbsp; 
STATUS OFF<BR>&nbsp; FILTERITEM Bldg_name<BR>&nbsp; FILTER 
"%building%"<BR>&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; TEMPLATE 
"demo.html"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use to display 
map<BR>&nbsp;&nbsp;&nbsp; #COLOR 255 0 0<BR>&nbsp;&nbsp;&nbsp; #OUTLINECOLOR 255 
0 0<BR>&nbsp; END # CLASS<BR>END # LAYER<BR><BR>And it works 
fine.<BR>========================================<BR>Now, I am working with the 
sample - DHTML rubber-band zoom sample from<BR></FONT><A 
href="http://maps.dnr.state.mn.us/mapserver_demos/workshop"><FONT 
face="Times New Roman" 
size=3>http://maps.dnr.state.mn.us/mapserver_demos/workshop</FONT></A><BR><BR><FONT 
face="Times New Roman" size=3>An I am trying to achive the same functionality. 
Note: I cannot "fix" the<BR>extents of the map area I want to zoom because the 
spatial coordinates of<BR>the shape fuile records are constantly changing. 
Thanks</FONT><BR></FONT></DIV></BODY></HTML>

--Boundary_(ID_Np4G7A8NpGVZU5fFEswMBw)--



More information about the mapserver-users mailing list