This is a migrated thread and some comments may be shown as answers.

InformationLayer.GetItemsInLocation wrong Location

1 Answer 62 Views
Map
This is a migrated thread and some comments may be shown as answers.
Volkmar
Top achievements
Rank 1
Volkmar asked on 29 Oct 2010, 02:41 PM
I have a click event on the map. I do check all InformationLayers and if there is a KML Layer (MapPolygon Items) I select the item.
However the location from eventArgs. The location does not seam to be the right one. I click on a Polygon but a Polygon somewhere on the roght top corner of the image gets selected and so on.
Why is there a shift of the location? Any hints? Thanks for any replies..





void
ApMap_MapMouseClick(object sender, MapMouseRoutedEventArgs eventArgs)
       {
           switch (_activeTool.ToolType)
           {
               case ToolType.Pan:
                   break;
               case ToolType.Zoomin:
                   break;
               case ToolType.Zoomout:
                   break;
               case ToolType.Info:
                   break;
               case ToolType.Select:
                   foreach (var serviceLayer in ServiceLayers)
                   {
                       if (serviceLayer.Visible && serviceLayer.TypeId==1)
                       {
                           var iLyr = ApMap.Items.OfType<InformationLayer>().Where(rv => rv.Name == serviceLayer.Name).First();
                           var items = iLyr.GetItemsInLocation(eventArgs.Location);
                           if (items.Count()>0)
                           {
                               ((MapPolygon) items.First()).Fill = new SolidColorBrush(Color.FromArgb(127, 255, 25, 0));
                               ((MapPolygon) items.First()).Stroke = new SolidColorBrush(Colors.Red);
                           }
                       }
                   }
                   break;
               default:
                   throw new ArgumentOutOfRangeException();
           }
       }

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 02 Nov 2010, 06:24 PM
Hello Volkmar,

It looks like you are using Beta version of the 2010.Q3 release. If it is so, we aware about this problem and it will be fixed in the official 2010.Q3 release.

All the best,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Volkmar
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or