<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=x-gbk" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I see no problem with it.<br>
The filter is bascially an SQL statement, so you can try changing the
URL to:<br>
<a moz-do-not-send="true"
href="http://localhost:8008/mapguide/test/KMLContentFactory.php?FILTER=%22.urlencode%28$_GET%5B%22PropertyName">http://localhost:8008/mapguide/test/KMLContentFactory.php?FILTER=FID>0</a><br>
<br>
Where FID is an existing numeric column.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
鞠斌 skrev:
<blockquote cite="mid:tencent_50EAE0DF177046BE01C7FA3C@qq.com"
type="cite">
<div>my codes is from the <a moz-do-not-send="true"
href="http://mapguide.osgeo.org/livegallery.html">http://mapguide.osgeo.org/livegallery.html</a> and
I want to do the same thing as <a moz-do-not-send="true"
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: rgb(144, 144, 144); 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 moz-do-not-send="true"
href="http://localhost:8008/mapguide/test/KMLContentFactory.php?FILTER=%22.urlencode%28$_GET%5B%22PropertyName">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: 2px 0px; font-size: 12px; font-family: Arial Narrow;">--
---------------- 原始邮件 ------------------</div>
<div style="font-size: 12px;">
<div id="menu_sender"><b>发件人:</b> "Kenneth Skovhede, GEOGRAF
A/S"<a class="moz-txt-link-rfc2396E" href="mailto:ks@geograf.dk"><ks@geograf.dk></a>;</div>
<div><b>发送时间:</b> 2008年5月28日(星期三) 下午03:56</div>
<div><b>收件人:</b> "MapGuide Users Mail
List"<a class="moz-txt-link-rfc2396E" href="mailto:mapguide-users@lists.osgeo.org"><mapguide-users@lists.osgeo.org></a>; </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 size="4" width="90%">
_______________________________________________
mapguide-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a moz-do-not-send="true" 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>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
</body>
</html>