OpenLayers JavaScript Mapping Library OpenLayers Popup |
OpenLayers. PopupSummary
map{OpenLayers.Map} this gets set in Map.js when the popup is added to the map OpenLayers. PopupCreate a popup. Parameters
draw
Parameters
Return{DOMElement} Reference to a div that contains the drawn popup registerEvents
Registers events on the popup. Do this in a separate function so that subclasses can choose to override it if they wish to deal differently with mouse events Note in the following handler functions that some special care is needed to deal correctly with mousing and popups. Because the user might select the zoom-rectangle option and then drag it over a popup, we need a safe way to allow the mousemove and mouseup events to pass through the popup when they are initiated from outside. Otherwise, we want to essentially kill the event propagation for all other events, though we have to do so carefully, without disabling basic html functionality, like clicking on hyperlinks or drag-selecting text. |
nullify references to prevent circular references and memory leaks
destroy: function()
draw: function( px )
if the popup has a lonlat and its map members set, then have it move itself to its proper position
updatePosition: function()
moveTo: function( px )
{Boolean} Boolean indicating whether or not the popup is visible
visible: function()
toggle: function()
show: function()
hide: function()
setSize:function( size )
setBackgroundColor:function( color )
setOpacity:function( opacity )
setBorder:function( border )
setContentHTML:function( contentHTML )
Registers events on the popup.
registerEvents:function()
When mouse goes down within the popup, make a note of it locally, and then do not propagate the mousedown (but do so safely so that user can select text inside)
onmousedown: function ( evt )
If the drag was started within the popup, then do not propagate the mousemove (but do so safely so that user can select text inside)
onmousemove: function ( evt )
When mouse comes up within the popup, after going down in it, reset the flag, and then (once again) do not propagate the event, but do so safely so that user can select text inside
onmouseup: function ( evt )
Ignore clicks, but allowing default browser handling
onclick: function ( evt )
When mouse goes out of the popup set the flag to false so that if they let go and then drag back in, we won’t be confused.
onmouseout: function ( evt )
Ignore double-clicks, but allowing default browser handling
ondblclick: function ( evt )