openlayers:cloudmade层与bing或osm的投影略有不同

时间:2012-03-22 09:07:32

标签: openlayers bing projection openstreetmap cloudmade

我有一个openlayers地图,其中包含不同的图层,如bing或openstreetmap,以及cloudmade图层。 bing和openstreetmap显示完全相同的位置。 如果我将图层切换到cloudmade,则位置会跳跃大约200米。

任何想法,如何改变这个?

var map, options;

        function init(){

        map = new OpenLayers.Map('map', {
        controls: [
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.ScaleLine(),
                new OpenLayers.Control.Attribution(),
                new OpenLayers.Control.LayerSwitcher(),
                new OpenLayers.Control.PanZoomBar({minZoom: 12})

            ],
            minZoom:12,
            maxZoom:19          });


    var osm = new OpenLayers.Layer.OSM();


var binghybrid = new OpenLayers.Layer.Bing({
key: "MYKEY",
type: "AerialWithLabels",
name: "Satellite"});

var cloudmade = new OpenLayers.Layer.CloudMade("cloudmade", {
key: 'MYKEY',
styleId: 57439});


             map.addLayers([cloudmade, binghybrid, osm]);
    var epsg4326 = new OpenLayers.Projection("EPSG:4326");
    var center = new OpenLayers.LonLat(14.290556,48.303056).transform(epsg4326, map.getProjectionObject());
    map.setCenter(center, 14);

1 个答案:

答案 0 :(得分:4)

您应该修改original OpenLayers.Layer.CloudMade类:将OpenLayers.Layer.TMS更改为OpenLayers.Layer.XYZ。 Here正在运作。