<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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
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;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1777671679;
mso-list-type:hybrid;
mso-list-template-ids:-808448726 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style></head><body lang="EN-US" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Alex,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks for chiming in on my question.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">First, I should note that I’m NOT seeing a response with content type text/html in the Chrome Dev tools. (I’m seeing no response whatsoever there.) I only see what looks like text/html response in the Firefox dev tools. I’m confused by this, and wonder if the response quoted in my original message is really being returned or if it’s cooked up by the Firefox dev tools. (This is not to point fingers – it’s just that I’m not seeing any “response data” at all in Chrome.)</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I understand your point about the “<a href="http://tiles.arcgis.com">tiles.arcgis.com</a>” URL, but what’s not clear to me is why the<u> OL 2 client is working just fine using “<a href="http://tiles.arcgis.com">tiles.arcgis.com</a>” URLs</u>. (!)</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">If you run the OL 2 client in the debugger, and look at the network traffic, you’ll see that tiles with URLs of the form <a href="http://tiles.arcgis.com/">http://tiles.arcgis.com/</a>... are returned successfully.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">My best hypothesis is that <u>in the OL 5 world</u> I’m not using the right type of layer and/or the right “source” for that layer, or that there are some options I need to pass when creating the “layer” or “source”.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">In the world of the OL 5 client:</span></p><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Symbol;color:#1f497d"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman""> </span></span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The layers in question are vanilla <b>Layer</b>s</span></p><p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt;font-family:Symbol;color:#1f497d"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman""> </span></span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Their “source”s are <b>TileArcGISRest</b></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">In short, what’s the correct “translation” of <b>OpenLayers.Layer.ArcGISCache</b> in OL2-speak into OL5-speak?<b></b></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Best,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Ben</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Alex Rice [mailto:<a href="mailto:rice.guido@gmail.com">rice.guido@gmail.com</a>] <br><b>Sent:</b> Wednesday, September 25, 2019 12:08 PM<br><b>To:</b> Benjamin Krepp <<a href="mailto:bkrepp@ctps.org">bkrepp@ctps.org</a>><br><b>Cc:</b> <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a>; 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><p class="MsoNormal"> </p><div><p class="MsoNormal">The <a href="http://tiles.arcgis.com">tiles.arcgis.com</a> URL seems to be invalid because it's returning content-type: text/html instead of a tile, as you observed. I would try to solve that before even thinking about CORB/CORS problem. Maybe that problem will go away when you are getting a tiles response (the http headers will likely be different as well).</p></div><p class="MsoNormal"> </p><div><div><p class="MsoNormal">On Wed, Sep 25, 2019 at 8:37 AM Benjamin Krepp <<a href="mailto:bkrepp@ctps.org">bkrepp@ctps.org</a>> wrote:</p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear colleagues,</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I’m running into difficulty using a tiled basemap layer with an TileArcGISRest data source in an OpenLayers 5 client.</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" target="_blank">https://www.mass.gov/service-details/massgis-base-map</a></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" target="_blank">https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v2/index.html</a></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" target="_blank">https://www.ctps.org/geoserver/www/apps/MassGIS_basemap_OL_v5/index.html</a></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" target="_blank">https://openlayers.org/en/latest/examples/arcgis-tiled.html</a></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </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" target="_blank">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" target="_blank">https://www.chromestatus.com/feature/5629709824032768</a> for more details.</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The layer also fails to render when the sample client is run in Firefox, IE, Edge, and Opera.</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">If anyone can shed light on what I might be doing wrong here, it would be much appreciated.</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks and best regards,</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Ben </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:9.0pt;color:black">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;color:black">Chief GIS Programmer/Analyst</span></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;color:#1f9000">CENTRAL TRANSPORTATION PLANNING STAFF</span></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;color:black">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" target="_blank">bkrepp@ctps.org</a></span></u></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;color:black"><a href="http://www.ctps.org" target="_blank">www.ctps.org</a></span></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;color:black"> </span></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;color:black"><img border="0" width="309" height="105" id="gmail-m_3545182883917715555Picture_x0020_1" src="cid:image001.jpg@01D5739B.0449D3D0" alt="email_logos_2015"></span></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p></div></div><p class="MsoNormal"><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>Users mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/openlayers-users</a></p></blockquote></div><p class="MsoNormal"><br clear="all"><br>-- </p><div><p class="MsoNormal">Alex G Rice<br><a href="mailto:rice.guido@gmail.com" target="_blank">rice.guido@gmail.com</a><br>+1 505-603-5639</p></div></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>