내 코드 데모는 다음과 같습니다. jsfiddleinfoWindow를 커스텀 마커의 맨 위에 올리려면 어떻게해야합니까?
Google 마커 대신 사용할 맞춤 마커를 만들었습니다. 그런 다음 표시된 위치의 주소가 포함 된 infoWindow를 표시하려고합니다. 그러나 infoWindow는 항상 사용자 정의 마커와 같은 위치를 가리 킵니다. 내가 맞춤 마커 (예 : this demo) 상단에 있기를 원합니다. 읽어 주셔서 감사합니다.
HTML :
<script src="http://maps.google.com/maps/api/js?libraries=places®ion=uk&language=en&sensor=true"></script>
<div id="map_canvas" style="height: 350px;width: 500px;margin: 0.6em;"></div>
CSS :
.customMarker {
position: absolute;
cursor: pointer;
background: #9acfea;
width: 100px;
height: 100px;
margin-left: -50px;
margin-top: -110px;
border-radius: 10px;
padding: 0;
}
.customMarker:after {
content: "";
position: absolute;
bottom: -10px;
left: 40px;
border-width: 10px 10px 0;
border-style: solid;
border-color: #9acfea transparent;
display: block;
width: 0;
}
.friendsCustomMarker {
position: absolute;
cursor: pointer;
background: #f57977;
width: 100px;
height: 100px;
margin-left: -50px;
margin-top: -110px;
border-radius: 10px;
padding: 0;
}
.friendsCustomMarker:after {
content: "";
position: absolute;
bottom: -10px;
left: 40px;
border-width: 10px 10px 0;
border-style: solid;
border-color: #f57977 transparent;
display: block;
width: 0;
}
.customMarker img, .friendsCustomMarker img {
width: 90px;
height: 90px;
margin: 5px;
border-radius: 10px
}
JS :