OpenLayers 2.12+和JQueryUI可拖动面板

时间:2014-03-12 12:33:31

标签: jquery-ui openlayers jquery-ui-draggable

Openlayers 2.12+和包含OL工具的JQueryUI可拖动面板存在问题。面板锁定拖动。

CSS:

herramientas {
    position: absolute;     top: 15px;  left: 45px;     width: 250px;   height: 35px;   z-index:99999;  cursor: move;
    background: #000000; }
#herramientas div { 
    float: left;
    margin: 5px; }

HTML:

<body>    
   <div id="mapcontainer" style="width: 650px; height: 500px; position: relative">
    <div id="map" style="width:100%; height:100%"></div>

    <div id="herramientas"></div>
   </div>
  </body>

JavaScript:

var map, layer;
$(document).ready(function () {

        $("#herramientas").draggable({containment: "#mapcontainer"});


        map = new OpenLayers.Map( 'map' );
        layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                                         "http://vmap0.tiles.osgeo.org/wms/vmap0",
                                         {layers: 'basic'} );
        map.addLayer(layer);
        map.zoomToMaxExtent();

        nav = new OpenLayers.Control.NavigationHistory();
        map.addControl(nav);
        panel = new OpenLayers.Control.Panel(
            {div: document.getElementById("herramientas")}
        );
        panel.addControls([nav.next, nav.previous]);
        map.addControl(panel);

    });

代码演示可以在http://jsfiddle.net/leal33/49bP9/

中看到

与OpenLayers 2.11完美配合的相同示例 - &gt; http://jsfiddle.net/leal33/49bP9/1

这是OpenLayers的一个错误?任何解决方案?

由于

0 个答案:

没有答案