I am trying to use Bing maps on my HTML page using OpenLayers and geoEXT. the problem is when I change the center of the Bing map nothing happens, also when I try to zoom on the map on certain point like this:
Bing.setCenter(new OpenLayers.LonLat(rec.get('x'),rec.get('y')).transform('EPSG:4326','EPSG:26191'), 9);
It doesn't zoom on this point with the x and y, all I get is the zoom with degree 9.
Here's the code:
var Bing;
var apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
Bing = new OpenLayers.Map("map");
map.addControl(new OpenLayers.Control.LayerSwitcher());
var road = new OpenLayers.Layer.Bing({
name: "Road",
key: apiKey,
type: "Road"
});
var hybrid = new OpenLayers.Layer.Bing({
name: "Hybrid",
key: apiKey,
type: "AerialWithLabels"
});
var aerial = new OpenLayers.Layer.Bing({
name: "Aerial",
key: apiKey,
type: "Aerial"
});
Bing.addLayers([road, hybrid, aerial]);
var center = new OpenLayers.LonLat(-93.27, 44.98).transform(
'EPSG:4326', 'EPSG:3857'
);
Bing.setCenter(new OpenLayers.LonLat(-110, 45), 3);
bingpanel = new GeoExt.MapPanel({
region:"center",
height: 400,
width: 600,
map: Bing
});