dever 6 anos atrás
pai
commit
af1acd9ebf
2 arquivos alterados com 62 adições e 0 exclusões
  1. 62 0
      assets/lib/map/gaode.js
  2. 0 0
      assets/lib/valid/city.js

+ 62 - 0
assets/lib/map/gaode.js

@@ -0,0 +1,62 @@
+var map = new AMap.Map("container", {
+    resizeEnable: true
+});
+var placeSearch = false;
+var marker = false;
+AMap.service(["AMap.PlaceSearch"], function() {
+    placeSearch = new AMap.PlaceSearch({
+        pageSize: 5,
+        pageIndex: 1,
+        map: map,
+        panel: "panel"
+    });
+});
+
+var clickEventListener = map.on('click', function(e) {
+    var x = e.lnglat.getLng();
+    var y = e.lnglat.getLat();
+    var z = map.getZoom();
+    parent.setMap(x, y, z);
+    setMaker(x, y);
+});
+
+function search(txt) {
+	if (txt.indexOf(',') != -1) {
+		var temp = txt.split(',');
+		txt = temp[0];
+		var x = temp[1];
+		var y = temp[2];
+		setMaker(x, y);
+	}
+	parent.closeMsg();
+    placeSearch.search(txt);
+}
+
+function setMaker(x, y) {
+	if (marker) {
+		marker.setPosition([x, y]); 
+	} else {
+		marker = new AMap.Marker({
+            icon: "https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png",
+            position: [x, y]
+        });
+        marker.setMap(map);
+	}
+}
+
+function showMaker(txt) {
+	if (txt.indexOf(',') != -1) {
+		var temp = txt.split(',');
+		txt = temp[0];
+		var x = temp[1];
+		var y = temp[2];
+		var z = temp[3];
+	} else {
+		return;
+	}
+	map.setZoomAndCenter(z, [x, y]);
+    new AMap.Marker({
+        map: map,
+        position: [x, y]
+    });
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
assets/lib/valid/city.js


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff