2023
01-13
01-13
基于Vue+Openlayer实现动态加载geojson的方法
加载1个或多个要素<template><divid="map"style="width:100vw;height:100vh"></div></template><script>import"ol/ol.css";importTileLayerfrom"ol/layer/Tile";importVectorLayerfrom"ol/layer/Vector";importVectorSourcefrom"ol/source/Vector";importXYZfrom"ol/source/XYZ";import{Map,View,Feature,ol}from"ol";import{Style,Stroke,Fill}from"ol/style";import{Polygon,MultiPolygon...
继续阅读 >
注意:实现动画时不能有scoped!!!! 通过gif<template><divclass="test"><divid="map"ref="map"style="width:100vw;height:100vh"></div></div></template><script>import"ol/ol.css";import{Map,View,Overlay}from"ol";importTileLayerfrom"ol/layer/Tile";importOSMfrom"ol/source/OSM";exportdefault{name:"gif",data(){return{map:{},overlay:{},mar...