在infowindow中添加带onclick事件的按钮

时间:2015-07-08 10:57:11

标签: google-maps

我正在尝试在google map api v3的infowindow中添加带onclick事件的按钮

        var cont = "<div><h4><b>Transformer</b></h4><label>Name: </label>"+this.transformerName.charAt(0).toUpperCase()+this.transformerName.substring(1)+"<br><label>Site No: </label>"+this.siteNo+"<br><label>Substation No: </label>"+this.substationNo+"<br><label>Transformer No: </label>"+this.unitNo+"<br><button onclick='voltagemodel()'>voltagetrend</button></div>";
    console.log(cont);
    infowindow.setContent(cont);

但onclick事件并没有提供帮助

1 个答案:

答案 0 :(得分:0)

尝试

$rotate = imagerotate($source, 90, 0);
$rotatedTmpFile = tempnam('/tmp', 'rotatedThumbnailImage');
imagejpeg($rotate, $rotatedTmpFile ,100);
list($imageWidth, $imageHeight, $imageType) = getimagesize($rotatedTmpFile);
$type = image_type_to_mime_type($imageType);
$data = file_get_contents($rotatedTmpFile);
echo 'data:image/' . $type . ';base64,' . base64_encode($data);
exit;

您错过了 <button onclick='voltagemodel();'>voltagetrend</button>