Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapTiler: Cross-Origin Read Blocking (CORB) blocked cross-origin #161

Open
brsnik opened this issue Jun 3, 2022 · 3 comments
Open

MapTiler: Cross-Origin Read Blocking (CORB) blocked cross-origin #161

brsnik opened this issue Jun 3, 2022 · 3 comments

Comments

@brsnik
Copy link

brsnik commented Jun 3, 2022

Getting the following error with MapTiler: Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.maptiler.com/maps/0d252733-b45d-492f-9a54-e8cf728d98d5/?key=key with MIME type text/html.

function mapTiler(x, y, z, dpr) {
  return `https://api.maptiler.com/maps/0d252733-b45d-492f-9a54-e8cf728d98d5/?key=key#${z}/${x}/${y}${
    dpr >= 2 ? "@2x" : ""
  }.png`;
}
    <Map
          provider={mapTiler}

          defaultCenter={[50.879, 4.6997]}
          defaultZoom={18}
          attribution={false}
        />

How do I fix this?

@patchampoux
Copy link

Hey! Have you found a solution for this problem? I am having the same issue.

@klokan
Copy link

klokan commented Sep 1, 2022

Hi!

  1. Do you have your own key? Get a free key at https://cloud.maptiler.com/account/keys/
  2. Does your key have access to the specified map? Pick a map yourself at https://cloud.maptiler.com/maps/ or just replace the string
  3. By default, your key is not going to be locked to any domain ... so it will run this way

The owner of the key can protect it - limit the key usage for his own domain or app user-agent - so others don't consume his requests. See: https://documentation.maptiler.com/hc/en-us/articles/360020806037-How-to-protect-your-map-key - if he does set the protection you get CORS / CORB error - but if you have a look on that request in Google Network console - you will see the error message properly on that request - very probably it means you are not allowed to use this key from your domain on the map of somebody else.

BTW where is this map with id 0d252733-b45d-492f-9a54-e8cf728d98d5 visible?
If it is a code example - you better replace it with streets map-id ...

@parvizmalik
Copy link

I have done exactly the same procedure like KLOKAN user mentioned, but i still get this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants