2012-09-22 27 views
0

我在我的網站上實現了一個樣式化的Google地圖,當我在iphone上查看頁面時,它鎖定了網頁的縮放級別。 「地圖」仍然是「可以縮放的」,但網頁不是。我不知道如何打開網頁和地圖的縮放比例。 在此先感謝任何幫手!下面是該頁面的鏈接 - http://esdaledesigns.com/contact.php谷歌地圖API鎖定整個網頁在iPhone上的縮放級別?

<script type="text/javascript"> 
     function initialize() { 


      // Create an array of styles. 
    var styles = [ 
    { 
    "stylers": [ 
     { "hue": "#ff6e00" }, 
     { "saturation": -67 } 
    ] 
    } 
    ]; 

    // Create a new StyledMapType object, passing it the array of styles, 
    // as well as the name to be displayed on the map type control. 
    var styledMap = new google.maps.StyledMapType(styles, 
    {name: "The Stockwell"}); 

    // Create a map object, and include the MapTypeId to add 
    // to the map type control. 
    var mapOptions = { 
    zoom: 16, 
    center: new google.maps.LatLng(51.890488, 0.899154), 
    mapTypeControlOptions: { 
     mapTypeIds: ['map_style'], 
    }, 
    }; 
    var map = new google.maps.Map(document.getElementById('map_canvas'), 
    mapOptions); 

    var myLatlng = new google.maps.LatLng(51.890488, 0.899154); 
    var marker = new google.maps.Marker({ 
     position: myLatlng, 
     animation: google.maps.Animation.DROP, 
     map: map, 
     title:"The Stockwell" 
    }); 

    //information 
    var contentString = '<div id="content">'+ 
    '<div id="siteNotice">'+ 
    '</div>'+ 
    '<h2 id="firstHeading" class="firstHeading">The Stockwell Colchester</h2>'+ 
    '<div id="bodyContent">'+ 
    '<p>THE STOCKWELL<br />18 WEST STOCKWELL STREET<br />COLCHESTER<br />ESSEX<br />CO1 1HN<br /></p>'+ 
    '</div>'+ 
    '</div>'; 

var infowindow = new google.maps.InfoWindow({ 
    content: contentString 
}); 


google.maps.event.addListener(marker, 'click', function() { 
    infowindow.open(map,marker); 
}); 


//Associate the styled map with the MapTypeId and set it to display. 
    map.mapTypes.set('map_style', styledMap); 
    map.setMapTypeId('map_style'); 
} 
    </script> 

回答

0

OK,算出來....

這是該位的代碼我張貼的腳本幾行以上,略高於谷歌API密鑰。 <meta name="viewport" content="initial-scale=2.0, user-scalable=no" />我將用戶可擴展性更改爲「是」,初始縮放比例爲「0.5」,並且所有內容都正常工作。 希望這可以幫助別人。

相關問題