none
Bug Report - CORS implementation in Google Chrome RRS feed

  • Question

  • Hello,

    I was adding a tyle layer on the base maps and i was getting different behaviours, between Mozilla Firefox(47.0.1) and Google Chrome(Version 53.0.2785.143 m). The symptom was that on Mozzila everything works at it should when CORS is not configured, but in google Chrome tiles are being load some are rendered some are being load and not rendered.  I tried with multiple tileLayers from different tecnologies (JBoss and couchDB)

    Image Shows the both browser behaviours

    Being CORS a HTTP level implementation i dont understand how this is happening, neither a patern of the same(except the ones explained) but i have some suspicions about a Options request that i was getting in Google Chrome.

    Best regards

    João Mourão

    Tuesday, October 18, 2016 10:16 AM

Answers

  • It looks like the latest version of Chrome has introduced a bug that has broken the way CORS and images have worked for years in all browsers and how CORS is spec'd in the W3C. Images should load fine, you just shouldn't be able to access the pixel data of the canvas of cross domain images, which isn't the case here. We will report this to Google so it can be fixed in their next update. I have taken a quick look at would be involved in working around this with a hack, it would require a lot of work and re-architecture, so best to have Chrome fix this as this is likely breaking a lot of other applications besides Bing Maps.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Friday, October 28, 2016 5:31 PM
    • Marked as answer by JMRMourao Monday, October 31, 2016 2:25 PM
    Friday, October 28, 2016 5:31 PM

All replies

  • I'm not able to reproduce this. Try the tile layer samples here: http://www.bing.com/api/maps/sdk/mapcontrol/isdk#tileLayerQuadKey+JS

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#tileLayerPublicXYZoom+JS

    I've just tried them on all current major browsers and they work correctly. I believe one if not both of them has CORS enabled. If these work for you then it may be an issue with your tile server. Possibly the loading time of the tiles is taking too long. You can use the tile layer options to adjust the downloadTimeOut: https://msdn.microsoft.com/en-us/library/mt712686.aspx


    [Blog] [twitter] [LinkedIn]



    • Edited by Ricky_Brundritt Tuesday, October 18, 2016 5:31 PM
    • Proposed as answer by Ricky_Brundritt Tuesday, October 18, 2016 5:31 PM
    • Marked as answer by Ricky_Brundritt Tuesday, October 25, 2016 6:21 PM
    • Unmarked as answer by JMRMourao Friday, October 28, 2016 11:09 AM
    • Unproposed as answer by JMRMourao Friday, October 28, 2016 11:09 AM
    Tuesday, October 18, 2016 5:28 PM
  • I think i was missunderstood, the "problem" is that CORS is disabled, so in theory in Chrome nothing should show up, once CORS is enable everything works great.
    Wednesday, October 19, 2016 9:16 AM
  • It shouldn't make a difference. Cross domain images can be drawn on an html5 canvas with or without CORS. It only makes a difference if you try to then get the pixel data for the image which would happen if you use todataurl.  I believe the map does cache the pixel data, which may throw and error there, but the image should be drawn before that error occurs. Do you see any errors in the console? Ideally you will want CORS enabled as some future features that are planned will require that to work (I.e. The ability to export the map as an image)

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, October 19, 2016 3:18 PM
    • Marked as answer by Ricky_Brundritt Tuesday, October 25, 2016 6:21 PM
    • Unmarked as answer by JMRMourao Friday, October 28, 2016 11:09 AM
    • Unproposed as answer by JMRMourao Friday, October 28, 2016 11:09 AM
    Wednesday, October 19, 2016 3:18 PM
  • unwantedly i found the error i wanted to replicate in the examples. 

    With Chrome(Version 54.0.2840.71 m)

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#tileLayerQuadKey+JS 

    in this example with chrome you can check my report, check the image zoom in, out, left and right and some tiles will disapear show again etc etc

    • Edited by JMRMourao Friday, October 28, 2016 11:15 AM
    Friday, October 28, 2016 11:14 AM
  • It looks like the latest version of Chrome has introduced a bug that has broken the way CORS and images have worked for years in all browsers and how CORS is spec'd in the W3C. Images should load fine, you just shouldn't be able to access the pixel data of the canvas of cross domain images, which isn't the case here. We will report this to Google so it can be fixed in their next update. I have taken a quick look at would be involved in working around this with a hack, it would require a lot of work and re-architecture, so best to have Chrome fix this as this is likely breaking a lot of other applications besides Bing Maps.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Friday, October 28, 2016 5:31 PM
    • Marked as answer by JMRMourao Monday, October 31, 2016 2:25 PM
    Friday, October 28, 2016 5:31 PM