我一直試圖風格我的谷歌地圖整週,我會繞圈!我有我想使用的JSON值,但不知道如何將它們添加到JavaScript!我還想讓縮放欄控制的東西坐在窗口的右側,而不是左側,因爲我的地圖是整頁背景,所以在左側,這隱藏在網站內容div後面。麻煩造型我的谷歌地圖
任何人都可以幫忙嗎?
:)
我想補充的是JSON:
[{造型器:[{飽和度:-90},{伽瑪:0.87}]}]
和代碼我有我的地圖是:
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the function closure
// Each instance of the function preserves the contends of a different instance
// of the "marker" and "html" variables which will be needed later when the event triggers.
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
// Display the map, with some controls and set the initial location
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(50.826910965853585, -0.13648152351379395), 16);
// Set up the markers with info windows
var point = new GLatLng(50.826910965853585, -0.13648152351379395);
var marker = createMarker(point,'<div style="width:300px">text for pop up here....</div>')
map.addOverlay(marker);
}
// display a warning if the browser was not compatible
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
//]]>
</script>
這傢伙博客在谷歌地圖上有很多例子http://www.svennerberg.com – defau1t 2011-12-16 19:32:49