[Users] Error "Is not a constructor"

Andreas Hocevar ahocevar at opengeo.org
Thu Feb 16 16:04:27 CET 2012


Maybe you're using a build of OpenLayers that does not contain the
controls you use - where do you load OpenLayers.js from?

Andreas.

2012/2/16 Francesc Cañas <kikocanas at gmail.com>:
> Hi,
>
> Some of OpenLayers.Controls makes error, firebugs says Is not a
> constructor...
>
> I put them in the map with:
>
> action = new GeoExt.Action({
> control: new OpenLayers.Control.ZoomToMaxExtent(),
>         map: map,
>         //text: "max_extent",
> iconCls: "zoom_extent",
>         tooltip: "zoom to max extent"
> });
> actions["zoom_extent"] = action;
> toolbarItems.push(action);
>
> I add ZoomBox and DragPan and both works, but ZoomTo MaxExtent,
> NavigationHistory and some else doesn't. Why is it?
> If I try to put them on the var map:
>
> var map = new OpenLayers.Map({
> div:"map_id",
> maxResolution: 'auto',
> projection: "EPSG:4326",
> controls: [
> new OpenLayers.Control.Navigation(),
> ],
> });
>
> The same thing happen, some of them works and others doesn't...
>
> Thanks!!
>
>
> --
> http://kikocanas.blogspot.com
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list