赞
踩
import KML from 'ol/format/KML';
import Map from 'ol/Map.js';
import View from 'ol/View.js';
import VectorLayer from 'ol/layer/Vector'
import TileLayer from 'ol/layer/Tile';
import {
Circle as CircleStyle, Fill, Stroke, Style} from 'ol/style.js';
var kmlsource = new Vector({ url:url, format:new KML({ extractStyles:false }) }); var kmlfinal = new VectorLayer({ source:kmlsource, }); var veclayer = new TileLayer({ name: "天地图矢量图层", source: new XYZ({ url: "http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=天地图密钥" , wrapX: false }), opacity:0.9 });
之后需要修改kml图的显示风格,所以需要将extractStyle设置为false。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。