小编Chr*_*ris的帖子

将绝对定位的DIV添加到OpenLayers Map的底部?

我正在尝试将静态图像图例放置在地图顶部的OpenLayers地图的右下角.我尝试使用绝对定位的DIV,但它往往被其他物体碰撞(即使是高z-index).

有没有办法使用OpenLayers API执行此操作?我注意到OpenMap有一个Layer.ScreenOverlay方法(http://openspace.ordnancesurvey.co.uk/openspace/example7.html),这正是我所需要的,但OpenLayers中我找不到这样的方法.

javascript css openlayers

7
推荐指数
2
解决办法
1万
查看次数

如何在Openlayers中单击地图外部时激活功能+弹出窗口?

我正在重新解析已加载到地图上的KML,类似于此处的示例:http: //openlayers.org/dev/examples/sundials.html并将其转换为可点击列表,将地图置于中心点击,然后显示它的弹出窗口.

这在Google地图中很容易实现,但我找不到任何类似的Openlayers示例.有没有更简单的方法来做到这一点?内置的东西我不见了?

HTML:

<ul id="locationTable">
</ul>
Run Code Online (Sandbox Code Playgroud)

JS:

 htmlRows = "";
 for(var feat in features) {
     // Build details table 
     featId = features[feat].id; // determine the feature ID     
     title = jQuery(f).filter('[name=TITLE]').text();

     htmlRow = "<li><a href="javascript:selectFeature('"+featId+"');\">"+title+"</a></li>";
     htmlRows = htmlRows + htmlRow;
 }
 jQuery('#locationTable').append(htmlRows);
Run Code Online (Sandbox Code Playgroud)

然后为selectFeature函数:

function selectFeature(fid) {
    for(var i = 0; i<kml.features.length;++i) {
                     if (kml.features[i].id == fid)
                         {         
                             selected = new OpenLayers.Control.SelectFeature(kml.features[i]); 
                             selected.clickFeature(); // make call to simulate Click event of feature
                             break;             
                         }
            }

        }
Run Code Online (Sandbox Code Playgroud)

javascript openlayers openstreetmap

6
推荐指数
1
解决办法
2543
查看次数

更多Pythonic方法将一个词典列表合并为一个?

是否有更多的Pythonic方法来做到这一点?我知道一定有.

for form in forms:
   d[form.keys()[0]] = form.values()[0]
Run Code Online (Sandbox Code Playgroud)

谢谢!

python django

2
推荐指数
1
解决办法
1580
查看次数

标签 统计

javascript ×2

openlayers ×2

css ×1

django ×1

openstreetmap ×1

python ×1