-->

Enabling liteMode in Javascript googlemaps api

2019-08-02 03:48发布

问题:

We are using JavaFX' WebView to embed a webpage where we want to display map content using google map's javascript API and ng-map.

NgMap.getMap().then(function (map) {
                map.setOptions({
                    maxZoom: 17,
                    streetViewControl: true,
                    // liteMode: true, // that would be cool :-)
                    streetViewControlOptions: {
                        position: google.maps.ControlPosition.TOP_RIGHT },
                    keyboardShortcuts: false,
                    //... ommited for brevity
                });
            });

As WebView is not supporting WebGL we need to find a way to enable lite mode (as it is possible when using the android API). Does anyone know a way to achieve this?

回答1:

When I just load google maps in a JavaFX WebView via URL I automatically end up in the lite mode. Are you sure this does not happen for you too?