[Mapserver-users] Find and ZoomTo shape file record
Steve McCrone
ms57 at streamyx.com
Wed Oct 1 00:00:51 PDT 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> var aForm
= document.forms[0]<BR> aForm.building.value =
inBuilding;<BR><BR> aForm.mode.value = "itemquery";<BR>
aForm.qlayer.value = "building_query";<BR> aForm.mapext.value =
"shapes";<BR> aForm.buffer.value = "0.005";<BR>
aForm.submit()<BR>}<BR><BR>and in my map file -<BR><BR>LAYER # this
layer just displays one building when it has been queried<BR> NAME
"building_query"<BR> DATA Build<BR> TYPE POLYGON<BR>
STATUS OFF<BR> FILTERITEM Bldg_name<BR> FILTER
"%building%"<BR> CLASS<BR> TEMPLATE
"demo.html" # Use to display
map<BR> #COLOR 255 0 0<BR> #OUTLINECOLOR 255
0 0<BR> 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