patch to make sure main openlayers map div has neither padding nor margin. done via css thanks to tim's fabulous new class manip patch. r=cr5 (Closes #1179)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7584 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -406,7 +406,6 @@ OpenLayers.Events = OpenLayers.Class({
|
||||
initialize: function (object, element, eventTypes, fallThrough) {
|
||||
this.object = object;
|
||||
this.element = element;
|
||||
this.eventTypes = eventTypes;
|
||||
this.fallThrough = fallThrough;
|
||||
this.listeners = {};
|
||||
|
||||
@@ -416,11 +415,13 @@ OpenLayers.Events = OpenLayers.Class({
|
||||
this.handleBrowserEvent, this
|
||||
);
|
||||
|
||||
this.eventTypes = [];
|
||||
|
||||
// if eventTypes is specified, create a listeners list for each
|
||||
// custom application event.
|
||||
if (this.eventTypes != null) {
|
||||
for (var i = 0; i < this.eventTypes.length; i++) {
|
||||
this.addEventType(this.eventTypes[i]);
|
||||
if (eventTypes != null) {
|
||||
for (var i = 0; i < eventTypes.length; i++) {
|
||||
this.addEventType(eventTypes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,10 +455,13 @@ OpenLayers.Events = OpenLayers.Class({
|
||||
*
|
||||
* Parameters:
|
||||
* eventName - {String}
|
||||
* dontAddMe - {Boolean}
|
||||
*/
|
||||
addEventType: function(eventName) {
|
||||
if (!this.listeners[eventName]) {
|
||||
this.listeners[eventName] = [];
|
||||
|
||||
this.eventTypes.push(eventName);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -404,6 +404,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this.id = OpenLayers.Util.createUniqueID("OpenLayers.Map_");
|
||||
|
||||
this.div = OpenLayers.Util.getElement(div);
|
||||
OpenLayers.Element.addClass(this.div, 'olMap');
|
||||
|
||||
// the viewPortDiv is the outermost div we modify
|
||||
var id = this.div.id + "_OpenLayers_ViewPort";
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
var map;
|
||||
|
||||
function test_Map_constructor (t) {
|
||||
t.plan( 10 );
|
||||
t.plan( 11 );
|
||||
|
||||
map = new OpenLayers.Map('map');
|
||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
||||
@@ -15,6 +15,8 @@
|
||||
{map: "/mapdata/vmap_wms.map", layers: "basic"});
|
||||
map.addLayer(baseLayer);
|
||||
|
||||
t.ok( OpenLayers.Element.hasClass(map.div, "olMap"), "Map div has olMap class");
|
||||
|
||||
t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map returns object" );
|
||||
if (!isMozilla) {
|
||||
t.ok( true, "skipping element test outside of Mozilla");
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
div.olMap {
|
||||
padding: 0px!important;
|
||||
margin: 0px!important;
|
||||
}
|
||||
|
||||
div.olMapViewport {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user