OpenLayers OpenLayers

Changeset 7584

Show
Ignore:
Timestamp:
07/29/08 10:52:48 (4 months ago)
Author:
euzuro
Message:

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)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Events.js

    r6832 r7584  
    407407        this.object     = object; 
    408408        this.element    = element; 
    409         this.eventTypes = eventTypes; 
    410409        this.fallThrough = fallThrough; 
    411410        this.listeners  = {}; 
     
    417416        ); 
    418417 
     418        this.eventTypes = []; 
     419 
    419420        // if eventTypes is specified, create a listeners list for each  
    420421        // custom application event. 
    421         if (this.eventTypes != null) { 
    422             for (var i = 0; i < this.eventTypes.length; i++) { 
    423                 this.addEventType(this.eventTypes[i]); 
     422        if (eventTypes != null) { 
     423            for (var i = 0; i < eventTypes.length; i++) { 
     424                this.addEventType(eventTypes[i]); 
    424425            } 
    425426        } 
     
    455456     * Parameters: 
    456457     * eventName - {String} 
     458     * dontAddMe - {Boolean} 
    457459     */ 
    458460    addEventType: function(eventName) { 
    459461        if (!this.listeners[eventName]) { 
    460462            this.listeners[eventName] = []; 
     463             
     464            this.eventTypes.push(eventName); 
    461465        } 
    462466    }, 
  • trunk/openlayers/lib/OpenLayers/Map.js

    r7374 r7584  
    405405 
    406406        this.div = OpenLayers.Util.getElement(div); 
     407        OpenLayers.Element.addClass(this.div, 'olMap'); 
    407408 
    408409        // the viewPortDiv is the outermost div we modify 
  • trunk/openlayers/tests/Map.html

    r7374 r7584  
    88 
    99    function test_Map_constructor (t) { 
    10         t.plan( 10 ); 
     10        t.plan( 11 ); 
    1111         
    1212        map = new OpenLayers.Map('map');  
     
    1515            {map: "/mapdata/vmap_wms.map", layers: "basic"}); 
    1616        map.addLayer(baseLayer); 
     17 
     18        t.ok( OpenLayers.Element.hasClass(map.div, "olMap"), "Map div has olMap class"); 
    1719 
    1820        t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map returns object" ); 
  • trunk/openlayers/theme/default/style.css

    r7576 r7584  
     1div.olMap { 
     2    padding: 0px!important; 
     3    margin: 0px!important; 
     4} 
     5 
    16div.olMapViewport { 
    27    text-align: left;