mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Fix unprojection when using terrain (#1620)
This commit is contained in:
parent
31a0e8eaf6
commit
e4b44c3fed
@ -147,9 +147,10 @@ function normalizeEvent(event) {
|
||||
|
||||
event.point = pos;
|
||||
|
||||
const {viewport} = this;
|
||||
const location = viewport.unproject(pos, {targetZ: viewport.meterOffset[2]});
|
||||
event.lngLat = [location[0], location[1]];
|
||||
if (this.map) {
|
||||
const location = this.map.unproject(pos);
|
||||
event.lngLat = [location.lng, location.lat];
|
||||
}
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
@ -3303,9 +3303,9 @@ camelcase@^5.0.0:
|
||||
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
|
||||
|
||||
caniuse-lite@^1.0.30001219:
|
||||
version "1.0.30001228"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa"
|
||||
integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==
|
||||
version "1.0.30001285"
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001285.tgz"
|
||||
integrity sha512-KAOkuUtcQ901MtmvxfKD+ODHH9YVDYnBt+TGYSz2KIfnq22CiArbUxXPN9067gNbgMlnNYRSwho8OPXZPALB9Q==
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user