build
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
export default class config{
|
||||
static getBaseApiUrl(){
|
||||
return process.env.NODE_ENV === 'development' ? 'http://192.168.1.117:8989' :'http://192.168.1.117:8989';
|
||||
return process.env.NODE_ENV === 'development' ? 'http://192.168.1.117:8989' :'http://172.16.2.3:8989';
|
||||
}
|
||||
static getImApiUrl(){
|
||||
return process.env.NODE_ENV === 'development' ? 'http://192.168.1.117:28000/v1' :'http://192.168.1.117:28000/v1';
|
||||
return process.env.NODE_ENV === 'development' ? 'http://192.168.1.117:28000/v1' :'http://172.16.2.3:28000/v1';
|
||||
}
|
||||
static getImAppId(){
|
||||
return 10000;
|
||||
|
||||
@@ -41,15 +41,7 @@
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
} ,{
|
||||
"path" : "pages/ol/ol",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "地图",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view id="olMap" class="olMap">
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script module="ol" lang="renderjs">
|
||||
// import "../../static/ol/ol.css";
|
||||
// import data from "@/static/china.json";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
map: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (typeof window.ol === 'function') {
|
||||
this.initAmap()
|
||||
} else {
|
||||
// 动态引入较大类库避免影响页面展示
|
||||
const script = document.createElement('script')
|
||||
script.src = '../../static/ol/ol.js'
|
||||
script.onload = this.initAmap.bind(this)
|
||||
document.head.appendChild(script)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initAmap() {
|
||||
this.map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
target: "olMap",
|
||||
view: new ol.View({
|
||||
zoom: 18,
|
||||
center: [114, 25],
|
||||
projection: "EPSG:4326"
|
||||
})
|
||||
})
|
||||
}
|
||||
<script>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user