Skip to content

Commit

Permalink
Merge branch 'webmap3.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiaojiao committed Apr 14, 2024
2 parents 175a71c + bfcb359 commit d49b2cd
Show file tree
Hide file tree
Showing 53 changed files with 5,441 additions and 4,077 deletions.
133 changes: 79 additions & 54 deletions demo/mapboxgl/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,25 @@
<sm-radio-button value="basic-components">基础组件</sm-radio-button>
</sm-radio-group>
<template v-if="componentType === 'map-sub-components'">
<sm-time-slider
v-bind="timePlayer"
style="position:absolute; top:100px;left:200px;z-index:100000"
></sm-time-slider>
<sm-time-line
v-bind="timeLine"
style="position:absolute; top:300px;left:200px;z-index:100000"
></sm-time-line>
<sm-time-range
v-bind="timeRange"
style="position:absolute; top:500px;left:200px;z-index:100000"
></sm-time-range>
<!-- <sm-web-map
<sm-web-map
v-if="show"
server-url="http://192.168.11.94:8190/iportal"
map-id="446054158"
:style="{ height: '400px' }"
server-url="http://localhost:8190/iportal"
:map-id="mapIdSelected"
:pan-control="{ show: true, position: 'top-left' }"
@load="mapLoaded"
></sm-web-map>
<sm-web-map
>
<!-- server-url="http://192.168.11.94:8190/iportal"
map-id="446054158" -->
<!-- <sm-web-map
target="map2"
v-if="show"
server-url="http://192.168.11.94:8190/iportal"
map-id="446054158"
:style="{ height: '400px', position:'relative', top: '400px' }"
:pan-control="{ show: true, position: 'top-left' }"
@load="mapLoaded"
></sm-web-map>-->
<!-- <sm-pan />
></sm-web-map> -->
<sm-pan />
<sm-zoom :show-zoom-slider="true" />
<sm-layer-list position="top-right" />
<sm-measure position="top-right" />
Expand Down Expand Up @@ -67,7 +56,6 @@
:address-match="addressMatch"
:rest-map="restMapSearch"
:rest-data="restDataSearch"
:iportal-data="iportalData"
:online-local-search="onlineLocalSearch"
:alwaysCenter="false"
:data="searchData"
Expand All @@ -76,11 +64,38 @@
<sm-tdt-route position="top-left" :data="routeData" />
<sm-tdt-map-switcher position="top-left" :data="mapSwitcherData" />
<sm-mini-map position="bottom-right" />
</sm-web-map>-->
<sm-identify :layers="inputLayers"></sm-identify>
<sm-input v-model="layerNamesInput" @blur="e => inputLayers = e.target.value.split(',')"></sm-input>
</sm-web-map>
</template>

<template v-if="componentType === 'chart-components'">
<sm-border type="border1" style="width: 460px; height: 260px;">
<!-- <div id="beforeMap" style="height: 100vh"></div>
<div id="afterMap" style="height: 100vh"></div> -->
<sm-compare
:beforeMapOptions='{
target: "beforeMap",
serverUrl: "http://localhost:8190/iportal",
mapId: 617580084,
mapOptions: {
center: [-39.9535, 38.0542],
zoom: 2.44
}
}'
:afterMapOptions='{
target: "afterMap",
serverUrl: "http://localhost:8190/iportal",
mapId: 649033069,
mapOptions: {
center: [-39.9535, 38.0542],
zoom: 2.44
}
}'
>
</sm-compare>
<!-- <sm-border type="border1" style="width: 460px; height: 260px;">
<sm-chart
:colorGroup="['red', 'blue']"
:options="echartOption"
Expand All @@ -90,24 +105,11 @@
/>
</sm-border>
<sm-progress strokeColor="red" type="circle" :percent="80" />
<sm-liquid-fill
bordercolor="blue"
waveColor="red"
:value="0.3"
:waveCount="1"
position="bottom-right"
/>
<sm-liquid-fill bordercolor="blue" waveColor="red" :value="0.3" :waveCount="1" position="bottom-right" /> -->
</template>

<template v-if="componentType === 'basic-components'">
<sm-indicator
title="人均收入"
unit=""
indicatorColor="red"
textColor="red"
:num="12323412"
fontSize="18"
/>
<sm-indicator title="人均收入" unit="" indicatorColor="red" textColor="red" :num="12323412" fontSize="18" />
<sm-text
title="文本框"
textColor="red"
Expand Down Expand Up @@ -149,26 +151,18 @@
</sm-select>
<sm-select default-value="lucy" style="width: 200px">
<sm-select-opt-group>
<span slot="label">
<sm-icon type="user" />Manager
</span>
<span slot="label"> <sm-icon type="user" />Manager </span>
<sm-select-option value="jack">Jack</sm-select-option>
<sm-select-option value="lucy">Lucy</sm-select-option>
</sm-select-opt-group>
<sm-select-opt-group label="Engineer">
<sm-select-option value="Yiminghe">yiminghe</sm-select-option>
</sm-select-opt-group>
</sm-select>
<sm-select
mode="multiple"
placeholder="Please select"
:default-value="['a1', 'b2']"
style="width: 200px"
>
<sm-select-option
v-for="i in 25"
:key="(i + 9).toString(36) + i"
>{{ (i + 9).toString(36) + i }}</sm-select-option>
<sm-select mode="multiple" placeholder="Please select" :default-value="['a1', 'b2']" style="width: 200px">
<sm-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">{{
(i + 9).toString(36) + i
}}</sm-select-option>
</sm-select>
</div>

Expand Down Expand Up @@ -236,13 +230,20 @@
<sm-tab-pane key="3" tab="Tab 3">Content of Tab 3</sm-tab-pane>
</sm-tabs>
</div>
<sm-time-slider
v-bind="timePlayer"
style="position:absolute; top:100px;left:200px;z-index:100000"
></sm-time-slider>
<sm-time-line v-bind="timeLine" style="position:absolute; top:300px;left:200px;z-index:100000"></sm-time-line>
<sm-time-range v-bind="timeRange" style="position:absolute; top:500px;left:200px;z-index:100000"></sm-time-range>
</template>

<div class="changeTheme">
<sm-button @click="changeStyle">深色主题</sm-button>
<!-- <sm-button @click="changeStyle">深色主题</sm-button>
<sm-button @click="changeStyle1">浅色主题</sm-button>
<sm-button @click="changeStyle3">暖灰色主题</sm-button>
<sm-button @click="changeStyle2">透明主题</sm-button>
<sm-button @click="changeStyle2">透明主题</sm-button> -->
<sm-select :options="webMapSelection" v-model="mapIdSelected" style="width: 220px"></sm-select>
</div>
</div>
</template>
Expand All @@ -254,7 +255,31 @@ import data from './data/data.js';
var host = 'http://support.supermap.com.cn:8090';
export default Vue.extend({
name: 'App',
mixins: [data] // demo data
mixins: [data], // demo data
data() {
return {
layerNamesInput: '',
inputLayers: [],
webMapSelection: [
{ label: 'raster(png) 图层', value: '617580084'},
{ label: 'raster(webp) 图层', value: '1175084848'},
{ label: 'vector(mvt) 图层', value: '1911445594'},
{ label: 'symbol 图层', value: '769608713'},
{ label: '标记图层', value: '1243732508'},
{ label: '天地图(经纬度)', value: '553036596'},
{ label: '单值专题图-点线', value: '1942263014'},
{ label: '单值专题图-面', value: '1414045798'},
{ label: '分段专题图', value: '1951546125'},
{ label: '热力图', value: '1338195847'},
{ label: 'wmts 图层', value: '1953858999'},
{ label: 'wms 图层', value: '649033069'},
{ label: '3D 拉伸图层', value: '1481406908'},
{ label: '空地图', value: '17311606'},
{ label: '相同source多layer', value: '1703080254'},
],
mapIdSelected: '617580084'
}
}
});
</script>

Expand Down
21 changes: 17 additions & 4 deletions demo/mapboxgl/data/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,25 @@ export default {
title: '直辖市',
children: [
{
title: '上海',
title: 'vector3.0',
mapInfo: {
serverUrl: 'https://www.supermapol.com/',
mapId: 394538195,
serverUrl: 'http://localhost:8190/iportal',
mapId: 1243732508,
layerFilter: function(layer) {
if (layer.id === '未命名数据') {
return true;
}
return false;
}
}
},
{
title: 'raster3.0',
mapInfo: {
serverUrl: 'http://localhost:8190/iportal',
mapId: 649033069,
layerFilter: function(layer) {
if (layer.name === '上海_县级行政区划图@公众数据') {
if (layer.id === 'China_wms130') {
return true;
}
return false;
Expand Down
12 changes: 11 additions & 1 deletion src/common/_lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,17 @@ export default {
title: 'Legend',
top: 'Highest',
bottom: 'Lowest',
noMatchLayer: 'No matching layer'
noMatchLayer: 'No matching layer',
themeDefault: 'Default',
outOfRange: 'Out of range',
style: 'Style',
color: 'Color',
size: 'Size',
opacity: 'Opacity',
width: 'Width',
outlineColor: 'Outline Color',
parentheses: '({tips})',
colon: ':'
},
measure: {
mapMeasure: 'Measure',
Expand Down
15 changes: 12 additions & 3 deletions src/common/_lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export default {
DMS: '度分秒',
Mercator: 'Web墨卡托'
},
error: {
},
error: {},
commontypes: {
restData: 'SuperMap Rest 数据服务',
restMap: 'SuperMap Rest 地图服务',
Expand Down Expand Up @@ -140,7 +139,17 @@ export default {
title: '图例',
top: '最高',
bottom: '最低',
noMatchLayer: '没有匹配的图层'
noMatchLayer: '没有匹配的图层',
themeDefault: '缺省风格',
outOfRange: '范围以外的值',
style: '样式',
color: '颜色',
size: '大小',
opacity: '不透明度',
width: '宽度',
outlineColor: '轮廓色',
parentheses: '({tips})',
colon: ':'
},
measure: {
mapMeasure: '量算',
Expand Down
2 changes: 1 addition & 1 deletion src/common/_mixin/VmUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class VmUpdater extends Vue {
}
let setFun = 'set' + item.replace(item[0], item[0].toUpperCase());
// 子组件的viewModel
this.viewModel && this.viewModel[setFun](newVal);
this.viewModel && this.viewModel[setFun]?.(newVal);
}
},
{ deep: true }
Expand Down
2 changes: 1 addition & 1 deletion src/common/_utils/__tests__/WebMapBase.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('WebMapBase.spec', () => {

it('initWebMap', () => {
const newWebMapBaseObj = cloneDeep(WebMapBaseObj);
newWebMapBaseObj.cleanWebMap = jest.fn();
newWebMapBaseObj.clean = jest.fn();
newWebMapBaseObj._getMapInfo = jest.fn();
newWebMapBaseObj.initWebMap();
expect(newWebMapBaseObj.serverUrl).toBe('123/');
Expand Down
Loading

0 comments on commit d49b2cd

Please sign in to comment.