uniapp 整合 openlayers 加载 天地图、geojson、wms、wfs、TMS数据

let layer=null;
				if (data.status == 0) {
					// 判断数据类型是否为天地图
					if (data.target == "tiandidu") { 
					  // 创建图层
						layer = new TileLayer({
							name: data.name,
							id:data.serverid,
							visible: false,
							source: new XYZ({
							  url: data.url,
							}),
					  });
					}else if(data.target == "geojson"){
						// 创建 VectorLayer 用于加载 GeoJSON
						layer =  new VectorLayer({
						  source: new VectorSource({
							url: data.url, // 替换为您的 GeoJSON 服务 URL
							format: new GeoJSON(),
						  }),
						  id:data.serverid,
						  style: new Style({
							fill: new Fill({
							  color: '#ff00ff',
							}),
							// 样式-边框
							stroke: new Stroke({
							  color: '#6600ff',
							  width: 2,
							}),
							// 使用 CircleStyle 创建一个圆形的点
							image:new CircleStyle({
								// 点样式
								fill:new Fill({
									color: 'rgba(255,0,0,0.4)',
								}),
								// 点周边样式
								stroke:new Stroke({
									color: '#3399CC',
									
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值