[OpenLayers-Users] Re: Bing Zoom Layer and Google Zoom Layer aligning

static101 jason at bt-systems.com
Mon Aug 22 20:41:30 EDT 2011


Thank you for the helpful suggestions, but I am still not quite getting it.
Closer I feel. 

Here is a copy of my code (I am only including relevant bits: 
  var options = {
      controls: controls_array,
      projection: new OpenLayers.Projection("EPSG:900913"),
      displayProjection: new OpenLayers.Projection("EPSG:4326"),
      units: "m",
      maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
                                       20037508.34, 20037508.34),
      numZoomLevels: 8,
      minResolution: 19.1092570679
  };

  map = new OpenLayers.Map('map_element',options);

  var road = new OpenLayers.Layer.Bing({
      key: bingApiKey,
      type: "Road",
      sphericalMercator: true,
      numZoomLevels:8
  });
  
  var google_streets = new OpenLayers.Layer.Google(
    "Google Streets",
    {
      type: google.maps.MapTypeId.ROADMAP,
      sphericalMercator: true,
      isBaseLayer: true
    }
  );

  var oam = new OpenLayers.Layer.XYZ(
      "CA Tiles",
      "http://myurl.com/rt/mixed/current/tile-${z}-${x}-${y}.png",
      {
          sphericalMercator: true,
          displayInLayerSwitcher: true,
          visibility:true,
          isBaseLayer:false,
          alpha: true,
          resolutions: [9783.93961875,4891.96980938,2445.98490469,
                      1222.99245234,
                     
611.496226172,305.748113086,152.874056543,76.4370282715,
                      38.2185141357,19.1092570679]

      }
  );
  map.addLayer(oam);

Basically when I am zooming around at the most zoomed in on the controls,
Google retrieves the tile: tile-9-82-199.png - this works correctly. I flip
to the Bing layer, and it tries to retrieve tile-8-82.199.png - the Z value
is one less. I cannot seem to get the zoom levels to be the same. 

Am I just doing something silly?

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Bing-Zoom-Layer-and-Google-Zoom-Layer-aligning-tp6701507p6714369.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list