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

f.setPosition is not a function #1101

Open
yusuffsaid opened this issue Jun 16, 2023 · 0 comments
Open

f.setPosition is not a function #1101

yusuffsaid opened this issue Jun 16, 2023 · 0 comments

Comments

@yusuffsaid
Copy link

Issue: f.setPosition is not a function error when using @react-google-maps/api package

Description:
I encountered an issue while using the @react-google-maps/api package where I received a f.setPosition is not a function error. This error occurs when I call the setMarkerPosition function to set the position of the marker. Strangely, the error only appears in Sentry, and I couldn't reproduce it locally.

Steps to Reproduce:

Use the setMarkerPosition function to set the marker position:

const setMarkerPosition = (lat: any, lng: any) => {
    marker.setPosition({
        lat: lat,
        lng: lng,
    });
};

Call setMarkerPosition function using placeDetails from placesServices:

setMarkerPosition(
    placeDetails?.geometry?.location.lat(),
    placeDetails?.geometry?.location.lng()
);

Call setMarkerPosition function using the position from the current location button:

setMarkerPosition(position.coords.latitude, position.coords.longitude);

Expected Behavior:
The f.setPosition function should set the position of the marker correctly without any errors.

Actual Behavior:
The f.setPosition is not a function error is logged in Sentry when using the @react-google-maps/api package.

Environment:
Package version: "@react-google-maps/api": "^2.18.1",
Browser/Platform: Chrome Version:113.0.0

Screenshots/Error Logs:
Ekran Resmi 2023-06-16 17 33 43
Ekran Resmi 2023-06-16 17 33 30

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

1 participant