Set events pane width and height in pixels

This commit is contained in:
Tom Payne
2012-08-07 16:36:37 +02:00
parent 991c61110b
commit 43a940027f
2 changed files with 4 additions and 4 deletions

View File

@@ -63,7 +63,7 @@
</table>
<p><b>Notes:</b> the two maps share the same center, resolution, rotation and layers. Currently the DOM map does not support rotation.</p>
<p><b>Console tips:</b> If you want to play around with the API in the console, first make sure that you're using the <a href="simple-optimizations.html">simple optimizations version</a> of this demo, then open a console and experiment with the <code>domMap</code>, <code>webglMap</code> and <code>layer</code> variables in the console. The source code is in <a href="side-by-side.js">side-by-side.js</a>.</p>
<p><b>Known bugs:</b> Dragging is captured on the entire page, not just on the maps. When the map is rotated, panning on the WebGL map doesn't work as expected.</p>
<p><b>Known bugs:</b> When the map is rotated, panning on the WebGL map doesn't work as expected.</p>
<script src="@SRC@" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,4 +1,3 @@
// FIXME dragger - prevent page scrolling
// FIXME better map browser event types
// FIXME recheck layer/map projection compatability when projection changes
// FIXME layer renderers should skip when they can't reproject
@@ -117,8 +116,9 @@ ol.Map = function(target, opt_values, opt_viewportSizeMonitor) {
this.eventsPane_ = goog.dom.createElement(goog.dom.TagName.DIV);
this.eventsPane_.className = 'ol-pane-events';
this.eventsPane_.style.position = 'absolute';
this.eventsPane_.style.width = '100%';
this.eventsPane_.style.height = '100%';
// FIXME why can't we use width and height 100% here?
this.eventsPane_.style.width = target.clientWidth + 'px';
this.eventsPane_.style.height = target.clientHeight + 'px';
this.eventsPane_.style.zIndex = ol.MapPaneZIndex.EVENTS;
goog.dom.appendChild(target, this.eventsPane_);