Select to view content in your preferred language

GraphicsLayer MouseLeftButtonDown doesn't work

1053
6
10-27-2010 09:08 AM
JOhntwi
Emerging Contributor
Hi everybody,
An other question?

I have a Map in my Home.Xaml.
I have a ribbon in my MainPage.Xaml.
Every time, i click on my map, the event on mygraphicLayer doesn't work:

<esri:Map x:Name="MyMap" >
            <esri:Map.Layers>
                <esri:ArcGISTiledMapServiceLayer ID="MyLayer" 
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                <esri:GraphicsLayer ID="MyGraphicsLayer" MouseLeftButtonDown="GraphicsLayer_MouseLeftButtonDown">
                </esri:GraphicsLayer>
            </esri:Map.Layers>
        </esri:Map>
<esri:Map x:Name="MyMap" >
            <esri:Map.Layers>
                <esri:ArcGISTiledMapServiceLayer ID="MyLayer"
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                <esri:GraphicsLayer ID="MyGraphicsLayer" MouseLeftButtonDown="GraphicsLayer_MouseLeftButtonDown">
                </esri:GraphicsLayer>
            </esri:Map.Layers>
        </esri:Map>


I don't know why ?
The event for the MyMap works but it doesn't work for my graphicLayer.
Thanks
0 Kudos
6 Replies
JenniferNery
Esri Regular Contributor
Is your map surrounded by a ScrollViewer? If yes, this thread is related: http://forums.arcgis.com/threads/8575-Pan-Doesn-t-Work!!!

The ScrollViewer intercepts Map's MouseEvents.
0 Kudos
JOhntwi
Emerging Contributor
No, my map isn't in ScrollViewer.
It's very strange.
I can click to the MyGraphics for take the information of the object but with the layer layNeigh, i don't.

 <esri:Map x:Name="MyMap" Loaded="MyMap_Loaded">
            <esri:Map.Layers>
                <esri:ArcGISTiledMapServiceLayer ID="MyLayer" 
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
                <esri:GraphicsLayer ID="layNeigh" x:Name="layNeigh" MouseLeftButtonUp="LayNeighMouseLeftButtonUp" />
                <esri:GraphicsLayer ID="MyGraphics"  MouseLeftButtonDown="LayHistoricMouseLeftButtonUp" >
                    <esri:Graphic Symbol="{StaticResource SelectMarkerSymbol}" >
                        <esri:MapPoint X="-140.9" Y="63.391" />
                    </esri:Graphic>
                </esri:GraphicsLayer>
            </esri:Map.Layers>
        </esri:Map>

An idea?
0 Kudos
JenniferNery
Esri Regular Contributor
Both MouseLeftButtonDown and MouseLeftButtonUp do not work for that layer?

Is there maybe another MouseLeftButtonDown or MouseLeftButtonUp event that is marked Handled  somewhere in your code?  Could it be because there's no graphic where you clicked?
0 Kudos
JOhntwi
Emerging Contributor
oth MouseLeftButtonDown and MouseLeftButtonUp do not work for that layer?
Yes. Two events don't work with that layer.

Is there maybe another MouseLeftButtonDown or MouseLeftButtonUp event that is marked Handled somewhere in your code? Could it be because there's no graphic where you clicked?
There is no another event in the page.


Can i send you my project , if needed !
0 Kudos
JenniferNery
Esri Regular Contributor
This GraphicsLayer contain graphics?  When you click on a graphic, the MouseLeftButtonDown does not get raised? I could not replicate it. Please share some code.
0 Kudos
JOhntwi
Emerging Contributor
Thank you for your help.
The problem was the transparency of a polygon !!
Resolved
0 Kudos