allow controls to live outside the map viewport - with changes to the overview map to handle this (#465)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -147,8 +147,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
|
||||
// Optionally add min/max buttons if the control will go in the
|
||||
// map viewport.
|
||||
if(!this.div.parentNode ||
|
||||
(this.div.parentNode.className == 'olMapViewport')) {
|
||||
if(!this.outsideViewport) {
|
||||
this.div.className = 'olControlOverviewMapContainer';
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||
// maximize button div
|
||||
|
||||
@@ -480,13 +480,13 @@ OpenLayers.Map.prototype = {
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
addControlToMap: function (control, px) {
|
||||
// If a control doesn't have a div at this point, it belongs in the
|
||||
// viewport.
|
||||
control.outsideViewport = (control.div != null);
|
||||
control.setMap(this);
|
||||
var div = control.draw(px);
|
||||
if (div) {
|
||||
// Only elements without parents should be appended to the viewport.
|
||||
// In IE, even elements without parents are given a parent node
|
||||
// of type 11 (DOCUMENT_FRAGMENT_NODE).
|
||||
if(!div.parentNode || (div.parentNode.nodeType == 11)) {
|
||||
if(!control.outsideViewport) {
|
||||
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
|
||||
this.controls.length;
|
||||
this.viewPortDiv.appendChild( div );
|
||||
|
||||
Reference in New Issue
Block a user