<!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 6.00.2800.1476" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thanks, Paul. It worked beautifully.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>At the moment, I create a new instance of a
mapobject, having to hardcode the mapfile location. Is there a way to get access
to the mapobject of the main application? My search page sits in an Iframe, so
it's not really part of it. If I pinch the session ID using javascript, can I
use that in php to tap into the mapobject of the main chameleon instance? This
would allow me to add some more functionality.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>-----Original Message-----<BR>From: Paul Spencer
[mailto:pspencer@dmsolutions.ca] <BR>Sent: 19 October 2004 21:48<BR>To: Jacob
Delfos<BR>Cc: <A
href="mailto:chameleon@lists.maptools.org">chameleon@lists.maptools.org</A><BR>Subject:
Re: [Chameleon] search attributes -> zoom to result</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>Jacob,</DIV>
<DIV> </DIV>
<DIV>once you know the position in the dbf file, you should be able to open
<BR>the mapfile using php_mapscript and then do something like:</DIV>
<DIV> </DIV>
<DIV>$nlayer = <index of layer in mapfile>;<BR>$nShape = <index of
shape>;<BR>$oLayer = $oMap->getLayer( $nLayer
);<BR>$oLayer->open();<BR>$oShape = $oLayer->getShape( $nShape
);<BR>//bounds is a rectObj<BR>$oRect = $oShape->bounds;<BR>//can compute
extents to zoom to from $oRect->minx miny maxx
maxy<BR>$oShape->free();<BR>$oLayer->close();</DIV>
<DIV> </DIV>
<DIV>If you don't want to use the mapfile then you can use mapscript's
<BR>shapefileobj to accomplish the same thing I think</DIV>
<DIV> </DIV>
<DIV>Cheers,</DIV>
<DIV> </DIV>
<DIV>Paul</DIV>
<DIV> </DIV>
<DIV>Jacob Delfos wrote:<BR>> Hi all,<BR>> <BR>> I'm trying to
create the functionality of searching a layer for an <BR>> attribute value,
and then zooming to the object (I know there have been <BR>> many posts about
this... sorry... I couldn't actually find a solution).<BR>> <BR>> I
got the searching part figured out; I put an iframe in my template, <BR>>
which holds a page that allows for selecting a layer to search, and then
<BR>> searches for the searchstring in all the attributes of that layer. I'm
<BR>> actually running this independently of the rest of the site (the page
<BR>> does not get submitted for a search, only the iframe is). I store the
<BR>> extent in the attributes, and use javascript to make the mapimage zoom
<BR>> to the extent of the objects(s) it has found. My problem is how to get
<BR>> the real spatial extent of the object. I'm using a basic php script
that <BR>> finds out the name of the dataset, opens its dbf, and searches the
<BR>> attributes. I suppose this is not ideal, since it does not interface
<BR>> with chameleon. It's kind of patchy.<BR>> <BR>> What is the
easiest way to get an object's extent, if I know its <BR>> sequential
position in the dataset? I would prefer not to have to submit <BR>> the whole
page....<BR>> <BR>> Any tips will be much appreciated.<BR>>
<BR>> Jacob<BR>> <BR>> <BR>> JACOB DELFOS<BR>>
SPATIAL INFORMATION ANALYST<BR>> Maunsell Australia Pty Ltd<BR>> 629
Newcastle Street<BR>> Leederville WA 6007<BR>> PO Box 81<BR>>
Leederville WA 6902<BR>> Western Australia<BR>> ABN 20 093 846
925<BR>> <BR>> Tel + 61 8 9281 6185<BR>>
Fax + 61 8 9281 6297<BR>> <A
href="mailto:jacob.delfos@maunsell.com">jacob.delfos@maunsell.com</A> <<A
href="mailto:jacob.delfos@maunsell.com">mailto:jacob.delfos@maunsell.com</A>><BR>>
<BR>> <BR>>
------------------------------------------------------------------------<BR>>
<BR>> _______________________________________________<BR>> Chameleon
mailing list<BR>> <A
href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org</A><BR>>
<A
href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</A><BR></FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="mailto:jacob.delfos@maunsell.com"></A></FONT> </DIV></BODY></HTML>