Skip to content

Calling getData(evt.pixel) on WMS layer returns null #15744

Answered by ahocevar
samuelchau asked this question in Q&A
Discussion options

You must be logged in to vote

Ah sorry, I was on the wrong track. My answer above was referring to getFeature(pixel).

The problem in your code is that your TileWMS source is missing the

crossOrigin: 'anonymous',

config option. If it still does not work with that setting, then the WMS does not send CORS headers.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@samuelchau
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by samuelchau
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants