<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal"><span style="color:#1f497d">Hi Bart,</span></p><p class="MsoNormal"><span style="color:#1f497d"> </span></p><p class="MsoNormal"><span style="color:#1f497d">My hypothesis was that using TileArcGISRest was not the correct way to access that endpoint, but it wasn’t clear which kind of OL “source” was the correct one to use.</span></p><p class="MsoNormal"><span style="color:#1f497d">Thanks for referring me to the “XYZ” source, and to your </span><a href="https://github.com/planetfederal/ole">https://github.com/planetfederal/ole</a> tool.<span style="color:#1f497d"></span></p><p class="MsoNormal"><span style="color:#1f497d"> </span></p><p class="MsoNormal"><span style="color:#1f497d">I got your tool installed on my system, substituted URL of the service I’m trying to access as the “caps-url” in ‘examples/layer-generator.html,’ and then ran examples/layer-generator.html </span></p><p class="MsoNormal"><span style="color:#1f497d">It was then able to fetch tiles from the MassGIS tile server successfully.</span></p><p class="MsoNormal"><span style="color:#1f497d">I stepped through your code in the debugger, and sure enough, execution went through “createXYZSource” rather than “createArcGISRestSource.”</span></p><p class="MsoNormal"><span style="color:#1f497d"> </span></p><p class="MsoNormal"><span style="color:#1f497d">With this info in-hand, I should be pretty much unblocked. I’ll let you know how things go.</span></p><p class="MsoNormal"><span style="color:#1f497d"> </span></p><p class="MsoNormal"><span style="color:#1f497d">Thanks again for your help.</span></p><p class="MsoNormal"><span style="color:#1f497d">Best regards,</span></p><p class="MsoNormal"><span style="color:#1f497d">Ben</span></p><p class="MsoNormal"><span style="color:#1f497d"> </span></p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> Bart van den Eijnden [mailto:<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>] <br><b>Sent:</b> Wednesday, September 25, 2019 1:38 PM<br><b>To:</b> Benjamin Krepp <<a href="mailto:bkrepp@ctps.org">bkrepp@ctps.org</a>>; <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br><b>Cc:</b> Saul Farber <<a href="mailto:saul@peoplegis.com">saul@peoplegis.com</a>><br><b>Subject:</b> Re: [OpenLayers-Users] CORB problem with TileArcGISRest layer in OpenLayers 5 client</span></p></div></div><p class="MsoNormal"> </p><p>Since that service does not support the export endpoint [1], you cannot use this source type, you need to use an XYZ source instead.<span style="font-size:12.0pt"></span></p><p>Have a look at: <a href="https://github.com/planetfederal/ole">https://github.com/planetfederal/ole</a> it can generate the layer config for you, based on the capabilities from the service.</p><p>Relevant code part is here:</p><p><a href="https://github.com/planetfederal/ole/blob/master/src/LayerGenerator.js#L56">https://github.com/planetfederal/ole/blob/master/src/LayerGenerator.js#L56</a></p><p>Best regards,</p><p>Bart</p><p>[1] <a href="https://tiles.arcgis.com/tiles/hGdibHYSPO59RG1h/arcgis/rest/services/MassGIS_Basemap_Detailed_Features/MapServer/export">https://tiles.arcgis.com/tiles/hGdibHYSPO59RG1h/arcgis/rest/services/MassGIS_Basemap_Detailed_Features/MapServer/export</a> gives a 404</p><div><p class="MsoNormal">On 25-09-19 16:36, Benjamin Krepp wrote:</p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><p class="MsoNormal">Dear colleagues,</p><p class="MsoNormal"> </p><p class="MsoNormal">I’m running into difficulty using a tiled basemap layer with an TileArcGISRest data source in an OpenLayers 5 client.</p><p class="MsoNormal">I’ve able to successfully use this layer in OpenLayers 2 clients, and don’t’ understand the problem I’m running into and what needs to be done to address it.</p><p class="MsoNormal">The layer in question is one of MassGIS’s (the Massachusetts State GIS Agency’s) tiled basemaps. It is described here: <a href="https://www.mass.gov/service-details/massgis-base-map">https://www.mass.gov/service-details/massgis-base-map</a></p><p class="MsoNormal"> </p><p class="MsoNormal">My sample OL 2 client, which works just fine, may be found here: <a href="https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v2/index.html">https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v2/index.html</a></p><p class="MsoNormal">My sample OL 5 client, which runs into errors, may be found here: <a href="https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v5/index.html">https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v5/index.html</a></p><p class="MsoNormal">The code for my OL 5 client is based on a sample on the OpenLayers website:  <a href="https://openlayers.org/en/latest/examples/arcgis-tiled.html">https://openlayers.org/en/latest/examples/arcgis-tiled.html</a></p><p class="MsoNormal"> </p><p class="MsoNormal">When run in the Chrome browser, the OL 5 client gets cross-origin read blocking (CORB) errors, reported in the developer’s console: </p><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-left:.5in">Cross-Origin Read Blocking (CORB) blocked cross-origin response <a href="https://tiles.arcgis.com/tiles/hGdibHYSPO59RG1h/arcgis/rest/services/MassGIS_Basemap_Detailed_Features/MapServer/export?F=image&FORMAT=PNG32&TRANSPARENT=true&SIZE=256%2C256&BBOX=-71.103515625%2C42.275390625%2C-71.015625%2C42.36328125&BBOXSR=4326&IMAGESR=4326&DPI=90">https://tiles.arcgis.com/tiles/hGdibHYSPO59RG1h/arcgis/rest/services/MassGIS_Basemap_Detailed_Features/MapServer/export?F=image&FORMAT=PNG32&TRANSPARENT=true&SIZE=256%2C256&BBOX=-71.103515625%2C42.275390625%2C-71.015625%2C42.36328125&BBOXSR=4326&IMAGESR=4326&DPI=90</a> with MIME type text/html. See <a href="https://www.chromestatus.com/feature/5629709824032768">https://www.chromestatus.com/feature/5629709824032768</a> for more details.</p><p class="MsoNormal"> </p><p class="MsoNormal">The layer also fails to render when the sample client is run in Firefox, IE, Edge, and Opera.</p><p class="MsoNormal">I checked the developer’s console in Firefox, and there no CORB errors are reported. Looking at the responses to the requests for tiles in the ‘Network’ tab, I see the following:</p><p class="MsoNormal" style="margin-left:.5in"><html></p><p class="MsoNormal" style="margin-left:.5in"><body></p><p class="MsoNormal" style="margin-left:.5in"><h2>Error</h2></p><p class="MsoNormal" style="margin-left:.5in"><div class=”restbody”></p><p class="MsoNormal" style="margin-left:.5in"><h3>Operation not supported.</h3><br/></p><p class="MsoNormal" style="margin-left:.5in"><b> Code: <b>404<br/><br/></p><p class="MsoNormal" style="margin-left:.5in"></div></p><p class="MsoNormal" style="margin-left:.5in"></body></p><p class="MsoNormal" style="margin-left:.5in"></html></p><p class="MsoNormal">So, in spite of the lack of an error message in the console, it’s clear that the server isn’t sending tiles back in response to requests.</p><p class="MsoNormal"> </p><p class="MsoNormal">Due to the big changes in the OpenLayers API between versions 2 and 3, my first hypothesis is that I’ve not correctly “translated” my OL 2 code into OL 3/4/5.</p><p class="MsoNormal">This having been said, it’s not clear to me what a “correct” translation might look like – the sample on the OL site noted above is the only thing I’ve been able to find to use as a model.</p><p class="MsoNormal"> </p><p class="MsoNormal">If anyone can shed light on what I might be doing wrong here, it would be much appreciated.</p><p class="MsoNormal"> </p><p class="MsoNormal">Thanks and best regards,</p><p class="MsoNormal">Ben </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"><b><span style="font-size:9.0pt">Benjamin Krepp</span></b><b><span style="font-size:9.0pt;color:#1f9000"> </span></b><span style="font-size:9.0pt;color:#1f9000"> |  </span><span style="font-size:9.0pt">Chief GIS Programmer/Analyst</span></p><p class="MsoNormal"><span style="font-size:9.0pt;color:#1f9000">CENTRAL TRANSPORTATION PLANNING STAFF</span></p><p class="MsoNormal"><span style="font-size:9.0pt">857.702.3670</span><b><span style="font-size:9.0pt;color:#1f9000"> </span></b><span style="font-size:9.0pt;color:#1f9000"> | </span><u><span style="font-size:9.0pt;color:blue"><a href="mailto:bkrepp@ctps.org"><span style="color:blue">bkrepp@ctps.org</span></a></span></u></p><p class="MsoNormal"><span style="font-size:9.0pt"><a href="http://www.ctps.org">www.ctps.org</a></span></p><p class="MsoNormal"><span style="font-size:9.0pt"> </span></p><p class="MsoNormal"><span style="font-size:9.0pt"><img border="0" width="309" height="105" id="Picture_x0020_1" src="cid:image001.jpg@01D573AE.9DAFB720" alt="email_logos_2015"></span></p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><br><i>Please be advised that the Massachusetts Secretary of State considers e-mail to be a public record, and therefore subject to the Massachusetts Public Records Law, M.G.L. c. 66 § 10. </i> <br><br></span></p><pre>_______________________________________________</pre><pre>Users mailing list</pre><pre><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></pre><pre><a href="https://lists.osgeo.org/mailman/listinfo/openlayers-users">https://lists.osgeo.org/mailman/listinfo/openlayers-users</a></pre></blockquote></div></body></html>

<br>
<i>Please be advised that the Massachusetts Secretary of State considers e-mail to be a public record, and therefore subject to the Massachusetts Public Records Law, M.G.L. c. 66 § 10. </i>