[mapguide-users] Edit Layer
padmini godavarthi
godavarthi.padmini at gmail.com
Mon Dec 8 12:05:39 EST 2008
Hi,
Thanks
In ur code
Dim sessionID As String = Request.Params("SESSIONID")
Dim mapdefinition As String = Request.Params("MAPDEFINITION")
Dim layername As String = Request.Params("LAYERNAME")
Dim newFilter As String = Request.Params("NEWFILTER")
1) from where it will come.i mean Request.Params("SESSIONID") ,
Request.Params("MAPDEFINITION") ,Request.Params("LAYERNAME") ,
Request.Params("NEWFILTER") all these things
Regards,
Padmini
Kenneth Skovhede, GEOGRAF A/S wrote:
>
> You need to call the aspx page with the session id, either as a
> querystring or as a post.
>
> 'Read setup from querystring or form
> Dim sessionID As String = Request.Params("SESSIONID")
> Dim mapdefinition As String = Request.Params("MAPDEFINITION")
> Dim layername As String = Request.Params("LAYERNAME")
> Dim newFilter As String = Request.Params("NEWFILTER")
>
> 'Replace "myserver" with the server name, or use "localhost"
> Dim host As New Uri("http://myserver/mapguide/mapagent/mapagent.fcgi")
> Dim conn as ServerConnectionI = New HttpServerConnection(host, sessionID,
> "en", true)
>
> 'Use the same naming system as the viewer, when reading the runtime map ID
> Dim mapName as String = new ResourceIdentifier(mapdefinition).Name
> Dim rtMapId as String = new ResourceIdentifier(mapName,
> ResourceTypes.RuntimeMap, conn.SessionID)
>
> 'Load the runtime map
> Dim rtMap as RuntimeClasses.RuntimeMap = conn.GetRuntimeMap(rtMapId)
> Dim rtLayer as RuntimeClasses.RuntimeMapLayer = rtMap.Layers(layername)
>
> 'Get the current layer and assing the filter
> Dim layerDefinition as LayerDefinition =
> conn.GetLayerDefinition(rtLayer.ResourceId)
> Dim vectorLayerDefinition as VectorLayerDefinitionType =
> layerDefinition.Item
> vectorLayerDefinition.Filter = newFilter
>
> 'Save a copy of the layer, temporary, and random name
> rtLayer.ResourceID = new ResourceIdentifier(Guid.NewGuid().ToString(),
> ResourceTypes.LayerDefinition, conn.SessionID)
> conn.SaveResourceAs(layerDefinition, rtLayer)
>
> 'Save the runtime map, pointing to the updated layerdefinition
> conn.SaveRuntimeMap(rtMapId, rtMap)
>
> 'Tell the client to refresh
> RegisterStartupScript("key", "<script>GetMapFrame().Refresh();</script>")
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> padmini godavarthi skrev:
>> Hi
>> iam using Mapguide opensource 2.0(with .net 2.0 +IIS 5.1)
>>
>> Hi, We want modify dynamically a layer; for exemple, modify the filter of
>> a
>> layer when the map is loaded;Is it possible ? What is the method : using
>> an
>> API ?
>>
>>
>> can u give me the sample code in .net so that it will be very helpful to
>> me
>>
>> Regards,
>> Padmini.
>>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
--
View this message in context: http://www.nabble.com/Edit-Layer-tp20898181p20899278.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list