Google Maps API v.3.22のinfoWindow、いわゆるふきだしの閉じるボタンを取ってみました
公式のリファレンスを見ても、設定がなさそう..
Google Maps JavaScript API V3 Reference | Google Maps JavaScript API | Google Developers
cssでボタンを消して、文字の位置を調整してみました
追加でCSSを
.gm-style-iw {
margin-left: 10px;
}
.gm-style-iw + div {
display: none;
}
これでこんな感じに
ソース全部はこんな感じです
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=1.0" />
<title>google map</title>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
/* hide close button on infoWindow */
.gm-style-iw {
margin-left: 10px;
}
.gm-style-iw + div {
display: none;
}
</style>
</head>
<body>
<div id="map_canvas"></div>
<script type="text/javascript">
function initMap() {
var point = {lat: -24.363, lng: 130.044};
var map = new google.maps.Map(document.getElementById('map_canvas'), {
center: point,
scrollwheel: true,
zoom: 8
});
marker = new google.maps.Marker({
position: point,
map: map,
label: 'A'
});
info = new google.maps.InfoWindow({
content: 'No.1'
});
info.open(map, marker);
}
</script>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCj58ghahiTjKQ25OlCI5TfFEsntAahMFM&callback=initMap">
</script>
</body>
</html>
参考:
GMaps V3 InfoWindow – disable the close “x” button-open source projects hpneo/gmaps