2015-12-04 24 views
0

我正在尝试更新我的网站上的地图系统,以便为Google Maps v3使用更新的插件。我决定去与该插件,是:禁用GMap.js中的控件

https://hpneo.github.io/gmaps/examples.html

我有工作,但我不能为我的生活工作如何禁用控制:

enter image description here

基本上,我标记为红色的所有位,我不想显示。下面是我如何打电话给地图:

modal_map = new GMaps({ 
    div: '#popup_map', 
    lat: coords[0], 
    lng: coords[1] 
}); 

任何人都可以建议我如何去除控制?正如你所看到的,我在一个非常狭小的空间 - 所以我不希望任何它被浪费在这些位:)

+0

为什么地球上有这么meone down投了我的问题?这是一个完全合理的问题! –

回答

0

您可以通过Google Maps Javascript API v3记录控制选项进入GMAP构造:

disableDefaultUI: true 

代码片段:

var geocoder; 
 
var map; 
 
var coords = [37.4419, -122.1419]; 
 

 
function initialize() { 
 

 
    var modal_map = new GMaps({ 
 
    div: '#popup_map', 
 
    lat: coords[0], 
 
    lng: coords[1], 
 
    disableDefaultUI: true 
 
    }); 
 
    modal_map.map.set("disableDefaultUI", true); 
 

 
} 
 
google.maps.event.addDomListener(window, "load", initialize);
html, 
 
body, 
 
#popup_map { 
 
    height: 100%; 
 
    width: 100%; 
 
    margin: 0px; 
 
    padding: 0px 
 
}
<script src="https://maps.googleapis.com/maps/api/js"></script> 
 
<script src="https://hpneo.github.io/gmaps/gmaps.js"></script> 
 
<div id="popup_map"></div>

+0

哦,你美丽!谢谢,那是它:) –