<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Arnd,<br>
      <br>
      That seems to do the trick. Great.<br>
      <br>
      Thanks,<br>
      Jim<br>
      <br>
      On 03/11/2014 05:09 PM, Arnd Wippermann wrote:<br>
    </div>
    <blockquote cite="mid:A9205684F9E5452CB45BB3C599870101@pcawh2"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <meta name="GENERATOR" content="MSHTML 8.00.6001.23562">
      <div dir="ltr" align="left"><font color="#0000ff" face="Arial"
          size="2"><span class="062430321-11032014">Hi,</span></font></div>
      <div dir="ltr" align="left"><font color="#0000ff" face="Arial"
          size="2"><span class="062430321-11032014"></span></font> </div>
      <div dir="ltr" align="left"><font color="#0000ff" face="Arial"
          size="2"><span class="062430321-11032014">set the resolutions
            for the osm layer, then it should work:</span></font></div>
      <div dir="ltr" align="left"><font color="#0000ff" face="Arial"
          size="2"><span class="062430321-11032014"></span></font> </div>
      <div dir="ltr" align="left"><font color="#0000ff" face="Arial"
          size="2">    var osm = new OpenLayers.Layer.OSM("Open Street
          Map", "",{<br>
                      resolutions: [2445.984, 1222.99, 611.496, 305.748,
          152.874, 76.437, 38.218],<br>
                      serverResolutions :
[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,<br>
                         
2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,<br>
                         
38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,<br>
                          0.5971642833948135<br>
                      ]<br>
                  });<br>
        </font></div>
      <div dir="ltr" align="left"><span class="062430321-11032014"><font
            color="#0000ff" face="Arial" size="2">Arnd</font></span></div>
      <div dir="ltr" align="left"><span class="062430321-11032014"></span> </div>
      <div dir="ltr" align="left"><span class="062430321-11032014"><font
            color="#0000ff" face="Arial" size="2"><a
              moz-do-not-send="true"
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OLdev/OSM_restrictedZoomLevels.asp">http://gis.ibbeck.de/ginfo/apps/OLExamples/OLdev/OSM_restrictedZoomLevels.asp</a></font></span></div>
      <br>
      <div dir="ltr" class="OutlookMessageHeader" align="left" lang="de">
        <hr tabindex="-1">
        <font face="Tahoma" size="2"><b>Von:</b>
          <a class="moz-txt-link-abbreviated" href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a>
          [<a class="moz-txt-link-freetext" href="mailto:openlayers-users-bounces@lists.osgeo.org">mailto:openlayers-users-bounces@lists.osgeo.org</a>] <b>Im
            Auftrag von </b>Jim White<br>
          <b>Gesendet:</b> Dienstag, 11. März 2014 00:05<br>
          <b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:jack@greenbaum.org">jack@greenbaum.org</a>;
          <a class="moz-txt-link-abbreviated" href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br>
          <b>Betreff:</b> [OpenLayers-Users] OSM base layer with TMS
          overlay<br>
        </font><br>
      </div>
      <div class="moz-cite-prefix"> Hi,<br>
        <br>
        Here is what I have. You can see 4 base layers, and start of
        overlays at end. Any of the 3 base layers Google, TMS, WMS
        selected will cause overlay TMS to be displayed properly.
        Selecting OSM base layer selects tiles with wrong zoom.<br>
        <br>
        With OSM as base layer it is incorrectly selecting tile such as
        this with zoom 10, which is 6 too large<br>
        <br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://tecumseh.zo.ncsu.edu/tilecache/1.0.0/huc10nc/10/11/7.png">http://tecumseh.zo.ncsu.edu/tilecache/1.0.0/huc10nc/10/11/7.png</a><br>
        <br>
        It should be asking for <br>
        <br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://tecumseh.zo.ncsu.edu/tilecache/1.0.0/huc10nc/4/11/7.png">http://tecumseh.zo.ncsu.edu/tilecache/1.0.0/huc10nc/4/11/7.png</a><br>
        <br>
        <br>
        <br>
          //////Base Layers<br>
            var gphy = new OpenLayers.Layer.Google("Google Physical", {<br>
                type: google.maps.MapTypeId.TERRAIN,<br>
                MAX_ZOOM_LEVEL: 12,<br>
                MIN_ZOOM_LEVEL: 6,<br>
                displayInLayerSwitcher: false,<br>
                visibility: false,<br>
                buffer: 0<br>
            });<br>
        <br>
            var osm = new OpenLayers.Layer.OSM("Open Street Map");<br>
        <br>
            var counties_base = new OpenLayers.Layer.TMS("None",<br>
                SERVER_URI + "tilecache/", {<br>
                    layername: "counties",<br>
                    type: "png",<br>
                    tileOrigin: new OpenLayers.LonLat(-9462455, 3963396)<br>
                }<br>
            );<br>
        <br>
            var hillshade = new OpenLayers.Layer.WMS("NC Hillshade",<br>
                SERVER_URI + "geoserver/wms", {<br>
                    layers: "NC_Hill_3857_to",<br>
                    format: 'image/png'<br>
                }, {<br>
                    visibility: false,<br>
                    displayInLayerSwitcher: false<br>
                });<br>
            ////////////////////////////////////////////////////////////<br>
            /// TMS line layers overlays<br>
            /////////////////////////////////////////////////////////<br>
        <br>
        <br>
            var nchuc2 = new OpenLayers.Layer.TMS("NC HUC 2",<br>
                SERVER_URI + "tilecache/", {<br>
                    layername: "huc2nc",<br>
                    type: "png",<br>
                    isBaseLayer: false,<br>
                    visibility: false,<br>
                    tileOrigin: new OpenLayers.LonLat(-9462455, 3963396)<br>
                }<br>
            );On 03/10/2014 03:32 PM, <a moz-do-not-send="true"
          class="moz-txt-link-abbreviated"
          href="mailto:jack@greenbaum.org">jack@greenbaum.org</a> wrote:<br>
      </div>
      <blockquote
cite="mid:b1dcfe5b54f020b4197f349b12fd601b.squirrel@tides.mohawkreef.com"
        type="cite">
        <pre wrap="">How are you creating the TMS layer? Are you using an OSM layer with the
TMS urls? If so that is you problem, TMS and OSM use opposite y dimension
mappings. Use a TMS layer instead.

-- Jack

</pre>
        <blockquote type="cite">
          <pre wrap="">Someone pointed out that I could request tiles from tilecache using TMS
instead of WMS, which I have done and it has mostly fixed my problems.
However, if I use Open Street Map as my base layer then my TMS overlays
are requesting the wrong tiles.

If I don't get any suggestions from the list I am going to file a bug.

Jim



On 03/10/2014 03:00 PM, <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:openlayers-users-request@lists.osgeo.org">openlayers-users-request@lists.osgeo.org</a> wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">Is the baselayer you are trying to serve from WMS in 900913? Serving
from tilecache is only going to work if the tiles are in right project.
Try losing the tileorigin in the constructor as well.
</pre>
          </blockquote>
          <pre wrap="">--
James B. White
Cary, NC
H: 919-380-9615
M: 919-698-1765
White Coding and Maps <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="http://whitecodingandmaps.com/"><http://whitecodingandmaps.com/></a>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
        </blockquote>
      </blockquote>
      <br>
      <br>
      <div class="moz-signature">-- <br>
        James B. White<br>
        Cary, NC<br>
        H: 919-380-9615<br>
        M: 919-698-1765<br>
        <a moz-do-not-send="true" href="http://whitecodingandmaps.com/">White
          Coding and Maps</a> </div>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      James B. White<br>
      Cary, NC<br>
      H: 919-380-9615<br>
      M: 919-698-1765<br>
      <a href="http://whitecodingandmaps.com/">White Coding and Maps</a>
    </div>
  </body>
</html>