|
@@ -1,36 +1,264 @@
|
|
|
-import { myBridge } from './map'
|
|
|
-
|
|
|
+import { myBridge } from './map';
|
|
|
+// import text from '@/utils/map/text.json';
|
|
|
export function invokeParams(ActionName, params) {
|
|
|
- console.log(ActionName, params)
|
|
|
+ console.log(ActionName, params);
|
|
|
myBridge.bridgeContent.Invoke({
|
|
|
ActionName: ActionName,
|
|
|
Parameters: {
|
|
|
...params
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
export function invokeParamsMap(mapId, ActionName, params) {
|
|
|
- console.log(ActionName, params)
|
|
|
- let map = mapId ? 'splitBridgeContent' + mapId : 'bridgeContent'
|
|
|
+ console.log(ActionName, params);
|
|
|
+ let map = mapId ? 'splitBridgeContent' + mapId : 'bridgeContent';
|
|
|
|
|
|
myBridge[map].Invoke({
|
|
|
ActionName: ActionName,
|
|
|
Parameters: {
|
|
|
...params
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
export function addPointSearchFun(mapId) {
|
|
|
invokeParamsMap(mapId, 'MapClickAll', {
|
|
|
status: true,
|
|
|
is_draw: true,
|
|
|
is_code: false
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
export function addPointSearch() {
|
|
|
invokeParams('MapClickAll', {
|
|
|
status: true,
|
|
|
is_draw: true,
|
|
|
is_code: false
|
|
|
- })
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 打点
|
|
|
+ * @param {*} name 打点方法name,关闭时可做标识用
|
|
|
+ * @param {*} param.imageUrl 打点图标,需要使用new URL(``, import.meta.url).href转为链接
|
|
|
+ * @param {*} param.url 数据源接口地址
|
|
|
+ */
|
|
|
+export function addPoint(name) {
|
|
|
+ invokeParams('ShowData', {
|
|
|
+ name: name,
|
|
|
+ data: {
|
|
|
+ url: './Data/area.json',
|
|
|
+ parsedata: 'function(d){return d}',
|
|
|
+ parsegeometry: 'function(item){return {x:Number(item.x),y:Number(item.y)}}'
|
|
|
+ },
|
|
|
+ legendVisible: false,
|
|
|
+ popupEnabled: false,
|
|
|
+ renderer: {
|
|
|
+ type: 'simple',
|
|
|
+ label: '测试车辆',
|
|
|
+ visualVariables: [],
|
|
|
+ symbol: {
|
|
|
+ type: 'simple-marker',
|
|
|
+ size: 30,
|
|
|
+ color: 'rgba(0,128,255,0.4)',
|
|
|
+ outline: {
|
|
|
+ width: 0.5,
|
|
|
+ color: '#0080FF'
|
|
|
+ }
|
|
|
+ // type: 'picture-marker',
|
|
|
+ // url: new URL(`@/assets/image/mapTools/2.png`, import.meta.url).href,
|
|
|
+ // width: '64px',
|
|
|
+ // height: '64px'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: [
|
|
|
+ {
|
|
|
+ fields: ['#.size'],
|
|
|
+ color: [255, 255, 255, 1],
|
|
|
+ size: 15,
|
|
|
+ labelPlacement: 'center-center'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 带图标打点
|
|
|
+ * @param {*} name 打点方法name,关闭时可做标识用
|
|
|
+ * @param {*} param.imageUrl 打点图标,需要使用new URL(``, import.meta.url).href转为链接
|
|
|
+ * @param {*} param.url 数据源接口地址
|
|
|
+ */
|
|
|
+export function addImagePoint(name, params) {
|
|
|
+ invokeParams('ShowData', {
|
|
|
+ name: name,
|
|
|
+ data: {
|
|
|
+ url: new URL(`@/utils/map/test.json`, import.meta.url).href,
|
|
|
+ parsedata: 'function(d){return d}',
|
|
|
+ parsegeometry: 'function(item){return {x:Number(item.x),y:Number(item.y)}}'
|
|
|
+ },
|
|
|
+ legendVisible: false,
|
|
|
+ popupEnabled: false,
|
|
|
+ renderer: {
|
|
|
+ type: 'simple',
|
|
|
+ label: '测试车辆',
|
|
|
+ visualVariables: [],
|
|
|
+ symbol: {
|
|
|
+ type: 'picture-marker',
|
|
|
+ url: params.imageUrl,
|
|
|
+ width: '56px',
|
|
|
+ height: '56px'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labels: [
|
|
|
+ {
|
|
|
+ fields: ['#.size'],
|
|
|
+ color: [255, 255, 255, 1],
|
|
|
+ size: 15,
|
|
|
+ labelPlacement: 'center-center'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//电线面隐藏
|
|
|
+export function closePoint(name) {
|
|
|
+ invokeParams('ShowData', {
|
|
|
+ name: name,
|
|
|
+ mode: 'visible',
|
|
|
+ visible: false
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//轨迹
|
|
|
+export function addTrajectory() {
|
|
|
+ invokeParams('ShowData', {
|
|
|
+ name: 'car_layer1',
|
|
|
+ type: 'track',
|
|
|
+ isLocate: true,
|
|
|
+ data: {
|
|
|
+ isComputingRote: false,
|
|
|
+ url: './Data/1212/GPS模拟数据.json',
|
|
|
+ parsedata: 'function(d){return d.data}',
|
|
|
+ parsegeometry: 'function(item){return {x:Number(item.X),y:Number(item.Y)}}'
|
|
|
+ },
|
|
|
+ legendVisible: true,
|
|
|
+ popupEnabled: true,
|
|
|
+ renderer: {
|
|
|
+ type: 'unique-value',
|
|
|
+ uniqueValueInfos: [
|
|
|
+ {
|
|
|
+ value: 'line',
|
|
|
+ symbol: {
|
|
|
+ type: 'line-3d',
|
|
|
+ symbolLayers: [
|
|
|
+ {
|
|
|
+ type: 'line',
|
|
|
+ size: 2,
|
|
|
+ material: {
|
|
|
+ color: 'black'
|
|
|
+ },
|
|
|
+ cap: 'round',
|
|
|
+ join: 'round'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'start',
|
|
|
+ symbol: {
|
|
|
+ type: 'simple-marker',
|
|
|
+ size: 20,
|
|
|
+ color: 'red',
|
|
|
+ outline: {
|
|
|
+ width: 0.5,
|
|
|
+ color: 'white'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'end',
|
|
|
+ symbol: {
|
|
|
+ type: 'simple-marker',
|
|
|
+ size: 20,
|
|
|
+ color: 'orange',
|
|
|
+ outline: {
|
|
|
+ width: 0.5,
|
|
|
+ color: 'white'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//轨迹播放
|
|
|
+export function playTrajectory() {
|
|
|
+ invokeParams('ShowData', {
|
|
|
+ name: 'car_layer1',
|
|
|
+ mode: 'player',
|
|
|
+ action: 'play',
|
|
|
+ speed: 20,
|
|
|
+ showline: true,
|
|
|
+ renderer: {
|
|
|
+ type: 'unique-value',
|
|
|
+ uniqueValueInfos: [
|
|
|
+ {
|
|
|
+ value: 'line',
|
|
|
+ symbol: {
|
|
|
+ type: 'line-3d',
|
|
|
+ symbolLayers: [
|
|
|
+ {
|
|
|
+ type: 'line',
|
|
|
+ size: 2,
|
|
|
+ material: {
|
|
|
+ color: 'green'
|
|
|
+ },
|
|
|
+ cap: 'round',
|
|
|
+ join: 'round'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'flowlabel',
|
|
|
+ symbol: {
|
|
|
+ type: 'text',
|
|
|
+ color: 'black',
|
|
|
+ text: '{{FID}}\r\n{{DATETIME}}\r\n\r\n',
|
|
|
+ font: {
|
|
|
+ size: 10,
|
|
|
+ weight: 'bold'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'marker',
|
|
|
+ symbol: {
|
|
|
+ type: 'simple-marker',
|
|
|
+ size: 20,
|
|
|
+ color: 'red',
|
|
|
+ outline: {
|
|
|
+ width: 0.5,
|
|
|
+ color: 'white'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//标会
|
|
|
+export function startBidding(visible = true) {
|
|
|
+ invokeParams('userSketch', {
|
|
|
+ type: 'point',
|
|
|
+ visible: visible,
|
|
|
+ isTools: true,
|
|
|
+ position: 'top-right',
|
|
|
+ activeSymbol: {
|
|
|
+ type: 'picture-marker',
|
|
|
+ url: new URL(`@/assets/image/bidding.png`, import.meta.url).href,
|
|
|
+ width: '24px',
|
|
|
+ height: '24px'
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|