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

Adding GroundOverlays #492

Open
onfireprojects opened this issue Jan 19, 2022 · 1 comment
Open

Adding GroundOverlays #492

onfireprojects opened this issue Jan 19, 2022 · 1 comment

Comments

@onfireprojects
Copy link

onfireprojects commented Jan 19, 2022

[edited for readability and specification]

I want to add GroundOverlays, which are a thing inside the iOS file "objc!GoogleMaps.d.ts" >> GMSGroundOverlay
and i may be mistaken, but i don't see a way to use that right now, as it's also not a part of map-view.d.ts or other files.
Is there a way to use those functionalities (and other map-related things for that matter) directly - or am i missing something completely?

My project is running nativescript-vue 2.9 with nativescript-google-maps-sdk 3.0.2 btw

@onfireprojects onfireprojects changed the title Adding absolutely positioned overlays ("ground overlays") for custom shapes with text Adding GroundOverlays Feb 10, 2022
@MrSnoozles
Copy link

MrSnoozles commented Mar 11, 2022

Have you found a solution yet? I think your best bet would be to add them via the native Google Maps SDK. We did something like that for a tile overlay, and thanks to NativeScripts ability to access native SDKs it was not that complicated.

Here's an example of how to add the tile overlay. Ground overlay should be similar.

methods: {
  addTileOverlayAndroid() {
    addPrecipitationTileOverlayAndroid() {
            // load the map overlay
            let tileUrlProvider = com.google.android.gms.maps.model.UrlTileProvider.extend({
                getTileUrl: (x,y,zoom) => {
                    let url = this.getTileUrl(x, y, zoom);

                    return new java.net.URL(url);
                }
            });

            let tileProviderInstance = new tileUrlProvider(256, 256);

            this.currentFrame.overlay = this.mapView.gMap.addTileOverlay(new com.google.android.gms.maps.model.TileOverlayOptions()
                                                         .tileProvider(tileProviderInstance)
                                                         .transparency(0.9));
        },
  }
}

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

2 participants