You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I do the following I get a compilation error of: "Error: Module not found: Error: Can't resolve '@capacitor/google-maps/dist/typings/definitions'"
const latLngBounds = new LatLngBounds({ southwest, center, northeast });
await this.map?.fitBounds(latLngBounds, 50);
I'm importing LatLngBounds from the plugin typings.
import { LatLngBounds } from '@capacitor/google-maps/dist/typings/definitions';
So I tried creating the LatLngBounds object without the constructor. It works on the web but in capacitor I get the error: "DataCloneError: The object can not be cloned." and the fitBounds doesn't work.
const latLngBounds: LatLngBounds = {
southwest,
center,
northeast,
contains: function (point: LatLng): Promise<boolean> {
throw new Error('Function not implemented.');
},
extend: function (point: LatLng): Promise<LatLngBounds> {
throw new Error('Function not implemented.');
}
};
await this.map?.fitBounds(latLngBounds, 50);
Platform(s)
All
Preferred Solution
Modify LatLngBounds class to have contains and extend methods optional.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.
Feature Request
Plugin
Google Maps
Description
I'm trying to use the map.fitBounds() method which has a
LatLngBounds
param.The
LatLngBounds
class is defined as:If I do the following I get a compilation error of: "Error: Module not found: Error: Can't resolve '@capacitor/google-maps/dist/typings/definitions'"
I'm importing
LatLngBounds
from the plugin typings.import { LatLngBounds } from '@capacitor/google-maps/dist/typings/definitions';
So I tried creating the
LatLngBounds
object without the constructor. It works on the web but in capacitor I get the error: "DataCloneError: The object can not be cloned." and thefitBounds
doesn't work.Platform(s)
All
Preferred Solution
Modify
LatLngBounds
class to havecontains
andextend
methods optional.Doing this, I'm able to create the
LatLngBounds
without the constructor like this and works fine in all platforms:The text was updated successfully, but these errors were encountered: