Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
tingyuxuan2302 committed Jul 19, 2023
1 parent e24cbe5 commit b977e4e
Show file tree
Hide file tree
Showing 49 changed files with 852 additions and 8,359 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
.prettierrc
.eslintrc.cjs
27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"plugin:vue/vue3-essential",
// 'plugin:prettier/recommended',
"eslint-config-prettier",
],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
requireConfigFile: false,
parser: "@babel/eslint-parser",
},
plugins: ["vue", "prettier"],
rules: {
"vue/multi-word-component-names": 0,
"no-unreachable": 2,
"no-unused-vars": 1,
"no-const-assign": 2,
"no-undef": 2,
},
};
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80, // 一行的字符数,如果超过会进行换行,默认为80
"tabWidth": 2, // 一个tab代表几个空格数,默认为80
"useTabs": false, // 是否使用tab进行缩进,默认为false,表示用空格进行缩减
"singleQuote": true, // 字符串是否使用单引号,默认为false,使用双引号
"semi": false, // 行尾是否使用分号,默认为true
"trailingComma": "none", // 是否使用尾逗号,有三个可选值"<none|es5|all>"
"bracketSpacing": true
}
31 changes: 20 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<!--
* @Description:
* @Author: 笙痞77
* @Date: 2023-05-05 10:09:59
* @LastEditors: 笙痞77
* @LastEditTime: 2023-05-05 10:42:54
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="https://openlayers.org/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Using OpenLayers with Vite</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>

</html>
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@
"serve": "vite preview"
},
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/eslint-parser": "^7.21.8",
"@element-plus/icons-vue": "^2.0.9",
"@vitejs/plugin-vue": "^3.0.3",
"axios": "^0.27.2",
"element-plus": "^2.2.16",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.11.0",
"less": "^4.1.3",
"less-loader": "^11.0.0",
"lodash": "^4.17.21",
"ol-geocoder": "^4.1.2",
"path": "^0.12.7",
"prettier": "^2.8.8",
"proton-engine": "^5.4.5",
"raf-manager": "^0.3.0",
"unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.4",
"vite": "^3.0.7",
"vite-plugin-require-transform": "^1.0.3",
"vue-router": "^4.1.5"
},
"dependencies": {
"ol": "latest",
"three": "^0.152.2",
"vue": "^3.2.38"
}
}
Binary file added public/glTF/DamagedHelmet.bin
Binary file not shown.
204 changes: 204 additions & 0 deletions public/glTF/DamagedHelmet.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5123,
"count" : 46356,
"max" : [
14555
],
"min" : [
0
],
"type" : "SCALAR"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 14556,
"max" : [
0.9424954056739807,
0.8128451108932495,
0.900973916053772
],
"min" : [
-0.9474585652351379,
-1.18715500831604,
-0.9009949564933777
],
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 14556,
"max" : [
1.0,
1.0,
1.0
],
"min" : [
-1.0,
-1.0,
-1.0
],
"type" : "VEC3"
},
{
"bufferView" : 3,
"componentType" : 5126,
"count" : 14556,
"max" : [
0.9999759793281555,
1.998665988445282
],
"min" : [
0.002448640065267682,
1.0005531199858524
],
"type" : "VEC2"
}
],
"asset" : {
"generator" : "Khronos Blender glTF 2.0 exporter",
"version" : "2.0"
},
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 92712,
"byteOffset" : 0,
"target" : 34963
},
{
"buffer" : 0,
"byteLength" : 174672,
"byteOffset" : 92712,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 174672,
"byteOffset" : 267384,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 116448,
"byteOffset" : 442056,
"target" : 34962
}
],
"buffers" : [
{
"byteLength" : 558504,
"uri" : "DamagedHelmet.bin"
}
],
"images" : [
{
"uri" : "Default_albedo.jpg"
},
{
"uri" : "Default_metalRoughness.jpg"
},
{
"uri" : "Default_emissive.jpg"
},
{
"uri" : "Default_AO.jpg"
},
{
"uri" : "Default_normal.jpg"
}
],
"materials" : [
{
"emissiveFactor" : [
1.0,
1.0,
1.0
],
"emissiveTexture" : {
"index" : 2
},
"name" : "Material_MR",
"normalTexture" : {
"index" : 4
},
"occlusionTexture" : {
"index" : 3
},
"pbrMetallicRoughness" : {
"baseColorTexture" : {
"index" : 0
},
"metallicRoughnessTexture" : {
"index" : 1
}
}
}
],
"meshes" : [
{
"name" : "mesh_helmet_LP_13930damagedHelmet",
"primitives" : [
{
"attributes" : {
"NORMAL" : 2,
"POSITION" : 1,
"TEXCOORD_0" : 3
},
"indices" : 0,
"material" : 0
}
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "node_damagedHelmet_-6514",
"rotation" : [
0.7071068286895752,
0.0,
-0.0,
0.7071068286895752
]
}
],
"samplers" : [
{}
],
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0
]
}
],
"textures" : [
{
"sampler" : 0,
"source" : 0
},
{
"sampler" : 0,
"source" : 1
},
{
"sampler" : 0,
"source" : 2
},
{
"sampler" : 0,
"source" : 3
},
{
"sampler" : 0,
"source" : 4
}
]
}
Binary file added public/glTF/Default_AO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/glTF/Default_albedo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/glTF/Default_emissive.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/glTF/Default_metalRoughness.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/glTF/Default_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/panorama.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/wall.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/royal_esplanade_1k.hdr
Binary file not shown.
20 changes: 2 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
# OpenLayers + Vite

This example demonstrates how the `ol` package can be used with [Vite](https://vitejs.dev/).

To get started, run the following (requires Node 14+):

npx create-ol-app my-app --template vite

Then change into your new `my-app` directory and start a development server (available at http://localhost:5173):

cd my-app
npm start

To generate a build ready for production:

npm run build

Then deploy the contents of the `dist` directory to your server. You can also run `npm run serve` to serve the results of the `dist` directory for preview.
# 模板
vite + vue3
25 changes: 8 additions & 17 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
<!--
* @Description:
* @Author: 笙痞77
* @Date: 2023-05-05 10:10:02
* @LastEditors: 笙痞77
* @LastEditTime: 2023-05-05 14:20:00
-->
<script setup>
// import { onMounted } from "vue";
// import { Map, View, Feature, Overlay } from "ol";
// import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer";
// import OSM from "ol/source/OSM";
// import { defaults as defaultControls } from "ol/control";
// import ZoomSlider from "ol/control/ZoomSlider";
// import { fromLonLat, transformExtent } from "ol/proj";
// import Text from "ol/style/Text";
// import { buffer } from "ol/extent";
// import { XYZ, Vector as VectorSource } from "ol/source";
// import { Point, Polygon, LineString, } from "ol/geom";
// import { Style, Icon, Fill, Stroke, Circle as CircleStyle } from "ol/style";
// import Geocoder from "ol-geocoder";
// import Draw from "ol/interaction/Draw";
// import {getArea, getLength} from 'ol/sphere';
// import {unByKey} from 'ol/Observable';

</script>
<template>
<el-container>
<el-aside>
<Menu></Menu>
</el-aside>
<el-container>
<!-- <el-header>Header</el-header> -->
<el-main>
<router-view></router-view>
</el-main>
Expand Down
Loading

0 comments on commit b977e4e

Please sign in to comment.