A popup is a small div that can opened and closed on the map. Typically opened in response to clicking on a marker. See OpenLayers.Marker. Popup’s don’t require their own layer and are added the the map using the OpenLayers.Map.addPopup method.
popup = new OpenLayers.Popup("chicken", new OpenLayers.LonLat(5,40), new OpenLayers.Size(200,200), "example popup", true); map.addPopup(popup);
OpenLayers. | A popup is a small div that can opened and closed on the map. |
Properties | |
autoSize | {Boolean} Resize the popup to auto-fit the contents. |
minSize | {OpenLayers.Size} Minimum size allowed for the popup’s contents. |
maxSize | {OpenLayers.Size} Maximum size allowed for the popup’s contents. |
panMapIfOutOfView | {Boolean} When drawn, pan map such that the entire popup is visible in the current viewport (if necessary). |
keepInMap | {Boolean} If panMapIfOutOfView is false, and this property is true, contrain the popup such that it always fits in the available map space. |
closeOnMove | {Boolean} When map pans, close the popup. |
Constructor | |
OpenLayers. | Create a popup. |
Functions | |
updateSize | Auto size the popup so that it precisely fits its contents (as determined by this.contentDiv.innerHTML). |
getSafeContentSize |
{OpenLayers.Size} Minimum size allowed for the popup’s contents.
{OpenLayers.Size} Maximum size allowed for the popup’s contents.
{Boolean} If panMapIfOutOfView is false, and this property is true, contrain the popup such that it always fits in the available map space. By default, this is not set on the base class. If you are creating popups that are near map edges and not allowing pannning, and especially if you have a popup which has a fixedRelativePosition, setting this to false may be a smart thing to do. Subclasses may want to override this setting.
Default is false.
Create a popup.
id | {String} a unqiue identifier for this popup. If null is passed an identifier will be automatically generated. |
lonlat | {OpenLayers.LonLat} The position on the map the popup will be shown. |
contentSize | {OpenLayers.Size} The size of the content. |
contentHTML | {String} An HTML string to display inside the popup. |
closeBox | {Boolean} Whether to display a close box inside the popup. |
closeBoxCallback | {Function} Function to be called on closeBox click. |
getSafeContentSize: function( size )
size | {OpenLayers.Size} Desired size to make the popup. |
{OpenLayers.Size} A size to make the popup which is neither smaller than the specified minimum size, nor bigger than the maximum size (which is calculated relative to the size of the viewport).
Auto size the popup so that it precisely fits its contents (as determined by this.contentDiv.innerHTML).
updateSize: function()
getSafeContentSize: function( size )
addPopup: function( popup, exclusive )