@uiw/react-amap-marker
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -29,4 +29,4 @@ "use strict"; | ||
Portal = _usePortal.Portal; | ||
(0, _react.useEffect)(function () { | ||
if (!marker && map) { | ||
(0, _react.useLayoutEffect)(function () { | ||
if (map && !marker) { | ||
if (props.children) { | ||
@@ -38,12 +38,12 @@ other.content = container; | ||
setMarker(instance); | ||
return function () { | ||
if (instance) { | ||
// @fix [244] https://github.com/uiwjs/react-amap/issues/244 | ||
// typeof marker.remove === 'function' && marker.remove(); | ||
instance.setMap(null); | ||
setMarker(undefined); | ||
} | ||
}; | ||
} | ||
return function () { | ||
if (marker) { | ||
// @fix [244] https://github.com/uiwjs/react-amap/issues/244 | ||
// typeof marker.remove === 'function' && marker.remove(); | ||
marker.setMap(null); | ||
setMarker(undefined); | ||
} | ||
}; | ||
}, [map, marker]); | ||
}, [map]); | ||
(0, _reactAmapUtils.useVisiable)(marker, visiable); | ||
@@ -50,0 +50,0 @@ (0, _reactAmapUtils.useSettingProperties)(marker, props, ['Path', 'Anchor', 'Offset', 'Animation', 'Clickable', 'Position', 'Angle', 'Label', 'zIndex', 'Icon', 'Draggable', 'Cursor', 'Content', 'Map', 'Title', 'Top', 'Shadow', 'Shape', 'ExtData']); |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
var _excluded = ["visiable", "children"]; | ||
import { useState, useEffect } from 'react'; | ||
import { useState, useLayoutEffect } from 'react'; | ||
import { useVisiable, useEventProperties, useSettingProperties, usePortal } from '@uiw/react-amap-utils'; | ||
@@ -23,4 +23,4 @@ import { useMapContext } from '@uiw/react-amap-map'; | ||
} = usePortal(); | ||
useEffect(() => { | ||
if (!marker && map) { | ||
useLayoutEffect(() => { | ||
if (map && !marker) { | ||
if (props.children) { | ||
@@ -32,12 +32,12 @@ other.content = container; | ||
setMarker(instance); | ||
return () => { | ||
if (instance) { | ||
// @fix [244] https://github.com/uiwjs/react-amap/issues/244 | ||
// typeof marker.remove === 'function' && marker.remove(); | ||
instance.setMap(null); | ||
setMarker(undefined); | ||
} | ||
}; | ||
} | ||
return () => { | ||
if (marker) { | ||
// @fix [244] https://github.com/uiwjs/react-amap/issues/244 | ||
// typeof marker.remove === 'function' && marker.remove(); | ||
marker.setMap(null); | ||
setMarker(undefined); | ||
} | ||
}; | ||
}, [map, marker]); | ||
}, [map]); | ||
useVisiable(marker, visiable); | ||
@@ -44,0 +44,0 @@ useSettingProperties(marker, props, ['Path', 'Anchor', 'Offset', 'Animation', 'Clickable', 'Position', 'Angle', 'Label', 'zIndex', 'Icon', 'Draggable', 'Cursor', 'Content', 'Map', 'Title', 'Top', 'Shadow', 'Shape', 'ExtData']); |
{ | ||
"name": "@uiw/react-amap-marker", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "点标记是用来标示某个位置点信息的一种地图要素,本章介绍如何在地图图面使用点标记。", | ||
@@ -38,4 +38,4 @@ "funding": "https://jaywcjlove.github.io/#/sponsor", | ||
"dependencies": { | ||
"@uiw/react-amap-map": "6.0.0", | ||
"@uiw/react-amap-utils": "6.0.0" | ||
"@uiw/react-amap-map": "6.0.1", | ||
"@uiw/react-amap-utils": "6.0.1" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
25023
+ Added@uiw/react-amap-map@6.0.1(transitive)
+ Added@uiw/react-amap-types@6.0.1(transitive)
+ Added@uiw/react-amap-utils@6.0.1(transitive)
- Removed@uiw/react-amap-map@6.0.0(transitive)
- Removed@uiw/react-amap-types@6.0.0(transitive)
- Removed@uiw/react-amap-utils@6.0.0(transitive)
Updated@uiw/react-amap-map@6.0.1
Updated@uiw/react-amap-utils@6.0.1