Kak*_*o57 5 html maps scroll google-maps zoom
我正在尝试禁用此页面的滚动/缩放方面:
http://s1magazine.co.uk/NSA/pages/services/
每次我滚过它它只是放大,我怎么能禁用它?
<h2>NSA is a national competition happening throughout England.</h2>
<h2><!-- Responsive iFrame -->
<!-- Responsive iFrame --></h2>
<div class="Flexible-container"><iframe src="http://mapsengine.google.com/map/u/0/embed? mid=zyaBPLJJ7er8.kdbvNz_CrEYk" height="350" width="425" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
Run Code Online (Sandbox Code Playgroud)
自定义谷歌地图的更好方法是直接使用谷歌地图 API。对于特定情况,您可以在地图选项中将滚轮设置为 false并禁用滚动/缩放
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map-canvas"></div>
Run Code Online (Sandbox Code Playgroud)