Hi,

I think, you have add 'sphericalMercator' to your layer.

var vehyb = new OpenLayers.Layer.VirtualEarth(
    "Virtual Earth Hybrid",
    {'type': VEMapStyle.Hybrid, 'sphericalMercator': true}
);
 
Arnd

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im
Auftrag von Stefan Keller
Gesendet: Freitag, 30. April 2010 19:47
An: [email protected]
Betreff: [OpenLayers-Users] KML over VirtualEarth Map doesn't display or
hasa shift

Hi!

I'm trying to lay an KML over VirtualEarth Map in OpenLayers, but it either
does'nt display anything or KML points have a shift of 100m.
I guess it has to be something with the projection.

Map:
var options = {
    controls: [ new OpenLayers.Control.KeyboardDefaults(),
                new OpenLayers.Control.MouseDefaults(),
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.LayerSwitcher()
                ],
    maxExtent: new OpenLayers.Bounds( -200000, -200000, 200000, 200000),
    numZoomLevels: 19,
    units: 'm',
    projection: new OpenLayers.Projection("EPSG:900913"),
 displayProjection: new OpenLayers.Projection("EPSG:4326"),
sphericalMercator: true

};


map = new OpenLayers.Map("map", options);

var binghybrid = new OpenLayers.Layer.VirtualEarth("Hybrid", {
            type: VEMapStyle.Hybrid
});


KML:
var animals = new OpenLayers.Layer.Vector("Animals", {
           projection: new OpenLayers.Projection("EPSG:4326"),
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "kml/animals.kml",
                format: new OpenLayers.Format.KML({
                    extractStyles: true,
                    extractAttributes: true
                })
            })
        });

Anybody?!
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to