<!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. Part of that is the automatic passing of the Google Earth BBOX
parameter. Are you doing this from Google Earth? No, the application
will not work without BBOX.</FONT></SPAN></DIV>
<DIV> </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 the <A
href="http://mapguide.osgeo.org/livegallery.html">http://mapguide.osgeo.org/livegallery.html</A> 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> </DIV>
<DIV
style="FONT-SIZE: 12px; COLOR: #909090; FONT-FAMILY: Arial Narrow">------------------</DIV>
<DIV>
<P>
--鞠斌</P></DIV>
<DIV><?php</DIV>
<DIV> //This file delivers KML network link content directly<BR> //to
Google Earth.<BR> include 'UtilityFunctions.php';</DIV>
<DIV> //uses the Wrapper.kml file for KML Network Link
Skeleton<BR> $doc =
DOMDocument::load('Wrapper.kml');<BR> $networkLinkNode =
$doc->getElementsByTagName('href')->item(0);<BR> $networkLinkNode->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> <BR> $layerDefinition =
$doc->saveXML();<BR> header('Content-Type:
application/keyhole');<BR> header('Content-Length: ' .
strlen($layerDefinition));</DIV>
<DIV> echo $layerDefinition;</DIV>
<DIV>?><BR></DIV>
<DIV> </DIV>
<DIV
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial Narrow">------------------ 原始邮件 ------------------</DIV>
<DIV style="FONT-SIZE: 12px">
<DIV id=menu_sender><B>发件人:</B> "Kenneth Skovhede, GEOGRAF
A/S"<ks@geograf.dk>;</DIV>
<DIV><B>发送时间:</B> 2008年5月28日(星期三) 下午03:56</DIV>
<DIV><B>收件人:</B> "MapGuide Users Mail
List"<mapguide-users@lists.osgeo.org>; </DIV>
<DIV></DIV>
<DIV><B>主题:</B> Re: [ZS2] [mapguide-users] What happens if the BBOX does
not exist?</DIV></DIV>
<DIV> </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>
$queryOptions->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>
{<BR> // split the client's BBOX return by
commas and spaces to obtain an array of coordinates<BR>
$coords = preg_split('/,|\s/', $_GET['BBOX']);<BR>
$lowerLeft = $geometryFactory->CreateCoordinateXY($coords[0],
$coords[1]);<BR> $upperRight =
$geometryFactory->CreateCoordinateXY($coords[2], $coords[3]);<BR><BR>
$queryEnvelope = new MgEnvelope($lowerLeft,
$upperRight);<BR> }<BR><BR>$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);<BR>
$queryOptions = new MgFeatureQueryOptions();<BR><BR>
$filter = urldecode($_GET["FILTER"]) ;<BR> //echo
"<p>$filter</p>";<BR> echo
'<Folder>';<BR> echo '<description>MapGuide - Wheaton
Parcels Filtered ['.$filter.'] </description>';<BR> echo
'<name>Wheaton Parcels</name>';<BR> echo
'<visibility>0</visibility>';<BR> echo
'<open>1</open>';<BR><BR>
$queryOptions->SetFilter($filter);<BR> //Feature Source being
used in the application<BR> $featureReader =
$featureService->SelectFeatures(new
MgResourceIdentifier("Library://test/Data/province.FeatureSource"),
"province", $queryOptions);<BR> //if($featureReader!=null) echo
"<p>feature success!</p>";<BR> $geometryReaderWriter
= new MgAgfReaderWriter();<BR> echo
'<p>test1</p>';<BR> //Read Feature Source Attributes
for populating Tooltip on Google Earth<BR> //Change this if using
a different Feature Source<BR> $byteReader =
$featureReader->GetGeometry('Geometry');<BR> //if($byteReader)
echo '<p>feature success!</p>';<BR> $geometry =
$geometryReaderWriter->Read($byteReader);<BR><BR>
<DIV>
<P>
<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>