[mapguide-users] selectionXml - 1.time fast..then very slow...ZoomToView

Farah farah at egovernments.org
Fri Nov 24 03:53:13 EST 2006


Hi...

I am having a similar problem.
1.I do a query on a temporary layer and select a feature in it,
programmatically and then zoom to it with the help of setSelectionXml. This
works fine.

2. I then clear the selection before performing a new query on the temporary
source and then try to do the same as step 1.

3. However, the application hangs when I try to update the temporary feature
source with the new features.

4. This doesn't happen if I don't do SetSelectionXml. So I am guessing that
by selecting a feature in the temporary layer, the feature source is some
how getting locked. So the next time I try to update it, it hangs.

5. I tried to delete the feature source and layer every time I perform a new
search and create it again. However, when I try to delete the feature
source, it throws a file IO Exception. This error does not happen if no
selection had been made previously!

Any one has any pointers? :-)

farah


-----Original Message-----
From: Maciej Skorczewski [mailto:maciej.skorczewski at procad.pl] 
Sent: Friday, November 24, 2006 1:40 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] selectionXml - 1.time fast..then very
slow...ZoomToView

hello all!

i use (in php) this code to make xml of selected object...it works creat 
when i use it first time(it is very fast)...then when i clik another 
search results(streets and home)- so i use this script one more time - 
my browser (FF and IE) stop working on 10-20 sec. user can't make any 
action... why it is so? hove can i reload selectionXml (it is xml file )
  any sucestion?


what is faster? use pomQuery and selectionXml

or

ZoomToView(x, y, scale, refresh) ?





<?
$pomQuery->SetFilter("NRBUDP_ID = '$nrbudp_id' and 
NUMER_DOMU='$numer_domu'");

$pomResId = new 
MgResourceIdentifier("Library://mymap/Data/Nrbudp.FeatureSource");
	
$featureReader = $featureService->SelectFeatures($pomResId, 
"SDF_2_Schema:Nrbudp", $pomQuery);


$layer = $map->GetLayers()->GetItem('Nrbudp');
$selection = new MgSelection($map);
$selection->AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection->ToXml();
echo "<script type='text/javascript'>\n function OnPageLoad() {\n";
echo "selectionXml = '$selectionXml';\n 
parent.SetSelectionXML(selectionXml);\n";
echo "}\n</script>";
?>
then

i call in <body onload="OnPageLoad()">
-- 
Maciej Skorczewski




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org





More information about the Mapguide_users mailing list