我在我的项目中实现了谷歌地图。我已经设置了所有必需的东西。我想知道控制图标不像平移,缩放等那样出现。但是我仍然可以通过点击模糊的形状而不是图片按钮进行缩放。有人可以解决这个问题吗?抱怨我的英语不好
<script src="//maps.google.com/maps?file=api&v=2&key=key"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
var latlng = new GLatLng(<?php echo $lattitude?>, <?php echo $longitude?>);
map.setCenter(latlng, 13);
var iconRed = new GIcon();
iconRed.image = 'http://labs.google.com/ridefinder/images/mm_20_red.png';
iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
iconRed.iconSize = new GSize(12, 20);
iconRed.shadowSize = new GSize(22, 20);
iconRed.iconAnchor = new GPoint(6, 20);
iconRed.infoWindowAnchor = new GPoint(5, 1);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addOverlay(new GMarker(latlng));
var name = "name";
var address = "address";
var type = "bar";
var point = latlng;
var marker = createMarker(point, name, address, iconRed);
map.addOverlay(marker);
}
}
function createMarker(point, name, address, iconRed) {
var marker = new GMarker(point, iconRed);
var html = "<b>" + name + "</b> <br/>" + address;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
return marker;
}