selectionXml - 1.time fast..then very slow...ZoomToView

Tom Chadwin tom.chadwin at nnpa.org.uk
Mon Nov 27 06:45:47 EST 2006


Do any other objects require closing to improve performance, such as maps?

Thanks

Tom



Dave Wilson-3 wrote:
> 
> The most common problem we have seen that exhibits such behaviour is
> using a FeatureReader and not closing it after finishing with it. In
> this case after the line of code:
> 
> $selection->AddFeatures($layer, $featureReader, 0);
> 
> You might try a $featureReader->Close();
> 
> This of course assumes the reader is no longer needed.
> 
> Dave
> 
> -----Original Message-----
> From: Farah [mailto:farah at egovernments.org] 
> Sent: Friday, November 24, 2006 1:53 AM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] selectionXml - 1.time fast..then very
> slow...ZoomToView
> 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/selectionXml---1.time-fast..then-very-slow...ZoomToView-tf2696338.html#a7558697
Sent from the MapGuide Users mailing list archive at Nabble.com.





More information about the Mapguide-users mailing list