Working with events in virtual earth is an easy task
In browser when you open events.html and when you switch views, you must see the data about the recent view. The other common map events are related with changes in view. View events are classified into three groups, which are given below:
Start events: This kind of event is used for cancelling the movement. And you are able to capture the event in the beginning of zoom or a pan.
End events: you are able to capture the end of zoom or a pan.
Change the view: change event is fired when there is change in style, zoom level, center point, and center point of the map through programmatic action and through user action.
When you will reload events.html, you can observe one thing that you can’t see style change but you can see only view change and the main reason behind this, the style change event takes place before the view change event takes place. Note down one thing that virtual earth control has control over the event firing order. Now we will move towards mouse events. Mouse events and map events are not same but they are different. Mouse events include user action. Whatever the user will do with mouse in related to a virtual earth map is captured. And these mouse events can be captured when the user does certain tasks such as clicking left, right, and middle mouse button on a virtual earth map. double clicking a mouse button, moving a mouse on map, pushing the mouse button at down side or releasing a mouse button, rotating the scroll wheel and moving the mouse on virtual earth shape object.
One object is returned through all these events, which indicate either the shift or Ctrl and Alt key are pressed, or not in combination with the event. And in addition to this every callback object provides you wide information of when the event is occurred and what the map view looks like. There are some useful mouse events, which are onmouseout and onmouseover. With the help of these useful mouse events, you are able to get the information about when the user will mouse his mouse on map or when the user will move his mouse over a specific virtual earth shape in the map. Apart from this information, these events also provide the shape id. Therefore, with the help of this shape id you can collect the information of target shape.
While working with mouse events you have to face one challenge that a convinced style of map navigation is already used by your users. For instance, most of the users drop of drag the map towards pan or they can double click on zoom or re-enter and therefore you should take care of your user requirements before they will cancel the built in process for mouse event. Now we will move on keyboard events, which are very same to mouse events. You will find three keyboard events, which trap key up, key down and key press.
Technorati Tags: virtual earth, Microsoft virtual earth, features of virtual earth, using virtual earth,
Tags: Microsoft Virtual Earth
























