Hi,
I'm new to OpenLayers and I'm trying to add a KML file to a map with Bing
layers, however, the layer seems to start in the wrong position and move
around the map whenever I move the map. It also doesn't zoom to the bounds
as expected. Here's my code:
var map;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.VirtualEarth("Road", {
type: VEMapStyle.Road
});
var kml = new OpenLayers.Layer.GML("KML",
"GrittingRoutesLichfield.kml",
{
format: OpenLayers.Format.KML,
formatOptions: {
extractStyles: true,
extractAttributes: true,
maxDepth: 2
}
});
map.addLayer(layer);
map.addLayer(kml);
map.zoomToExtent(kml.getDataExtent());
}
Any ideas?
Thanks :)
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users