VEMap Event Object Properties

You are not viewing the latest version of the AJAX control. Bing Maps AJAX V7 is the recommended JavaScript control for Bing Maps. If you need this documentation, it is available in as a CHM or PDF download.

The MapEvent object properties that are available from the callback method are listed below.

Event Object Properties

Property Description

error

A String object containing the error message, if any.

zoomLevel

The current map zoom level.

mapStyle

The current map style as a String. Valid String results are a,r,h, and o.

birdseyeSceneID

If the map style is set to bird's eye (oblique), the unique identifier of the current bird's eye scene.

birdseyeSceneOrientation

If the map style is set to bird's eye (oblique), the orientation of the current bird's eye scene.

leftMouseButton

A boolean representing whether the left mouse button has been clicked.

rightMouseButton

A boolean representing whether the right mouse button has been clicked.

middleMouseButton

A boolean representing whether the middle mouse button (or mouse wheel) has been clicked.

mouseWheelChange

The number of units that the mouse wheel has changed.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode, and the value returned in Firefox 1.5 and 2.0 is incorrect.

clientX

The x coordinate of the mouse cursor relative to the browser window.

clientY

The y coordinate of the mouse cursor relative to the browser window.

screenX

The x coordinate of the mouse cursor relative to the screen.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

screenY

The y coordinate of the mouse cursor relative to the screen.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

mapX

The x coordinate of the map relative to the screen.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

mapY

The y coordinate of the map relative to the screen.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

latLong

The latlong coordinates of the clicked location. This only works in 3D mode. For 2D, you can convert mapX and mapY to a latlong using the VEMap.PixelToLatLong Method method.

keyCode

The key code of the key that has been pressed.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

altKey

A boolean representing whether the ALT key was held when the key was pressed.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

ctrlKey

A boolean representing whether the CTRL key was held when the key was pressed.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

shiftKey

A boolean representing whether the shift key was held when the key was pressed.

Bb429584.note(en-us,MSDN.10).gifNote:
This is not supported in 3D mode.

eventName

A string representing the type of event that occurred.

elementID

The ID of the object associated with the event, usually a VEShape Class object or the base map.

Remarks

The ID string for shapes, as provided by an Event object, (see VEMap Events) may have some extensions on it beyond the root ID string. Use the VEShape.GetID Method to return the correct shape reference, as shown in the following example.

function ShapeHandler(e)
{
  if (e.elementID)
  {
        // e.elementID is the root ID, plus extensions.
        alert("ID of shape on mouseover is " + e.elementID);
        // Use VEMap.GetShapeByID, then VEShape.GetID
        // to return the root ID.
        var id = map.GetShapeByID(e.elementID).GetID();
        alert("ID of shape on mouseover is " + id);
        return true;
    }
}

See Also

Show: