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

OpenLayersExt.Popup.FramedB5Map

Una clase de OpenLayersExt para crear popups anclados de la OLE. Actua como clase padre para la clase OpenLayersExt.Popup.FramedB5MapMarker que crea un popup FramedB5Map anclado sobre un puntero OpenLayersExt.Marker.

Requisitos

Cómo usar

Create an OpenLayersExt.Map instance:

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

Ahora que existe el mapa, es fácil colocar un popup OLE sobre él de la siguiente forma:

// Añadir un popup FramedB5Map a un mapa OLE
var lonlat = new OpenLayersExt.LonLat(-220605.04584976,5360253.7118478),  // dónde colocar el popup
    popup  = new OpenLayersExt.Popup.FramedB5Map(lonlat);                 // la instancia más sencilla
map.addPopup(popup);                                                      // añadir popup al mapa

Se puede quitar un popup así:

map.removePopup(popup);
popup.destroy(); 

Constructor

OpenLayersExt.Popup.FramedB5Map

function( id, lonlat, contentHTML, anchor, closeBox, closeBoxCallback, onComplete ){}

  • Hereda de: OpenLayers.Popup.Anchored

    Parámetros:

    Nombre Tipo

    Valor Por Defecto

    Descripción

    id string "" Un ID único para el popup.
    lonlat object null Una instancia de OpenLayers.LonLat con las coordinadas.
    contentHTML string "" Cadena de HTML para meter dentro del área de contenido del popup
    anchor object OLE_DEFAULT Objeto que debería tener las propiedades size (OpenLayers.Size) y offset' (OpenLayers.Pixel).
    Normalmente un icono estándard de OpenLayers, OpenLayers.Icon.
    closeBox boolean true Quitar opcionalmente el botón para cerrar el popup
    closeBoxCallback function OLE_DEFAULT Indicar opcionalmente un método a invocar cuando el popop se cierre
    onComplete function null A ser invocado cuando el popup ha terminado de renderizarse.

Propiedades

CLASS_NAME

OpenLayersExt.Popup.FramedB5Map

Métodos

updateContentHTML

function( html, dont_pan ){}

  • Modificar el contenido HTML del popup.

    Parámetros:

    html string Una cadena HTML
    dont_pan boolean Pedir opcionalmente que no se centre el mapa sobre el popup cuando el contenido ha terminado de actualizarse.

makeFloat

function(){}

  • Hacer que el popup sea una caja flotante sin mostrar ningún triangulo que indique la posición.

Ejemplo

var map      = new OpenLayersExt.Map("mymap"),
    popup    = null,
    popup_id = "ole_popup",
    lonlat   = new OpenLayersExt.LonLat(-220605.04584976,5360253.7118478),
    html     = "Some <strong> HTML </strong> content for the popup.",
    anchor   = null, // use default anchor
    closeBox = true,
    onClose  = function(evt){
      if(!popup) return;
      map.removePopup(popup);
      popup.destroy();  
      popup = null;      
    },
    onComplete = function(evt){ alert("popup has rendered"); };
popup = new OpenLayersExt.Popup.FramedB5Map( 
  popup_id, lonlat, html, anchor, closeBox, onClose, onComplete
);
map.addPopup(popup);
map.setCenter(lonlat);