NOTA: selecciona la orientación oportuna del papel en las opciones de impresión de tu navegador. Puedes imprimir la página o volver al visor.

OpenLayersExt.Map

Una clase OpenLayersExt para crear instancias de mapas OLE.

Requisitos

  • Se ha invocado el método OpenLayersExtLoader.load.

  • El evento onLoad para la página HTML ha disparado.

Cómo utilizar

Una vez cargada la OLE y el resto de la página HTML, se puede instanciar mapas OLE de la siguiente forma:

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

Constructor

OpenLayersExt.Map

function(id, options){}

  • Hereda de : OpenLayers.Map

    Parámetros:

    Nombre Tipo

    Valor Por Defecto

    Descripción

    id string "" ID del div contenador del mapa OLE.
    options object null Un objeto con argumentos opcionales


    EL parámetro options

    {
      openLayersExt: {
        center: {          // opciones para el centrado del rectángulo visible del mapa al cargarse
          lonlat:          some_lonlat // Un objeto OpenLayers Lonlat
          code:            "string"    // Una cadena que identifica un área de Gipuzkoa
          zoom:            15,         // Nivel de cercanía 1-20
          mbr:             bounds,     // Un objeto OpenLayers Bounds 
          foregroundLayer: "map2008",  // "picto200X", "map", "ort", etc.
          backgroundLayer: "google"    // "yahoo", "microsoft"
        },
        initCallbacks: function(map){} // function ó [ functions...]
      }
    }
    

Métodos

getB5MAPBaseLayer

function(){}

getPictometryHandler

function(){}

getWhatIsThisControl

function(){}

switchForegroundLayer

function( layerId ){}

  • Parámetros:

    Nombre Tipo

    Valor Por Defecto

    Descripción

    layerId string "" ID para la capa (map layer) a usar como capa frontal (foregroundLayer)

switchBackgroundLayer

function( layerId ){}

  • Parámetros:

    Nombre Tipo

    Valor Por Defecto

    Descripción

    layerId string "" ID para la capa (map layer) a usar como capa de fondo (backgroundLayer)

getMapDimensions

function(id, options){}

  • Devuelve:

    Tipo

    Descripción

    object Un objeto OpenLayers.Size que define en píxeles el ancho y alto de la zona visible.

resize

function(width, height){}

getActiveBackgroundLayerInfo

function(){}

  • Devuelve:

    Tipo

    Valor Por Defecto

    Descripción

    object "" Un objeto con diferentes propiedades que describen la capa de fondo actual.

showMenuBar

function(){}

hideMenuBar

function(){}

showPanZoomBar

function(){}

hidePanZoomBar

function(){}

Ejemplo Completo

<!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>