vaadin google 地图插件:如何向 Vaadin GoogleMap 添加自定义控件
我打算从服务器端将自定义组件(例如对话框、面板、工具栏...)添加到 Vaadin Google 地图插件中。在阅读了 gwt-maps 中的 MapWidget.class 源代码后,我明白我必须为客户端组件扩展 CustomControl (覆盖 Initilize() 函数以返回控件本身)。但在附加组件的VGoogleMap中,除了谷歌地图内置控件之外,我没有看到任何地方可以在地图中放置添加自定义控件的逻辑。我正在扩展 VGoogleMap,但“地图”字段是私有的,因此我无能为力。
谢谢, 张。
I am intending to add custom component (such as dialog, panel, toolbar,...) into Vaadin Google Map add-on from server side. After reading MapWidget.class source code in gwt-maps, I understand that I have to extend CustomControl for client-side component (override Initilize() function to return the control itself). But in VGoogleMap of add-on, I don't see anywhere to put logic of adding custom control in the map except for google map built-in controls. I am extending VGoogleMap, but the 'map' field is private so there is nothing much I can handle.
Thanks,
Chang.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想自定义 Google 地图插件的客户端行为,恐怕您必须下载源代码并更改这些私有字段。 Google 地图插件的设计在客户端的可扩展性不是很好。
如果这听起来很难,您应该考虑在附加组件周围添加服务器端组件是否就足够了。 CustomComponent 应该是一个不错的选择。
If you want to customize the client-side behaviour of the Google Maps add-on, I'm afraid you'll have to download the source and change those private fields. The Google Maps add-on isn't designed to be very extendable on the client side.
If that sounds hard, you should think if adding server-side components around the add-on would suffice. CustomComponent should be a good choice.