[mapguide-users] Selecting object returns wrong primary key

marius.360 marius at osssa.co.za
Wed Mar 11 01:43:36 EDT 2009


Yes, that is the case, only a few features show this behaviour. The data type
of the primary key column is number, and no, there is not any duplicate id's
in this field - otherwise I wouldn't be able to create the primary key.
There are no properties returned when it is the wrong ID, the returned ID
does not even exist in the table.



Chris Claydon wrote:
> 
> Just to clarify - your code works for some features, but does not work for
> some other features on the same layer?
> 
> What is the data type of your primary key?
> 
> Do you perhaps have features with duplicate IDs?
> 
> When you get the wrong ID, are you able to retrieve any properties for
> that feature at all?
> 
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of marius.360
> Sent: Tuesday, March 10, 2009 1:30 AM
> To: mapguide-users at lists.osgeo.org
> Subject: Re: [mapguide-users] Selecting object returns wrong primary key
> 
> 
> No, these situations do not occur. The objects in question is a line, and
> it
> is not near another object that returns the primary key on the mouseover.
> The big problem is that the number the showinfo returns does not even
> exist
> in the table. We use the fillowing code to get the selection string for
> the
> object:
> 
> selection = new MgSelection(map, selectionXml);
>     layers = selection.GetLayers();
>     
>     var queryOptions = new MgFeatureQueryOptions();
>  
>     for (var i=0; i < layers.GetCount(); i++) {        
>   var layer = layers.GetItem(i)
>   var layername = layer.GetName()
>   
>   var layerClassName = layer.GetFeatureClassName();
>   selectionString = selection.GenerateFilter(layer, layerClassName);
>  }
> 
> The number returned by the mouse-over is definatly correct for the object
> in
> question, and the one returned by the code above does not even exist in
> the
> table.
> 
> Please let me know if you need more info.
> 
> 
> 
> Crispin_at_1Spatial wrote:
>> 
>> Do you have any data that is overlaid - polygons on top of polygons? - or
>> it it tessalated or lines or points?
>> The default lookup-buffer for the MapGuide hover-over tooltip is pretty
>> big (4 pixels + some coord transformation that can result in a wide
>> search).
>> Are you sure the hover-over is the correct ID as this can pick up other
>> nearby IDs?
>> 
>> 
>> 
>> marius.360 wrote:
>>> 
>>> I select an object on the map, on the mouse over it gives me the correct
>>> primary key, but when I open a capture form where attribute information
>>> is displayed, another different ID is sent through, This however, does
>>> not happen for all objects, only a couple of them.
>>> 
>>> Can anyone give me suggestions as to why this happen?
>>> 
>>> Thanks
>>> 
>>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/Selecting-object-returns-wrong-primary-key-tp2448893p2453681.html
> 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
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Selecting-object-returns-wrong-primary-key-tp2448893p2459851.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list