关于ol-ol,有一个简单的问题。我正在尝试将ol- to集成到我的Vue - Openlayers应用程序中。但是我得到了这种类型的错误:
"ReferenceError:未定义is“
基本上,我试图在点击时激活3d功能,但我被上面的错误卡住了。
我确实使用了示例中提供的代码。
import OLCesium from 'olcs/OLCesium.js';
const ol3d = new OLCesium({map: this.$store.getters.olMap});
ol3d.setEnabled(true);
我使用的是OpenLayers 5.3.0版
发布于 2019-06-17 17:27:47
好了,我已经弄明白了。我只需要在指向an构建的index.html文件中添加脚本标记
示例如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="Vue-OpenLayers" content="Author: Agrivi d.o.o.; Wraping OpenLayers inside Vue.js">
<link rel="icon" href="<%= BASE_URL %>agrivi.ico">
<title>Agrivi Maps</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons">
<script src="https://cesiumjs.org/releases/1.53/Build/Cesium/Cesium.js" charset="UTF-8"></script>
</head>
<body>
<noscript>
<strong>We're sorry but web-app doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
希望它能帮助某些人:)
https://stackoverflow.com/questions/56550165
复制相似问题