var mapOptions = {
projection : new OpenLayers.Projection('EPSG:4326'),
maxExtent : new OpenLayers.Bounds(121.95669802850942,37.302124678674154,122.73295650645256,37.63564806886632),
// maxExtent : new OpenLayers.Bounds(-180, -90, 180, 90),
restrictedExtent:new OpenLayers.Bounds(121.95669802850942,37.302124678674154,122.73295650645256,37.63564806886632),
units : "degrees",// 单位度
controls : []
// 清空控件
};
map = new OpenLayers.Map('map',mapOptions);
问题:在使用openlayer2 图片地图的时候,图片拖动后背景会有空白
解决:
restrictedExtent与maxExtent范围一直就解决了
本文介绍了在使用OpenLayers 2进行图片地图展示时遇到的背景空白问题,并提供了解决方案:通过设置restrictedExtent和maxExtent保持一致来消除拖动后的空白区域。
480

被折叠的 条评论
为什么被折叠?



