我试图了解 fitBounds() 方法的填充选项究竟做了什么。
map.fitBounds(bounds, 100);
Run Code Online (Sandbox Code Playgroud)
根据此处的文档,据说 100 的选项会添加填充(至少我是这么读的):https : //developers.google.com/maps/documentation/javascript/reference
但是我添加了各种数字并且似乎没有得到任何东西(在我的使用项目中),除非它以 100 为增量,这太多了。我设置了一个 JS 小提琴来显示这里填充选项的功能:http : //fiddle.jshell.net/sc9bc4ab/
它们似乎每个实现都不同,但是一旦你达到某个数值,它们就会有相同的“跳跃”问题。
我的问题是填充选项实际上有什么作用?看起来很不一致。如果它是 10 或 20 或 30 小提琴它似乎保持不变,当你击中 40 东西跳。我也尝试过{padding:50}或{padding:[50,50]}只是没有很多关于这个特定问题的信息。
我看到了HTL的不同用法 data-sly-use
我以这种方式看到它:
<sly data-sly-use.example="com.example.aem.HellowWorldModel">
<!--/* all code here */-->
</sly>
Run Code Online (Sandbox Code Playgroud)
我以这种方式看到了自我关闭:
<sly data-sly-use.example="com.example.aem.HellowWorldModel" />
<!--/* All code after */-->
Run Code Online (Sandbox Code Playgroud)
为什么每种方式都被使用,最好的方式是什么?