XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

Seattle Movie Finder: An AJAX- and REST-Powered Virtual Earth Mashup
by Dare Obasanjo | Pages: 1, 2, 3, 4, 5

Methods and Events on the Virtual Earth Map Control

The Msn.VE.MapControl object has a number of methods which are documented in the Virtual Earth Standard Map Control SDK documentation. The following table lists the methods available on the Msn.VE.MapControl object and their behaviors.

Method Description

Msn.VE.MapControl._constructor(map, params);

Creates a Virtual Earth map in an HTML container. Latitude, longitude and zoom level can be specified as the default when the map loads

AddPushpin(id, latitude, longitude, width, height, className, innerHtml, zIndex);

Adds a pushpin to the map at a specified location. Text and user-defined CSS styles can be added to the pushpin

AttachEvent(event, function);

Attaches a map control event to a specified function

ClearPushpins();

Clears all the pushpins on the map

ContinuousPan(deltaX, deltaY, count);

Pans the map by the desired amount in a fluid motion

GetCenterLatitude();

Returns the current Latitude value of the map

GetCenterLongitude();

Returns the current Longitude value of the map

GetMapStyle();

Returns the current map style

GetMetersPerPixel(latitude, zoomLevel);

Returns the approximate number of meters on the globe represented by each pixel on the map, at the specified latitude and zoom level

GetObliqueScene();

Returns an ObliqueScene object for the Bird's Eye image at the center of the map

GetX(longitude);

Gets the x position for a longitude

GetY(latitude);

Gets the y position for a latitude

GetZoomLevel();

Gets the current zoom level

IncludePointInViewport(latitude, longitude);

Changes the map view (MapView object) to include the specified LatLong point and the current center point

Init();

Initializes a new instance of the Msn.VE.MapControl class

IsAnimationEnabled();

Indicates whether animated zooming and panning are enabled

IsObliqueAvailable();

Determines whether Bird's Eye imagery is available in the current map view

LatLongToPixel(LatLong, zoomLevel);

Converts a LatLong object (latitude/longitude pair) to the corresponding pixel (Pixel object) on the map

PanMap(deltaX, deltaY);

Moves the map by the desired amount

PanToLatLong(latitude, longitude);

Moves the position of the map to a specified latitude and longitude

PixelToLatLong(Pixel, zoomLevel);

Converts a Pixel object (point on the map) to a LatLong object (latitude/longitude pair)

RemovePushpin(id);

Removes a pushpin from the map using the specified identifier

Resize(width, height);

Changes the size of the map

SetAnimationEnabled();

Enables or disables animated zooming and panning

SetBestMapView();

Determines the best map view (MapView object) that completely includes all of the LatLong objects in the specified array, and updates the current map view with the new map view

SetCenter(latitude, longitude);

Centers the map to a desired latitude and longitude

SetCenterAndZoom(latitude, longitude, zoomLevel);

Centers the map to a specific latitude and longitude and sets the zoom level

SetMapStyle(mapStyle);

Changes the style of the map, to road, aerial, oblique, or hybrid

SetObliqueOrientation(orientation);

Changes the orientation of the existing Bird's Eye image (ObliqueScene object) to the specified orientation

SetObliqueScene(id);

Displays the Bird's Eye image specified by the ObliqueScene ID

SetView(mapView);

Changes the map to the specified MapView object

SetViewport(lat1, lon1, lat2, lon2);

Determines the best map view (MapView object) that completely includes the area within the specified LatLongRectangle, and updates the current map view with the new map view

SetZoom(zoomLevel);

Zooms the map to the specified level

StopContinuousPan();

Interrupts a continuous pan

ZoomIn();

Zooms the map in to the next level

ZoomOut();

Zooms the map out to the previous level

There are also a number of events which are supported by the map control.  

Event Description

onChangeView

Event fired whenever the map view changes

onClick

Event fired when the user clicks on the map

onContextMenu

Event fired when the user right-clicks on the map

onEndContinuousPan

Event fired when the map finishes the continuous pan

onEndZoom

Event fired when the zoom finishes

onError

Event fired when there is a map control error

onMapStyleChange

Event fired when the map style changes

onMouseUp

Event fired when the user releases the click

onObliqueChange

Event fired when the Bird's Eye image scene ID is changed. This event only fires if the map is currently displaying a Bird's Eye image and that image is changed

onObliqueEnter

Event fired when switching to Bird's Eye imagery from another map style

onObliqueLeave

Event fired when switching from Bird's Eye imagery to another map style

onResize

Event fired when the map is resized

onStartContinuousPan

Event fired when the map starts continuous pan

onStartZoom

Event fired when the zoom starts

Pages: 1, 2, 3, 4, 5

Next Pagearrow