2012-05-11 6 views
2

Может кто-нибудь мне помочь?Неверное отображение информации в Google Maps API

У меня проблема с отображением infoWindow в API Карт Google - фоновая тень отображается неправильно. Прозрачность тени не работает.

[Вы можете видеть проблему на веб-странице] [1] (нажмите на красный Лил А в кругу, чтобы показать проблему)

код здесь:

var geocoder; 
var map; 
function initialize() { 
var pinkParksStyles = [ 
{ 
featureType: "all", 
stylers: [ 
{ saturation: -80 } 
] 
}, 
{ 
featureType: "landscape.man_made", 
stylers: [ 
{ hue: "#ed1c26" }, 
{ saturation: 100 }, 
{ gamma: 0.2 } 
] 
} 
]; 

var pinkMapType = new google.maps.StyledMapType(pinkParksStyles, 
{name: "Architektonická mapa"}); 

geocoder = new google.maps.Geocoder(); 
var latlng = new google.maps.LatLng(49.830896,15.331421); 


var myOptions = { 
    zoom: 7, 
    center: latlng, 
    mapTypeControlOptions: { 
mapTypeIds: [google.maps.MapTypeId.ROADMAP, "pink_parks"] 
    } 
} 

map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 

var hvezdo = new google.maps.LatLng(49.872623,14.769359); 

map.mapTypes.set("pink_parks", pinkMapType); 
map.setMapTypeId("pink_parks"); 

var image = "http://www.cka2011.cz/archbook/wp-content/plugins/Ada_archmapa/icon-arch.png"; 

var hvezdo = new google.maps.LatLng(49.872623,14.769359); 

    var marker = new google.maps.Marker({ 
    position: hvezdo, 
    map: map, 
    title:"matomas.cz", 
    icon: image, 
}); 

var contentString = "<div id=content>"+ 
"<div id= siteNotice >"+ 
"</div>"+ 
"<h2 id= firstHeading class= firstHeading >Uluru</h2>"+ 
"<div id= bodyContent >"+ 
"<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large " + 
"sandstone rock formation in the southern part of the "+ 
"Northern Territory, central Australia. It lies 335 km (208 mi) "+ 
"south west of the nearest large town, Alice Springs; 450 km "+ 
"(280 mi) by road. Kata Tjuta and Uluru are the two major "+ 
"features of the Uluru - Kata Tjuta National Park. Uluru is "+ 
"sacred to the Pitjantjatjara and Yankunytjatjara, the "+ 
"Aboriginal people of the area. It has many springs, waterholes, "+ 
"rock caves and ancient paintings. Uluru is listed as a World "+ 
"Heritage Site.</p>"+ 
"<p>Attribution: Uluru, <a href= http://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194 >"+ 
"http://en.wikipedia.org/w/index.php?title=Uluru</a> (last visited June 22, 2009).</p>"+ 
"</div>"+ 
"</div>"; 

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

google.maps.event.addListener(marker, "click", function() { 

infobox.open(map,marker); 
}); 
} 

function codeAddress() { 
var address = document.getElementById("address").value; 
geocoder.geocode({ "address": address}, function(results, status) { 
    if (status == google.maps.GeocoderStatus.OK) { 
    map.setCenter(results[0].geometry.location); 
    map.setZoom(14); 
    var marker = new google.maps.Marker({ 
     map: map, 
     position: results[0].geometry.location 
    }); 
    } else { 
    alert("Geocode was not successful for the following reason: " + status); 
    } 
    }); 
    } 
+0

WEB-страница - [ссылка] (http://www.cka2011.cz/archbook/architektonicka-mapa/) – Adko

ответ

5

Ваш CSS конфликтует с картой:

.entry img, img.thumbnail { 
    background-color: #FFFFFF; 

Вам нужно выключить цвет фона для изображений изображения карты:

#map_canvas img { 
    background-color: transparent; 
    } 

(Ваша страница также стеллажи до ошибки datetime is undefined каждый второй.)

0

Таблица стилей влияет на визуализацию InfoWindow.

Line 285 этого stylesheet:

.entry img, img.thumbnail { padding: 5px; background:#FFF; }

ли каскадные и затрагивающий все элементы, в том числе infowindows. Предложите вам сделать таблицу стилей более конкретной, чтобы она не влияла на все дочерние элементы img.

+0

Спасибо - infowindow теперь отображается правильно – Adko

Смежные вопросы