From b39290a3bc3bb1d8cf80ff44fb07fd089092dc0f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 21 Apr 2021 20:35:43 +0800
Subject: [PATCH] 实时警情,包裹,违禁品,体温,健康码页面清空按钮,清空this.$route.query内容

---
 public/map/core/utils/GeometryUtil.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/public/map/core/utils/GeometryUtil.js b/public/map/core/utils/GeometryUtil.js
new file mode 100644
index 0000000..f1fa644
--- /dev/null
+++ b/public/map/core/utils/GeometryUtil.js
@@ -0,0 +1,25 @@
+define([],
+   function(){
+    return {
+    	getCenter:function(geometry)
+    	{
+    		var mapPoint=null;
+			switch(geometry.type)
+			{
+				case "point":
+					mapPoint=geometry;
+					break;
+				case "polygon":
+					mapPoint=geometry.getCentroid();
+					break;
+				case "polyline":
+					mapPoint=geometry.getExtent().getCenter();
+					break;
+				default:
+					mapPoint=geometry.getExtent().getCenter();
+					break;
+			}
+			return mapPoint;
+    	}
+    };
+});

--
Gitblit v1.9.3