Select to view content in your preferred language

Map Cursors

3589
8
07-13-2010 07:37 PM
HaroldBostic
Frequent Contributor
Has anyone changed the map cursor for the map to a custom cursor?  If so, how?

Thanks
0 Kudos
8 Replies
dotMorten_esri
Esri Notable Contributor
There is no "custom" cursors in Silverlight, other than the few predefined ones. Instead set the Map.Cursor=Cursors.None, and use the MouseMove event to move a usercontrol that represents the cursor around, so it looks like its a cursor that follows the map. Make sure you also set IsHitTestVisible on the cursor, so it doesn't block mouse interaction with the map.
0 Kudos
LawrenceSullivan
Emerging Contributor
I don't get how to move the usercontrol on the map.
The map is not a convas, so I can not set LeftProperty and TopProperty. Am I missing something obvious?

Thanks,
Grond
0 Kudos
LakshmananVenkatesan
Frequent Contributor
I don't get how to move the usercontrol on the map.
The map is not a convas, so I can not set LeftProperty and TopProperty. Am I missing something obvious?

Thanks,
Grond


Any clues or help?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
There is a nice sample of custom cursor here : http://www.arcgis.com/home/item.html?id=b77d416635a74e66ab222fe519af2eb7
0 Kudos
LakshmananVenkatesan
Frequent Contributor
Sample is good. How do I attach events to cursors. I have zoom in button, when user draws rectangle on Map and map will zoom accordingly. These cursors are images does not have any events.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The sample has zoomin and zoomout buttons, so you can look on how it's developed.

You don't need any events on cursor, you can use the map events as with standard cursors.
0 Kudos
LakshmananVenkatesan
Frequent Contributor
Hi

Zoom in/out buttons were fixed extent zoomin/out. I want to zoom in based on user drawn rectangle over the map, for this how do I go about?. I need to draw a rectangle with zoom in cursor?. Hope my question is clear.

SR
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Looks like we are not talking about the same sample.

I attached a screenshot of the zoomin command in action
0 Kudos