Skip to content

Commit

Permalink
fix: project/unproject methods of Leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
Hsieh Chin Fan committed Oct 18, 2024
1 parent 0363711 commit 50e64af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BasicLeafletRenderer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ const Renderer = class extends defaultExport {
}

project ([lng, lat]) {
return this.map.latLngToLayerPoint([lat, lng])
return this.map.latLngToContainerPoint([lat, lng])
}

unproject ([x, y]) {
const latLng = this.map.layerPointToLatLng([x, y])
const latLng = this.map.containerPointToLatLng([x, y])
return [latLng.lng, latLng.lat]
}
}
Expand Down

0 comments on commit 50e64af

Please sign in to comment.