简体   繁体   English

在Bing Map v7中重新定位信息框的问题

[英]Issue in infobox repositioning in Bing map v7

I am using the Bing map version 7 for the displaying the events and its details on map. 我正在使用Bing地图版本7在地图上显示事件及其详细信息。 For that i have added the following reference js file " http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=de " 为此,我添加了以下参考js文件“ http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=de

I have implemented the displaying the event pin on map and displaying the event details in infobox. 我已经实现了在地图上显示事件图钉并在信息框中显示事件详细信息。 I am stuck up with displaying event details in infobox which are on the boundary of the map. 我一直坚持在地图边界的信息框中显示事件详细信息。 This infobox goes outside the map. 该信息框位于地图之外。

I have found on solution in the post Cool Infobox and plot polygons through xml ....in bing maps , pure javascript 我在帖子Cool Infobox中找到了解决方案, 并通过bing ...通过纯XML通过xml ....绘制了多边形

But even after implementing the solution mentioned(CustomInfoboxModule) in above link, i am facing the issue for the events having more details. 但是即使在实现以上链接中提到的解决方案(CustomInfoboxModule)之后,我也面临着事件的更多细节的问题。

Check for the 检查 在此处输入图片说明

Not 100% sure if I understand the question. 不能100%确定我是否理解这个问题。 Is your issue that the infobox falls outside of the map? 您的问题是信息框不在地图之外吗? If so, if you make your Infobox big enough this is bound to happen. 如果是这样,那么如果您将Infobox设置得足够大,那么这势必会发生。 There are a couple of solutions: 有两种解决方案:

  1. Limit the size of your description area (ie give it a max-height) and make it scrollable (ie overflow-y: auto). 限制您的描述区域的大小(即,给它一个最大高度)并使其可滚动(即,溢出-y:自动)。 This will ensure that your infobox never exceeds a certain height. 这将确保您的信息框不会超过特定高度。 The custom infobox control you are using, positions the infobox based on which quadrant the pushpin is in. If the pushpin is in the top left corner the infobox is shown to the right and down. 您正在使用的自定义信息框控件根据图钉所在的象限来定位信息框。如果图钉位于左上角,则信息框将在右侧和下方显示。 If the pushpin is in the bottom right corner the infobox is shown to the left and up. 如果图钉位于右下角,则信息框将显示在左侧和上方。 This means that if you ensure that the max height of the infobox is half the height of the map, that it should always be displayed within the map. 这意味着,如果您确保信息框的最大高度是地图高度的一半,则应始终在地图中显示该信息框。
  2. Alternatively, if you know the infobox will never be bigger than the height of the map, you could simply reposition the map so that the pushpin is higher and then open the infobox. 或者,如果您知道信息框永远不会大于地图的高度,则可以简单地重新放置地图,使图钉更高,然后打开信息框。

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

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