diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index e568871a96..ea7764c8dd 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -56,7 +56,7 @@ OpenLayers.Map.prototype = { initialize: function (div, options) { Object.extend(this, options); - this.div = div; + this.div = $(div); this.viewPortDiv = OpenLayers.Util.createDiv( div.id + "_OpenLayers_ViewPort" ); diff --git a/tests/test_Map.html b/tests/test_Map.html index 242c1ce17c..3e2d0dc4da 100644 --- a/tests/test_Map.html +++ b/tests/test_Map.html @@ -6,7 +6,7 @@ function test_01_Map_constructor (t) { t.plan( 12 ); - map = new OpenLayers.Map($('map')); + map = new OpenLayers.Map('map'); // no longer need to call $(), constructor does it t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map returns object" ); t.ok( map.div instanceof HTMLDivElement, "map.div is an HTMLDivElement" ); t.ok( map.controlDiv instanceof HTMLDivElement, "map.controlDiv is an HTMLDivElement" );