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

Subha Ramakrishnan subha at gslab.com
Fri Oct 3 08:49:20 EDT 2008


Rodrigo wrote:
> 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();
You have to mention the overview map options when you are creating  an 
overview map control.
Eg.
var overviewOptions = {
     layers: [overviewLayer],
     projection: "EPSG:4326",
     units: "m",
     maxResolution: "0.17578125"
  };
  overview = new OpenLayers.Control.OverviewMap(overviewOptions);
>         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 <mailto:rca.cirdan at gmail.com>
>              rcantonialli at gmail.com <mailto:rcantonialli at gmail.com>
>              Skype: rc_antonialli
>
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   




More information about the Users mailing list