[OpenLayers-Users] P is undefined when trying to load .Bing

Takako Tucker Takako.Tucker at bbc.co.uk
Mon Mar 19 12:07:53 EDT 2012


So I'm now trying to convert .VirtulEarth to .Bing. 

 

Managed to remove most of the errors, but I can't seem to get to the
bottom of this. 

 

This is the code I have:

........................................................................
..............................................

        var map = new bbc.mtk.OpenLayers.Map(

                        'map',     

                        { 

                            provider: 'bing',

 

                            onLoad: function() {

                    

                                layer = new
bbc.mtk.OpenLayers.Layer.StaticData( 'M4 Route' );

 

                       

//////// more code after here

 

 

 

// Bing's Road imagerySet

var road = new OpenLayers.Layer.Bing({

    key: apiKey,

    type: "Road"

});

 

map.addLayers([road]);

map.zoomToMaxExtent();

........................................................................
..............................................

 

And it's throwing these errors:

Firebug -> P is undefined    F.prototype = P.prototype;
Chrome -> Uncaught TypeError: Cannot read property 'prototype' of
undefined

 

I think it's to do with the order of js gets loaded. Our API loads js in
the following order:

 

///////More classes before these///////////

        'OpenLayers/Layer/ClusterableLayer.js',

        'OpenLayers/Layer/Vector/RootContainer.js',

        'OpenLayers/Layer/PinPoints.js',

        'OpenLayers/Layer/Data.js',

        'OpenLayers/Layer/StaticData.js',

        'OpenLayers/Layer/DynamicData.js',

        'OpenLayers/Layer/EventPane.js',

        'OpenLayers/Layer/FixedZoomLevels.js',

        'OpenLayers/Layer/SphericalMercator.js',

        'OpenLayers/Layer/Route.js',

        'OpenLayers/Layer/SimpleRoute.js',

        'OpenLayers/Layer/XYZ.js',

        'OpenLayers/Layer/Bing.js',

        'OpenLayers/Style.js',

        'OpenLayers/StyleMap.js',

        'OpenLayers/Control/Attribution.js',

        'OpenLayers/Control/MouseToolbar.js',

        'OpenLayers/Control/NavToolbar.js',

        'OpenLayers/Control/PanPanel.js',

        'OpenLayers/Control/Pan.js',

        'OpenLayers/Control/ZoomIn.js',

        'OpenLayers/Control/ZoomOut.js',

        'OpenLayers/Control/ZoomPanel.js',

        'OpenLayers/Control/EditingToolbar.js',

        'OpenLayers/Control/SelectFeature.js',

        'OpenLayers/Format.js',

        'OpenLayers/Lang.js',

        'OpenLayers/Lang/en.js',

////////More classes after these//////////

 

 

Any information would be much appreciated. 

 

Thanks

 

Takako


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120319/80e1edf4/attachment.html


More information about the Users mailing list