2014-03-27 71 views
0

我試圖讓窗口變大一些,這樣我就可以把twitter的新聞提要放進去了。我混淆了一些內聯樣式,試圖使寬度和高度更大,不能使它工作,繼承了迄今爲止的代碼。我如何讓Google地圖中的信息窗口變大?

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> 
    <script> 
function initialize() { 
    var lnl = new google.maps.LatLng(33.8564199,-117.3610477); 
    var opt = { 
    zoom: 6, 
    center: lnl 
    } 
    var poop = '<div id="poop2" >' + '<a class="twitter-timeline" href="https://twitter.com/GreekTheatreLA" data-widget-id="448463912984256512">Tweets by @GreekTheatreLA</a>' + '</div>'; 
    var map = new google.maps.Map(document.getElementById('map-props'), opt); 
    var infowindow = new google.maps.InfoWindow({ 
    content:'<p id="hook"><a class="twitter-timeline" href="https://twitter.com/GreekTheatreLA" data-widget-id="448463912984256512">Tweets by @GreekTheatreLA</a></p>' 
}); 

    var griff = new google.maps.LatLng(34.1183438,-118.3003646); 
    var griff_mark = new google.maps.Marker({ 
     position: griff, 
     animation: google.maps.Animation.DROP, 
     title: "Griffith Observatory" 
    }); 

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

回答

0

將maxWidth添加到您在infowindow中的代碼,如下所示。

var infowindow = new google.maps.InfoWindow({ 
content:'<p id="hook" style="height:200px; width: 800px;"><a class="twitter-timeline" href="https://twitter.com/GreekTheatreLA" data-widget-id="448463912984256512">Tweets by @GreekTheatreLA</a></p>', 
maxWidth: 200 
}); 
+0

謝謝,我曾試圖更早自己,但只是替換了整個地圖,我得到這個消息的飼料,但evreything別人走了,任何想法,爲什麼會發生? – user3057747

+0

試試這個

+0

乾杯朋友工作 – user3057747

相關問題