[mapguide-users] How to Highlight Line Features

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Feb 12 04:58:44 EST 2009


You cannot use selection if the table does not have unique primary keys.

Regards, Kenneth Skovhede, GEOGRAF A/S



padmini godavarthi skrev:
> Hi,
> In my table iam not having any primary key columns.
>
> Thanks and Regards,
> Padmini
>
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> I think your data has broken primary keys (eg. empty strings as primary 
>> key).
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> padmini godavarthi skrev:
>>     
>>>   Hi,
>>> iam using Mapguide opensource 2.0 (with .net 2.0 +IIS 5.1)
>>> Now iam struck up with high lighting line features on the map.
>>>
>>> my code is as follows:-
>>> -------------------------------
>>>
>>>
>>>     Dim fetresource1 As MgResourceIdentifier = New
>>> MgResourceIdentifier("Library://WaterNetwork/data/resource.FeatureSource")
>>>         Dim nameQuery1 As MgFeatureQueryOptions = New
>>> MgFeatureQueryOptions()
>>>         Dim val1 As String = "STARTVALVE"
>>>         nameQuery1.AddFeatureProperty(val1)
>>>               nameQuery1.SetFilter("STARTVALVE ='124'")
>>>         Dim layer1 As MgLayer = map.GetLayers().GetItem("waterpipe")
>>>         layer1.Selectable = True
>>>         Dim featureReader1 As MgFeatureReader =
>>> featureService.SelectFeatures(fetresource1, layer1.GetFeatureClassName(),
>>> nameQuery1)
>>>
>>>         Dim selection As MgSelection = New MgSelection(map)
>>>         selection.AddFeatures(layer1, featureReader1, 0)
>>>         Dim selectXML As String = selection.ToXml()
>>>         selection.Save(resourceService, "watermap")
>>>         Page.ClientScript.RegisterStartupScript(Page.GetType(), "test",
>>> "select('" & selectXML & "')", True)
>>>
>>>         map.Save(resourceService)
>>>
>>>         featureReader1.Close()
>>> -------------------------------------------------------------------------------------------------
>>>
>>> function select(val) {
>>>      
>>>          var selectionXML = val;
>>>           parent.parent.SetSelectionXML(selectionXML); 
>>>                  alert("Selected");
>>>       parent.parent.refresh;
>>>          
>>>         }
>>>
>>>
>>> but the line  feature is not highlighting ?  but this code works with
>>> polygon feature.
>>> i  found that in xml 
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><FeatureSet
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd"> <Layer
>>> id="1f6baf1e-0000-1000-8000-0016e692a356">  <Class
>>> id="KingOra:IMCN~GIS_WATERPIPE_DETAILS~SHAPE">   <ID></ID>   <ID></ID> 
>>> </Class> </Layer></FeatureSet>
>>>
>>> ID doesn't came.is there problem with ID?
>>>
>>> Can u plz tell me the solution?
>>>
>>> Thanks and Regards,
>>> Padmini
>>>
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090212/3594b8fd/attachment.html


More information about the mapguide-users mailing list