[OpenLayers-Users] Help with Error: OpenLayers.Control.OverviewMap is not a constructor

Rodrigo rca.cirdan at gmail.com
Fri Oct 3 08:34:44 EDT 2008


Every time I try to use this OpenLayers.Control.OverviewMap, it returns me
this error...
It also happens with OpenLayers.Control.ScaleLine!

Here is the code I just copied from OpenLayers examples and pasted into my
page!

// create an overview map control with the default options
        var overview = new OpenLayers.Control.OverviewMap();
        map.addControl(overview);

        map.setCenter(new OpenLayers.LonLat(0, 0), 2);

        // expand the overview map control
        overview.maximizeControl();


And if I set new OpenLayers.Control.ScaleLine while I'm defining map
options, it doesn't work too...

Like:

var bounds = new OpenLayers.Bounds(
                186432.76796875, 7476919.875,
                272697.46640625, 7569333.625
            );
            var options = {
                controls: [
                     // setup controls and initial zooms
                    new OpenLayers.Control.PanZoomBar(),
                    new OpenLayers.Control.Navigation(),
                    new OpenLayers.Control.Scale($('scale')),
                    new OpenLayers.Control.MousePosition({element:
$('location')}),
                    new OpenLayers.Control.LayerSwitcher(),
                    //new OpenLayers.Control.ScaleLine()

                ],
                maxExtent: bounds,
                maxResolution: 360.9912109375,
                projection: "EPSG:4326",
                units: 'm'
            };
            map = new OpenLayers.Map('map', options);

Does anybody knows what maybe the problem??

Thanks for now!

Rodrigo

======================================
Rodrigo C. Antonialli
Rio Claro - SP - Brasil
LinkedIn: http://www.linkedin.com/in/rcaprofile
Contato:  (19) 9757-0370
             rca.cirdan at gmail.com
             rcantonialli at gmail.com
             Skype: rc_antonialli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081003/d0d56a8e/attachment.html


More information about the Users mailing list