简体   繁体   English

从Google Map删除标题标签属性

[英]Removing title tag attribute from google map

在此处输入图片说明

I want to completely remove the title tag when the user mouseovers on the marker. 当用户将鼠标悬停在标记上时,我想完全删除title标记。 This is what I have tried so far. 到目前为止,这是我尝试过的。

jQuery("[title]").removeAttr("title");
jQuery("*").removeAttr("title");

Neither works. 都不行。

I have referred to the below solutions also. 我也参考了以下解决方案。

removing default mouseover tooltip from marker in google-maps 从Google地图的标记中删除默认的鼠标悬停工具提示

title of a marker of google map marker API 谷歌地图标记API标记的标题

But could not find any solution that actually removes the title tag. 但是找不到任何实际上删除标题标签的解决方案。

I have updated the script set properties: title: ''. 我已经更新了脚本集属性:title:”。

Updated and it worked: http://jsfiddle.net/edf3gwuk/ 已更新且有效: http://jsfiddle.net/edf3gwuk/ : http://jsfiddle.net/edf3gwuk/

 var infowindow = new google.maps.InfoWindow(); function point(lat, long) { var self = this; self.name = name; var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, long), title: '', map: map, draggable: true }); google.maps.event.addListener(marker, 'mouseover', function (e) { e.mb.target.removeAttribute('title') //infowindow.setContent(marker.title); //infowindow.open(map, marker); }.bind(this)); google.maps.event.addListener(marker, 'mouseout', function () { infowindow.close(); }.bind(this)); } var map = new google.maps.Map(document.getElementById('googleMap'), { zoom: 5, center: new google.maps.LatLng(55, 11), mapTypeId: google.maps.MapTypeId.ROADMAP }); new point(58, 14); 
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?key=&sensor=false"></script> <section id="Map"> <div id="googleMap" style="width:350px;height:600px;"></div> </section> 

my solution is set to the content of the label is empty 我的解决方案设置为标签内容为空

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM