Skip to content

Commit

Permalink
fix map click coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Aug 19, 2024
1 parent 6f12b0b commit 45eafe3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --force",
"build": "run-p type-check \"build-only -- {@}\" --",
"preview": "vite preview",
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
Expand Down
2 changes: 1 addition & 1 deletion packages/openlayers/lib/map/register-events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe("event registration", () => {
});
it("registers the event on the map", () => {
expect(callback).toHaveBeenCalledWith({
coordinate: toLonLat([10, 10]),
coordinate: toLonLat([123, 123]),
type: "map-click",
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/openlayers/lib/map/register-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function listen<T extends keyof MapEventsByType>(
case MapClickEventType:
map.on("click", (event) => {
const coordinate = toLonLat(
event.pixel,
event.coordinate,
map.getView().getProjection(),
) as [number, number];
(callback as (event: unknown) => void)({
Expand Down

0 comments on commit 45eafe3

Please sign in to comment.