[mapguide-users] Zoom To selection

andrea tiveron (e-metodi) andrea.tiveron at e-metodi.it
Tue Feb 2 12:56:29 EST 2010


I have the same problem
I work with SDF
my code below is perfect to update a feature (it's a polygon)
my problem is when I select a feature and after update the feature on the
same map when I make a selection
the UpdateFeatures command work a lot of time, no error return, but the
value is not update

please help me
andrea


            Dim realPath As String =
Request.ServerVariables("APPL_PHYSICAL_PATH")
            Dim configPath As String = realPath + "webconfig.ini"
            MapGuideApi.MgInitializeWebTier(configPath)
            Dim userInfo As New MgUserInformation("Markup", "Markup")
            Dim site As New MgSite()
            site.Open(userInfo)
            Dim sessionId As String = site.CreateSession()
            Dim userInfoNew As MgUserInformation = New
MgUserInformation(sessionId)
            Dim siteConnection As New MgSiteConnection()
            siteConnection.Open(userInfoNew)
            Dim resourceService As MgResourceService =
siteConnection.CreateService(MgServiceType.ResourceService)
            Dim featureService As MgFeatureService =
siteConnection.CreateService(MgServiceType.FeatureService)
            Dim dataSource As String = "Library://e-facility/SUAA/" +
namePlan + "/Markup/Data/" + nameLayer + ".FeatureSource"
            Dim featureSourceId As MgResourceIdentifier = New
MgResourceIdentifier(dataSource)
            Dim featureSourceExists As Boolean =
DoesResourceExist(featureSourceId, resourceService)
            If featureSourceExists = False Then
                Response.Write("<div
style=""text-align:justify""><b>Attenzione!</b><br />Non trovato!</div>" &
vbCrLf)
                Response.Write("<script language=""javascript"">" & vbCrLf)
                Response.Write("parent.functionTestConferma(false);" &
vbCrLf)
                Response.Write("</script>" & vbCrLf)
            End If

            Dim className As String = "ambienti"
            Dim filterText As String = "Key = '" + Trim(CStr(IDSpazio)) +
"'"
            Dim queryOption As MgFeatureQueryOptions = New
MgFeatureQueryOptions()
            queryOption.SetFilter(filterText)
            Dim propertyValues As MgPropertyCollection = New
MgPropertyCollection()
            propertyValues.Add(New MgStringProperty("Name", DesSpazio))
            Dim updateFeatures As MgUpdateFeatures = New
MgUpdateFeatures(className, propertyValues, "Key = '" + Trim(CStr(IDSpazio))
+ "'")
            Dim commands As New MgFeatureCommandCollection()
            commands.Add(updateFeatures)
            featureService.UpdateFeatures(featureSourceId, commands, False)


-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Mbonnet
Sent: martedì 24 aprile 2007 17.15
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] Zoom To selection


hi, did you solved this problem because i have the same one

Farah-2 wrote:
> 
>  
> 
>  
> 
> Hi Friends!
> 
>  
> 
> I had posted this problem some time ago. But I wasn't able to come up with
> any solution to this. Does anybody have any pointers regarding the below
> mentioned problem?
> 
>  
> 
> I am doing a search based on some condition and I am marking an existing
> layer with some markers. At the same time, I am adding these results to
> the
> map selection and I am zooming to the selected results using:
> 
> parent.parent.SetSelectionXML(selectionXml);
> 
> parent.parent.ExecuteMapAction(10);
> 
>  
> 
> This works fine, the first time I do it. But if I do a new search, then
> the
> program hangs at this line:
> 
> featureService.UpdateFeatures(parcelMarkerFeatureSourceId,
> parcelMarkerCommands, false).
> 
>  In fact, after a long time, it returns null. Is this an existing bug? Or
> is
> there some way to get around it?
> 
> I am attaching my code as well. If someone has any idea, please reply!
> 
>  
> 
> Regards
> 
> Farah
> 
> 
>  
> ---------------------------------------------------------------------
> 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/Zoom-To-selection-tf2408316s16610.html#a10163084
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list