StreetView API:隐藏全屏控制 [英] StreetView API: Hiding FullScreen Control

查看:143
本文介绍了StreetView API:隐藏全屏控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图隐藏Streetview API HUD中的切换全屏元素。

I am trying to hide the toggle fullscreen element in the Streetview API HUD.

panorama = new google.maps.StreetViewPanorama(document.getElementById(data.id), {

        position            : new google.maps.LatLng(data.lat, data.lng),
        pov: {
            heading         : Number(data.heading),
            pitch           : Number(data.pitch)
        },
        linksControl: false,
        panControl: false,
        addressControl: false,
        enableCloseButton: false,
        zoomControl: false,
        fullScreenControl: false,
        enableCloseButton: false,
        addressControlOptions: {
             position: google.maps.ControlPosition.BOTTOM_CENTER
        }
    });

这些选项已指定 here 。除了 fullScreenControl

These options are specced here. All the options are working except for the fullScreenControl

以外,所有选项都可以正常工作我的代码可以直接查看 here 。 UI元素位于视口的右上角。

My code can be viewed live here. The UI element is in the top right corner of the viewport.

文档警告如下:

The documentation warns as follows:


注意:此页面描述了控件在Google Maps JavaScript API的3.22及更高版本中可用。如果您想继续使用较早的一组控件,可以在v3.22中设置google.maps.controlStyle ='azteca'。阅读本文中对控件更改的更多信息:v3.22 Map控件中的新增功能。

Note: This page describes the controls available in version 3.22 and later of the Google Maps JavaScript API. If you want to continue using the earlier set of controls for a while, you can set google.maps.controlStyle = 'azteca' in v3.22. Read more about the changes to the controls in this article: What's New in the v3.22 Map Controls.

然而,我链接到API Js文件如下:

However I am linking to the API Js file as follows:

<script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>

并且3.exp在撰写时应该是3.22。

And 3.exp should be 3.22 at the moment of writing.

我在这里错过了什么?

What am I missing here?

推荐答案

另一个解决方案是使用css来隐藏全屏元素:

Another solution is to use css to hide the fullscreen element:

.gm-style > div:nth-child(10){
 display:none;
}

这篇关于StreetView API:隐藏全屏控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆