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

Unable to create Google Maps custom infoWindow on iOS #564

Open
dlcole opened this issue Jan 18, 2024 · 1 comment
Open

Unable to create Google Maps custom infoWindow on iOS #564

dlcole opened this issue Jan 18, 2024 · 1 comment

Comments

@dlcole
Copy link

dlcole commented Jan 18, 2024

This code works on Android to create a custom infoWindow using the @nativescript/google-maps plugin:

export function onMarkerInfoWindow(args) {
    const marker = args.marker;
    const info = new StackLayout();
    info.width = 200;
    info.height = 100;
    info.backgroundColor = 'white';
    const text = new Label();
    text.text = marker.title;
    info.addChild(text);
    args.view = info;  
} 

On iOS, however, the default infoWindow is displayed.

Here's the code in index.ios.ts that raises the MarkerInfoWindow event.

The problem is that event.view.ios is null, and that causes the default infoWindow to be used. The native view needs to be created for the Stackayout returned by onMarkerInfoWindow.

This issue is also discussed in this Discord thread.

@dlcole
Copy link
Author

dlcole commented Jan 26, 2024

I have created a GitHub repo to demo the problem. I modified the code here to catch the markerInfoContents event rather than markerInfoWindow, as this retains the pointer at the bottom of the infoWindow.

Using the new 1.7.1 version of @nativescript/google-maps, I can now at least see a small infoWindow on iOS, but it contains no data. See the screen shots, below...

Screenshot_1706236711
Simulator Screenshot - iPhone 15 Pro - 2024-01-25 at 21 38 03

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