mobileViewer.Map

Constructor - mobileViewer.Map(options)

This class represents the main map display, and provides numerous methods to query and control the map.

Methods

Creates a new map object. Supported options are as follows:

mapDiv

The HTML div element that should contain the map display.

For example:
document.getElementById('mapContent')

fullWorldExtent

Whether or not to expand the viewable map extent to include the full world. This is useful if you want to support zooming to a user's current location if that location may fall outside of the base map extent. Set to
true
or
false

mapResourceId

The full path to the Infrastructure Map Server map definition to be displayed in the map.

For example:
Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition

onComplete

A callback method to be invoked when the map initialization is complete.

commercialBaseLayers

An array of objects defining the commercial base layers to include in the map. Each object should contain a main type, sub type, and a friendly name for the layer in the map.

For example, to include a Bing Maps street layer and a Google Maps satellite layer, the array could be built up as follows:
var commercialBaseLayers = [];
commercialBaseLayers.push(['VirtualEarth', 'VEMapStyle.Shaded',
               mobileViewer.getString('BING_SHADED')]);
commercialBaseLayers.push(['Google', 'G_SATELLITE_MAP',
              mobileViewer.getString('GOOGLE_SATELLITE_MAP')]);

Returns the HTML div element that contains the map

Returns the OpenLayers.Map object used by the map, allowing use of the OpenLayers API to interact directly with the map. For more information, see http://www.openlayers.org

Returns the OpenLayers.Layer.MapGuide object corresponding to the dynamic layers in the Infrastructure Map Server map definition. If the map contains no dynamic layers, this can be null.

Returns the OpenLayers.Layer.MapGuide object corresponding to the tiled base layers in the Infrastructure Map Server map definition. If the map contains no tiled base layers, this can be null.

Returns a JavaScript object corresponding to the Infrastructure Map Server map definition. This provides information about the map configuration, projection, layers etc.

Re-centers the map at the specified coordinates. Coordinates should be in the coordinate system used by the map - the Mapping Coordinate System (MCS).

Re-centers the map at the provided coordinates, specified in lon/lat decimal degrees.

Pans the map display by the specified number of pixels in the X and Y directions. If redraw is true, the map is immediately re-rendered. If it is false, the existing map image is shifted without being re-rendered, which allows for real-time panning until the desired location is determined. Once the pan has finished, a call should be made to this method with redraw set to true to ensure that the display is up-to-date.

Returns the current map scale

Zooms to the requested scale. If redraw is true, the map is re-rendered. If set to false, the existing map image is stretched to provide real-time zooming without the need to re-render. A final call to this method should always be made with redraw set to true to ensure the map display and setings are up-to-date. Note that for maps that use a set of specific fixed scales, the map will be rendered at the closest supported scale to the one requested.

Pans and zoom simultaneously. Zooming is carried out such that a feature located at the pixel coordinates (zoomCenterX, zoomCenterY) will remain at the same place on the screen if shiftX and shiftY are both zero. If shiftX and shiftY are non-zero, the feature will shift on the display by the specifie values.

Centers the map at the specified pixel coorinates, and zooms by the specified factor. The new scale will be the old scale multiplied by the factor value. Thus values greater than 1.0 will zoom out on the map and values less than 1.0 will zoom in.

Returns the map display to the initial map extent.

OpenLayers has the concept of zoom levels, and this method returns the closest zoom level to a specified scale.

Returns the map scale corresponding to the specified OpenLayers zoom level.

Selects one or more features at the specified pixel coordinates. The maxFeatures parameter controls the maximum number of features to select. The option layerNames parameter can be used to specify a comma-separated list of layers that the caller wishes to select features from.

Similar to selectAtPoint(), but selects features intersecting the specified rectangle defined in pixel coordinates.

Zooms to the map extent defined by the specified pixel coordinates.

Zooms to the map extent defined by the provided coordinates, specified in the mapping coordinate system.

Clears the current selection

Sets the current selection to the specified XML feature set. The format of the XML is that returned from the Infrastructure Map Server Web Tier API MgSelection.ToXml() method.

Sets the base layer of the map to the specified OpenLayers layer, which must already be a layer in the map.

This class represents the main map display, and provides numerous methods to query and control the map.