聚合物谷歌地图 - 绘图形状(Polymer Google Map - Drawing Shapes)
我一直在使用Polymer的谷歌地图一段时间,并对结果非常满意。 最近我遇到了一些用例,在地图上绘制地图标记之间的线条和形状会很有用。 谷歌的这方面的文档非常适用于Maps Javascript API,但经过一些研究后,我无法在Polymer Google Map中找到任何绘图形状的参考,而没有混合使用聚合物和非聚合物Google Map功能。 是否有“纯聚合物”的方式来绘制这些形状?
我还在使用Polymer 1.x,但愿意升级到2.x.
谢谢!
I've been working with Polymer's Google Map for a while now and have been very happy with the results. Recently I've come across a few use cases where it would be useful to draw lines and shapes between map markers on the map. Google's documentation on this is great for the Maps Javascript API, but after doing some research, I haven't been able to find any references to drawing shapes within a Polymer Google Map without mish-mashing Polymer and non-Polymer Google Map functions. Is there a "pure Polymer" way of drawing these shapes?
I'm still using Polymer 1.x but am willing to upgrade to 2.x.
Thank you!
原文:https://stackoverflow.com/questions/43856182
最满意答案
console.log( $('#myDiv').height() )
console.log
是一个函数,所以你需要括号来调用它,作为参数传递你想要在控制台中输出的内容。如果直接直接在控制台中输入,则可以省略
console.log
:$('#myDiv').height()
控制台会自动将最后一个返回值返回到您的屏幕,因此您在使用控制台时无需使用
console.log
。console.log( $('#myDiv').height() )
console.log
is a function so you need parentheses to call it, passing as argument(s) what you want to output in the console.If typing directly into the console directly, you can omit
console.log
:$('#myDiv').height()
The console automatically returns the last return value to your screen so you don't have to
console.log
when using the console.
相关问答
更多-
iOS UIView的动态高度取决于里面的元素数量(iOS UIView with dynamic height depending on number of elements inside)[2022-09-20]
您不需要添加显式高度约束。 您将添加为子视图(图像视图,标签)的视图将具有其自己的内在大小。 只需确保您具有前导,尾随,顶部和底部约束,单元格将自行调整大小。 You don't need to add explicit height constraints. The views you'll add as subviews (image views, labels) will have their own intrinsic size. Just make sure you have leading, t ... -
获取父页面上的视口的高度和宽度(使用iFrame)然后将其传递给iFrame并收集它对我有用。 就像@passionateCoder所说。 Getting the height & width of the viewport on the Parent page (with the iFrame) then passing it to the iFrame and collecting it worked for me. Like @passionateCoder stated.
-
JQuery动态高度问题(JQuery dynamic height issue)[2020-01-05]
这是因为您需要对click事件应用更改。 因此,您可以添加此代码以在每次单击章节时调整视频大小(您可以添加一些延迟以确保获得正确的大小): $('ul.nav-tabs a').click(function() { setTimeout(function() { var vidHeight = $('.video-container').height(); $('.description').css('height', vidHeight + 'px'); }, 500); }); ... -
只需使用flex属性即可: body { display: flex; flex-direction: column; height: 100vh; margin: 0; } .menubar { flex: 0 0 50px; border: 1px solid black; } .main-section { flex: 1; display: flex; flex-direction: column; border: 1px ...
-
如果您想滚动它,请添加一个固定的高度值。 否则,我很困惑你究竟在问什么: #shiftToRight { height: 200px; overflow-y: scroll; } I have fixed the issue by setting position: absolute and setting 'left' dynamically in JavaScript to position itself against the other window. ...
-
我现在就开始工作了。 必须将AnythingSlider的resizeContents选项设置为false,然后上面的脚本执行我想要的操作。 I got it to work now. The resizeContents option of AnythingSlider has to be set to false, then the above script does what I want.
-
由于在将元素添加到文档之前无法可靠地测量元素,因此一种方法是利用绝对定位将元素放在视口之外: jQuery(function($) { var $o = $(".square").clone(true); $o.css("height", "auto").html("Some stuff...
"); $o.css({ position: "absolute", left: "-10000px" }).appendTo("b ... -
console.log( $('#myDiv').height() ) console.log是一个函数,所以你需要括号来调用它,作为参数传递你想要在控制台中输出的内容。 如果直接直接在控制台中输入,则可以省略console.log : $('#myDiv').height() 控制台会自动将最后一个返回值返回到您的屏幕,因此您在使用控制台时无需使用console.log 。 console.log( $('#myDiv').height() ) console.log is a function s ...
-
也许你需要绑定到StackPanel的ActualHeight 。 Maybe you need to bind to ActualHeight of the StackPanel.
-
希望下面你想找的东西。 可能使用flex是完成它的最简单方法。 在这里我尝试了一些jQuery。 $(document).ready(function() { // Cache the highest var highestBox = 0; var loop = 1 // Select and loop the elements you want to equalise $('.child', this).each(function() { if (loop % ...