您的位置:首页 > 运维架构

openlayer拖动范围设定

2016-01-11 16:17 281 查看
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范围一直就解决了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: