<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=218100616-28052008><FONT face=Arial 
color=#0000ff size=2>If you are adding your PHP as a network link layer in 
Google Earth, Google Earth will issue a request to that page on any pan or 
zoom.&nbsp; Part of that is the automatic passing of the Google Earth BBOX 
parameter.&nbsp; Are you doing this from Google Earth?&nbsp; No, the application 
will not work without BBOX.</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face=Tahoma size=1>Andy Morsell, P.E.</FONT></SPAN> 
<BR><SPAN lang=en-us><FONT face=Tahoma size=1>Spatial Integrators, 
Inc.</FONT></SPAN> <BR><SPAN lang=en-us><FONT face=Tahoma size=1><A 
href="http://www.SpatialGIS.com">http://www.SpatialGIS.com</A></FONT></SPAN> 
</P>
<DIV>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mapguide-users-bounces@lists.osgeo.org 
[mailto:mapguide-users-bounces@lists.osgeo.org] <B>On Behalf Of 
</B>??<BR><B>Sent:</B> Wednesday, May 28, 2008 1:00 AM<BR><B>To:</B> mapguide 
users mail list<BR><B>Subject:</B> SPAM-LOW: 回复: [ZS2] [mapguide-users] What 
happens if the BBOX does not exist?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>my codes is from&nbsp; the <A 
href="http://mapguide.osgeo.org/livegallery.html">http://mapguide.osgeo.org/livegallery.html</A>&nbsp;and 
I want to do the same thing as <A 
href="http://data.mapguide.com/mapguide/DynamicKml/GoogleEarth.php">http://data.mapguide.com/mapguide/DynamicKml/GoogleEarth.php</A> Ijust 
used their codes and use my data instead,but I can't get the right result.</DIV>
<DIV>If there is no BBOX,can I get the Geometry?</DIV>
<DIV>the file which invoke that function is just as follows.</DIV>
<DIV>&nbsp;</DIV>
<DIV 
style="FONT-SIZE: 12px; COLOR: #909090; FONT-FAMILY: Arial Narrow">------------------</DIV>
<DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
--鞠斌</P></DIV>
<DIV>&lt;?php</DIV>
<DIV>&nbsp;//This file delivers KML network link content directly<BR>&nbsp;//to 
Google Earth.<BR>&nbsp;include 'UtilityFunctions.php';</DIV>
<DIV>&nbsp;//uses the Wrapper.kml file for KML Network Link 
Skeleton<BR>&nbsp;$doc = 
DOMDocument::load('Wrapper.kml');<BR>&nbsp;$networkLinkNode = 
$doc-&gt;getElementsByTagName('href')-&gt;item(0);<BR>&nbsp;$networkLinkNode-&gt;nodeValue 
= "<A 
href='http://localhost:8008/mapguide/test/KMLContentFactory.php?FILTER=".urlencode($_GET["PropertyName'>http://localhost:8008/mapguide/test/KMLContentFactory.php?FILTER=".urlencode($_GET["PropertyName</A>"]." 
".$_GET["Operator"]." ".$_GET["VAL"]);<BR>&nbsp;<BR>&nbsp;$layerDefinition = 
$doc-&gt;saveXML();<BR>&nbsp;header('Content-Type: 
application/keyhole');<BR>&nbsp;header('Content-Length: ' . 
strlen($layerDefinition));</DIV>
<DIV>&nbsp;echo $layerDefinition;</DIV>
<DIV>?&gt;<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial Narrow">------------------&nbsp;原始邮件&nbsp;------------------</DIV>
<DIV style="FONT-SIZE: 12px">
<DIV id=menu_sender><B>发件人:</B>&nbsp;"Kenneth Skovhede, GEOGRAF 
A/S"&lt;ks@geograf.dk&gt;;</DIV>
<DIV><B>发送时间:</B>&nbsp;2008年5月28日(星期三) 下午03:56</DIV>
<DIV><B>收件人:</B>&nbsp;"MapGuide Users Mail 
List"&lt;mapguide-users@lists.osgeo.org&gt;; </DIV>
<DIV></DIV>
<DIV><B>主题:</B>&nbsp;Re: [ZS2] [mapguide-users] What happens if the BBOX does 
not exist?</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT-WEIGHT: normal">You should provide more surrounding code, or 
say where the code is from.<BR>In the code below, the envelope is never used, so 
it doesn't matter if it is there.<BR>I assume it was supposed to be combined 
with the attribute filter like this:<BR>if ($queryEnvelope != null)<BR>&nbsp; 
&nbsp; $queryOptions-&gt;SetSpatialFilter($queryEnvelope)<BR><BR><PRE class=moz-signature cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</PRE><BR><BR>鞠斌 skrev: 
<BLOCKQUOTE cite=mid:tencent_1D54D43E677E0DFC17CE3A83@qq.com type="cite">Why 
  the 'BBOX' does not exist?If this happens,can I get the 'geometry'?<BR>the 
  codes is as following:<BR>if (array_key_exists('BBOX', $_GET))<BR>&nbsp; 
  &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; // split the client's BBOX return by 
  commas and spaces to obtain an array of coordinates<BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; $coords = preg_split('/,|\s/', $_GET['BBOX']);<BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; $lowerLeft = $geometryFactory-&gt;CreateCoordinateXY($coords[0], 
  $coords[1]);<BR>&nbsp; &nbsp; &nbsp; &nbsp; $upperRight = 
  $geometryFactory-&gt;CreateCoordinateXY($coords[2], $coords[3]);<BR><BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; $queryEnvelope = new MgEnvelope($lowerLeft, 
  $upperRight);<BR>&nbsp; &nbsp; }<BR><BR>$featureService = 
  $siteConnection-&gt;CreateService(MgServiceType::FeatureService);<BR>&nbsp; 
  &nbsp; $queryOptions = new MgFeatureQueryOptions();<BR><BR>&nbsp; &nbsp; 
  $filter = urldecode($_GET["FILTER"]) ;<BR>&nbsp; &nbsp; //echo 
  "&lt;p&gt;$filter&lt;/p&gt;";<BR>&nbsp; &nbsp; echo 
  '&lt;Folder&gt;';<BR>&nbsp; &nbsp; echo '&lt;description&gt;MapGuide - Wheaton 
  Parcels Filtered ['.$filter.'] &lt;/description&gt;';<BR>&nbsp; &nbsp; echo 
  '&lt;name&gt;Wheaton Parcels&lt;/name&gt;';<BR>&nbsp; &nbsp; echo 
  '&lt;visibility&gt;0&lt;/visibility&gt;';<BR>&nbsp; &nbsp; echo 
  '&lt;open&gt;1&lt;/open&gt;';<BR><BR>&nbsp; &nbsp; 
  $queryOptions-&gt;SetFilter($filter);<BR>&nbsp; &nbsp; //Feature Source being 
  used in the application<BR>&nbsp; &nbsp; $featureReader = 
  $featureService-&gt;SelectFeatures(new 
  MgResourceIdentifier("Library://test/Data/province.FeatureSource"), 
  "province", $queryOptions);<BR>&nbsp; &nbsp; //if($featureReader!=null) echo 
  "&lt;p&gt;feature success!&lt;/p&gt;";<BR>&nbsp; &nbsp; $geometryReaderWriter 
  = new MgAgfReaderWriter();<BR>&nbsp; &nbsp; echo 
  '&lt;p&gt;test1&lt;/p&gt;';<BR>&nbsp; &nbsp; //Read Feature Source Attributes 
  for populating Tooltip on Google Earth<BR>&nbsp; &nbsp; //Change this if using 
  a different Feature Source<BR>&nbsp; &nbsp; $byteReader = 
  $featureReader-&gt;GetGeometry('Geometry');<BR>&nbsp; &nbsp; //if($byteReader) 
  echo '&lt;p&gt;feature success!&lt;/p&gt;';<BR>&nbsp; &nbsp; $geometry = 
  $geometryReaderWriter-&gt;Read($byteReader);<BR><BR>
  <DIV>
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp; <BR></P></DIV><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>
  </PRE></BLOCKQUOTE></DIV></BODY></HTML>