[OpenLayers-Users] Help with Error:
OpenLayers.Control.OverviewMap is not a constructor
Rodrigo
rca.cirdan at gmail.com
Fri Oct 3 09:03:52 EDT 2008
Hi Subha,
I did this way you said:
var overviewOptions = {
layers: [DivisaoPolitica],
projection: "EPSG:4326",
units: "m",
maxResolution: "360.9912109375"
};
overview = new OpenLayers.Control.OverviewMap(overviewOptions);
map.addControl(overview);
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
// expand the overview map control
overview.maximizeControl();
DivisaoPolitica is my base layer and the maxResolution is defined on map
declaration...
I also tried with "0.17578125"... and none works!!
There's one more error now:
Error: lonLat is null
Source: http://localhost:8080/geoserver/openlayers/OpenLayers.js
Line: 265
And it only apears when I set this overview map...
Any more ideia of what is problem??
Thanks!
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
On Fri, Oct 3, 2008 at 09:49, Subha Ramakrishnan <subha at gslab.com> wrote:
> 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
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081003/05980cbe/attachment.html
More information about the Users
mailing list