NOTE: choose the suitable paper orientation in your browser's printing options. You can print this page or return to the viewer.

OpenLayersExt.Map

An OpenLayersExt class used to create an OLE Map instance.

Requirements

  • The OpenLayersExtLoader.load method has been invoked.

  • The onLoad event for the given html page has been triggered.

How to use

Once the necessary OLE libraries and the HTML page have finished loading, you may instanciate OLE maps like this:

var ole_map = new OpenLayersExt.Map("mymap");

Constructor

OpenLayersExt.Map

function(id, options){}

  • Inherits from: OpenLayers.Map

    Parameters:

    Name Type

    Default Value

    Description

    id string "" ID of the div used to contain the OLE map.
    options object null An optional hash of options


    The options parameter

    {
      openLayersExt: {
        center: {          // contains different options for centering the mbr to show on load
          lonlat:          some_lonlat // An OpenLayers Lonlat Object
          code:            "string"    // A string that identifies an area in Gipúzkoa
          zoom:            15,         // Zoom level 1-20
          mbr:             bounds,     // OL Bounds object
          foregroundLayer: "map2008",  // "picto200X", "map", "ort", etc.
          backgroundLayer: "google"    // "yahoo", "microsoft"
        },
        initCallbacks: function(map){} // function or [ functions...]
      }
    }
    

Functions

getB5MAPBaseLayer

function(){}

getPictometryHandler

function(){}

getWhatIsThisControl

function(){}

switchForegroundLayer

function( layerId ){}

  • Parameters:

    Name Type

    Default Value

    Description

    layerId string "" String id for a map layer to be used as the foregroundLayer

switchBackgroundLayer

function( layerId ){}

  • Name Type

    Default Value

    Description

    layerId string "" String id for a map layer to be used as the backgroundLayer

getMapDimensions

function(id, options){}

  • Returns:

    Type

    Default Value

    Description

    object "" An OpenLayers.Size instance descriping the width and height of the viewport in pixels.

resize

function(width, height){}

getActiveBackgroundLayerInfo

function(){}

  • Returns:

    Type

    Default Value

    Description

    object "" A hash with diferent properties describing the current background layer.

showMenuBar

function(){}

hideMenuBar

function(){}

showPanZoomBar

function(){}

hidePanZoomBar

function(){}

Full Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OLE - Basic Example</title>        
<script src="/<ole-base-path>/openlayers-ext/openlayers-ext-loader.js" type="text/javascript"></script>
<script type="text/javascript">
  //<![CDATA[
  OpenLayersExtLoader.load( {
    "debug": true,
    "map-libs": {
    "google": { "version": "2", "key": "<google_api_key>" },
     "yahoo": { "version": "3.0", "key": "<yahoo_api_key>" }
    }
  } );
  //]]>
</script>
<script type="text/javascript">
  //<![CDATA[
  Event.observe( window, "load", function() {
    window.b5map = new OpenLayersExt.Map( "mymap");
  });
  //]]>
</script>
</head>
<body>
<div id="mymap"></div>
</body>
</html>