Skip to content

Commit

Permalink
v5.0.9 fix(Polygon): fix component uninstall issue. 59dca1d
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 22, 2023
1 parent 9b090c5 commit ebf7fc0
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 57 deletions.
56 changes: 28 additions & 28 deletions amap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,23 +1822,23 @@ var usePolygon = function usePolygon(props) {
var instance = new AMap.Polygon(_extends({}, other));
map.add(instance);
setPolygon(instance);
return () => {
if (instance) {
try {
map && map.remove(instance);
} catch (e) {}
// if (AMap.v) {
// map && map.remove(instance);
// } else {
// // 暂不使用这个 API,这个不兼容 v1.4.xx,改用 map.remove API
// map && map.removeLayer(instance);
// }
}

setPolygon(undefined);
};
}
}, [map]);
return () => {
if (polygon) {
try {
map && map.remove(polygon);
} catch (e) {}
// if (AMap.v) {
// map && map.remove(instance);
// } else {
// // 暂不使用这个 API,这个不兼容 v1.4.xx,改用 map.remove API
// map && map.removeLayer(instance);
// }
}

setPolygon(undefined);
};
}, [map, polygon]);
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
if (polygon) {
polygon.setOptions(other);
Expand Down Expand Up @@ -1998,19 +1998,19 @@ function usePolyline(props) {
var instance = new AMap.Polyline(other);
map.add(instance);
setPolyline(instance);
return () => {
if (instance) {
if (AMap.v) {
map && map.remove(instance);
} else {
// 暂不使用这个 API,这个不兼容 v1.4.xx,改用 map.remove API
map && map.removeLayer(instance);
}
setPolyline(undefined);
}
};
}
}, [map]);
return () => {
if (polyline) {
if (AMap.v) {
map && map.remove(polyline);
} else {
// 暂不使用这个 API,这个不兼容 v1.4.xx,改用 map.remove API
map && map.removeLayer(polyline);
}
setPolyline(undefined);
}
};
}, [map, polyline]);
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
if (polyline) {
polyline.setOptions(other);
Expand Down
2 changes: 1 addition & 1 deletion amap.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/react-amap/static/css/main.bcb671be.css",
"main.js": "/react-amap/static/js/main.bbd0dd67.js",
"main.js": "/react-amap/static/js/main.7a71e963.js",
"static/css/7365.bf0e21c2.chunk.css": "/react-amap/static/css/7365.bf0e21c2.chunk.css",
"static/js/7365.f4a91d19.chunk.js": "/react-amap/static/js/7365.f4a91d19.chunk.js",
"static/css/3034.bf0e21c2.chunk.css": "/react-amap/static/css/3034.bf0e21c2.chunk.css",
Expand Down Expand Up @@ -99,13 +99,13 @@
"parse5-vendor.js": "/react-amap/static/js/parse5-vendor.ffd5b4fb.chunk.js",
"micromark-vendor.js": "/react-amap/static/js/micromark-vendor.73df6cf1.chunk.js",
"react-vendor.js": "/react-amap/static/js/react-vendor.69b94a96.js",
"static/js/658.9e987835.chunk.js": "/react-amap/static/js/658.9e987835.chunk.js",
"static/js/8665.c974ce09.js": "/react-amap/static/js/8665.c974ce09.js",
"static/js/5775.b3985d06.chunk.js": "/react-amap/static/js/5775.b3985d06.chunk.js",
"static/js/658.c11486f0.chunk.js": "/react-amap/static/js/658.c11486f0.chunk.js",
"static/js/8665.dc3cf6f2.js": "/react-amap/static/js/8665.dc3cf6f2.js",
"static/js/5775.a964eda4.chunk.js": "/react-amap/static/js/5775.a964eda4.chunk.js",
"static/media/logo.svg": "/react-amap/static/media/logo.552138f67b47aa2ff9779e6ffc2abeed.svg",
"index.html": "/react-amap/index.html",
"main.bcb671be.css.map": "/react-amap/static/css/main.bcb671be.css.map",
"main.bbd0dd67.js.map": "/react-amap/static/js/main.bbd0dd67.js.map",
"main.7a71e963.js.map": "/react-amap/static/js/main.7a71e963.js.map",
"7365.bf0e21c2.chunk.css.map": "/react-amap/static/css/7365.bf0e21c2.chunk.css.map",
"7365.f4a91d19.chunk.js.map": "/react-amap/static/js/7365.f4a91d19.chunk.js.map",
"3034.bf0e21c2.chunk.css.map": "/react-amap/static/css/3034.bf0e21c2.chunk.css.map",
Expand Down Expand Up @@ -203,14 +203,14 @@
"parse5-vendor.ffd5b4fb.chunk.js.map": "/react-amap/static/js/parse5-vendor.ffd5b4fb.chunk.js.map",
"micromark-vendor.73df6cf1.chunk.js.map": "/react-amap/static/js/micromark-vendor.73df6cf1.chunk.js.map",
"react-vendor.69b94a96.js.map": "/react-amap/static/js/react-vendor.69b94a96.js.map",
"658.9e987835.chunk.js.map": "/react-amap/static/js/658.9e987835.chunk.js.map",
"8665.c974ce09.js.map": "/react-amap/static/js/8665.c974ce09.js.map",
"5775.b3985d06.chunk.js.map": "/react-amap/static/js/5775.b3985d06.chunk.js.map"
"658.c11486f0.chunk.js.map": "/react-amap/static/js/658.c11486f0.chunk.js.map",
"8665.dc3cf6f2.js.map": "/react-amap/static/js/8665.dc3cf6f2.js.map",
"5775.a964eda4.chunk.js.map": "/react-amap/static/js/5775.a964eda4.chunk.js.map"
},
"entrypoints": [
"static/js/react-vendor.69b94a96.js",
"static/js/8665.c974ce09.js",
"static/js/8665.dc3cf6f2.js",
"static/css/main.bcb671be.css",
"static/js/main.bbd0dd67.js"
"static/js/main.7a71e963.js"
]
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>React AMap - 高德地图 React 组件</title><meta name="keywords" content="react,component,amap,高德地图,地图,高德"/><meta name="description" content="这是一个基于 React 封装的高德地图组件,帮助你轻松的接入地图到 React 项目中。"/><link href="favicon.ico" rel="shortcut icon"><script defer="defer" src="./static/js/react-vendor.69b94a96.js"></script><script defer="defer" src="./static/js/8665.c974ce09.js"></script><script defer="defer" src="./static/js/main.bbd0dd67.js"></script><link href="./static/css/main.bcb671be.css" rel="stylesheet"></head><body><img src="logo.svg" style="display:none" alt="React amap logo - 高德地图 React 组件"/><div style="display:block" id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>React AMap - 高德地图 React 组件</title><meta name="keywords" content="react,component,amap,高德地图,地图,高德"/><meta name="description" content="这是一个基于 React 封装的高德地图组件,帮助你轻松的接入地图到 React 项目中。"/><link href="favicon.ico" rel="shortcut icon"><script defer="defer" src="./static/js/react-vendor.69b94a96.js"></script><script defer="defer" src="./static/js/8665.dc3cf6f2.js"></script><script defer="defer" src="./static/js/main.7a71e963.js"></script><link href="./static/css/main.bcb671be.css" rel="stylesheet"></head><body><img src="logo.svg" style="display:none" alt="React amap logo - 高德地图 React 组件"/><div style="display:block" id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/js/5775.a964eda4.chunk.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion static/js/5775.b3985d06.chunk.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions static/js/658.9e987835.chunk.js

This file was deleted.

3 changes: 3 additions & 0 deletions static/js/658.c11486f0.chunk.js

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions static/js/8665.c974ce09.js

This file was deleted.

1 change: 0 additions & 1 deletion static/js/8665.c974ce09.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions static/js/8665.dc3cf6f2.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

/**
* @remix-run/router v1.7.2
* @remix-run/router v1.8.0
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -20,7 +20,7 @@
*/

/**
* React Router DOM v6.14.2
* React Router DOM v6.15.0
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -31,7 +31,7 @@
*/

/**
* React Router v6.14.2
* React Router v6.15.0
*
* Copyright (c) Remix Software Inc.
*
Expand Down
1 change: 1 addition & 0 deletions static/js/8665.dc3cf6f2.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions static/js/main.bbd0dd67.js → static/js/main.7a71e963.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit ebf7fc0

Please sign in to comment.