admin管理员组文章数量:1426040
I have a web application written in javascript which uses the google maps api to map certain features. However, I am having some unwanted results when users with touchscreen puters try to use the map.
Specifically, I would like to get rid of the warning that tell users "use two fingers to move the map". Similiar to this picture (.jpg)
The issue is due to the fact that when I take "screenshots" of the map (with html2canvas), the warning displays over the map and blocks the image. I think the easiest thing to do might be to disable that warning, but I can't find any documentation on how to do that.
Please let me know if it would help to include any codes or links.
I have a web application written in javascript which uses the google maps api to map certain features. However, I am having some unwanted results when users with touchscreen puters try to use the map.
Specifically, I would like to get rid of the warning that tell users "use two fingers to move the map". Similiar to this picture (https://reyner.id/wp-content/uploads/Embedded%20Google%20Map%20Mobile%20Function.jpg)
The issue is due to the fact that when I take "screenshots" of the map (with html2canvas), the warning displays over the map and blocks the image. I think the easiest thing to do might be to disable that warning, but I can't find any documentation on how to do that.
Please let me know if it would help to include any codes or links.
Share Improve this question asked Mar 14, 2017 at 2:40 zack pecenakzack pecenak 231 silver badge4 bronze badges2 Answers
Reset to default 3you could use CSS to hide the message,
.gm-style-pbc{
display: none !important
}
I know the question was answered, but for future visitors, I would like to offer a more plete answer, building on the one provided by @Sudhir_Bastakoti:
$('#map-canvas').click(function() {
setTimeout(function() {stopTwoFingerWarning(); }, 2500);
});
function stopTwoFingerWarning() {
$('.gm-style-pbc').hide();
$('.gm-style-pbc').css('display', 'none!important');
}
The above functions will let the visitor see the warning on the first instance, but hide it after 2.5 seconds. Otherwise, how is a visitor to ever receive the instructions to begin with? They will not know how to use the map, and get frustrated.
I chose 2.5 to allow for the message to sink in, but set as you like.
本文标签: Remove quotuse two fingersquot warning on google maps with javascriptStack Overflow
版权声明:本文标题:Remove "use two fingers..." warning on google maps with javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745410107a2657424.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论