@uiw/react-amap-marker
Advanced tools
Comparing version 7.0.2 to 7.1.0
import { OverlayProps } from '@uiw/react-amap-map'; | ||
export * from './useMarker'; | ||
export interface MarkerProps extends OverlayProps, AMap.MarkerEvents, AMap.MarkerOptions { | ||
/** @deprecated use `visible` */ | ||
visiable?: boolean; | ||
/** 覆盖物是否可见 */ | ||
visiable?: boolean; | ||
visible?: boolean; | ||
className?: string; | ||
@@ -7,0 +9,0 @@ children?: JSX.Element; |
@@ -7,3 +7,3 @@ import { MarkerProps } from './'; | ||
setMarker: import("react").Dispatch<import("react").SetStateAction<AMap.Marker | undefined>>; | ||
MarkerPortal: ({ children }: import("react").PropsWithChildren) => import("react").ReactPortal; | ||
MarkerPortal: ({ children }: import("react").PropsWithChildren) => import("react").ReactPortal | null; | ||
}; |
@@ -14,6 +14,7 @@ "use strict"; | ||
var _reactAmapMap = require("@uiw/react-amap-map"); | ||
var _excluded = ["visiable", "children"]; | ||
var _excluded = ["visiable", "visible", "children"]; | ||
var useMarker = exports.useMarker = function useMarker() { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var visiable = props.visiable, | ||
visible = props.visible, | ||
children = props.children, | ||
@@ -48,3 +49,3 @@ other = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
}, [map]); | ||
(0, _reactAmapUtils.useVisiable)(marker, visiable); | ||
(0, _reactAmapUtils.useVisiable)(marker, visible !== null && visible !== void 0 ? visible : visiable); | ||
(0, _reactAmapUtils.useSettingProperties)(marker, props, ['Path', 'Anchor', 'Offset', 'Animation', 'Clickable', 'Position', 'Angle', 'Label', 'zIndex', 'Icon', 'Draggable', 'Cursor', 'Content', 'Map', 'Title', 'Top', 'Shadow', 'Shape', 'ExtData']); | ||
@@ -51,0 +52,0 @@ (0, _reactAmapUtils.useEventProperties)(marker, props, ['onClick', 'onDblClick', 'onRightClick', 'onMouseMove', 'onMouseOver', 'onMouseOut', 'onMouseDown', 'onMouseUp', 'onDragStart', 'onDragging', 'onDragEnd', 'onMoving', 'onMoveEnd', 'onMoveAlong', 'onTouchStart', 'onTouchMove', 'onTouchEnd']); |
import { OverlayProps } from '@uiw/react-amap-map'; | ||
export * from './useMarker'; | ||
export interface MarkerProps extends OverlayProps, AMap.MarkerEvents, AMap.MarkerOptions { | ||
/** @deprecated use `visible` */ | ||
visiable?: boolean; | ||
/** 覆盖物是否可见 */ | ||
visiable?: boolean; | ||
visible?: boolean; | ||
className?: string; | ||
@@ -7,0 +9,0 @@ children?: JSX.Element; |
@@ -7,3 +7,3 @@ import { MarkerProps } from './'; | ||
setMarker: import("react").Dispatch<import("react").SetStateAction<AMap.Marker | undefined>>; | ||
MarkerPortal: ({ children }: import("react").PropsWithChildren) => import("react").ReactPortal; | ||
MarkerPortal: ({ children }: import("react").PropsWithChildren) => import("react").ReactPortal | null; | ||
}; |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
var _excluded = ["visiable", "children"]; | ||
var _excluded = ["visiable", "visible", "children"]; | ||
import { useState, useLayoutEffect } from 'react'; | ||
@@ -12,3 +12,4 @@ import { useVisiable, useEventProperties, useSettingProperties, usePortal } from '@uiw/react-amap-utils'; | ||
var { | ||
visiable | ||
visiable, | ||
visible | ||
} = props, | ||
@@ -42,3 +43,3 @@ other = _objectWithoutPropertiesLoose(props, _excluded); | ||
}, [map]); | ||
useVisiable(marker, visiable); | ||
useVisiable(marker, visible != null ? visible : visiable); | ||
useSettingProperties(marker, props, ['Path', 'Anchor', 'Offset', 'Animation', 'Clickable', 'Position', 'Angle', 'Label', 'zIndex', 'Icon', 'Draggable', 'Cursor', 'Content', 'Map', 'Title', 'Top', 'Shadow', 'Shape', 'ExtData']); | ||
@@ -45,0 +46,0 @@ useEventProperties(marker, props, ['onClick', 'onDblClick', 'onRightClick', 'onMouseMove', 'onMouseOver', 'onMouseOut', 'onMouseDown', 'onMouseUp', 'onDragStart', 'onDragging', 'onDragEnd', 'onMoving', 'onMoveEnd', 'onMoveAlong', 'onTouchStart', 'onTouchMove', 'onTouchEnd']); |
{ | ||
"name": "@uiw/react-amap-marker", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"description": "点标记是用来标示某个位置点信息的一种地图要素,本章介绍如何在地图图面使用点标记。", | ||
@@ -38,5 +38,5 @@ "funding": "https://jaywcjlove.github.io/#/sponsor", | ||
"dependencies": { | ||
"@uiw/react-amap-map": "7.0.2", | ||
"@uiw/react-amap-utils": "7.0.2" | ||
"@uiw/react-amap-map": "7.1.0", | ||
"@uiw/react-amap-utils": "7.1.0" | ||
} | ||
} |
@@ -32,36 +32,36 @@ Marker 点标记组件 | ||
<Map zoom={4}> | ||
<Marker visiable={show} title="北京市" position={new AMap.LngLat(116.405285,39.904989)} /> | ||
<Marker visiable={show} title="天津市" position={new AMap.LngLat(117.190182,39.125596)} /> | ||
<Marker visiable={show} title="河北省" position={new AMap.LngLat(114.502461,38.045474)} /> | ||
<Marker visiable={show} title="山西省" position={new AMap.LngLat(112.549248,37.857014)} /> | ||
<Marker visiable={show} title="内蒙古自治区" position={new AMap.LngLat(111.670801,40.818311)} /> | ||
<Marker visiable={show} title="辽宁省" position={new AMap.LngLat(123.429096,41.796767)} /> | ||
<Marker visiable={show} title="吉林省" position={new AMap.LngLat(125.3245,43.886841)} /> | ||
<Marker visiable={show} title="黑龙江省" position={new AMap.LngLat(126.642464,45.756967)} /> | ||
<Marker visiable={show} title="上海市" position={new AMap.LngLat(121.472644,31.231706)} /> | ||
<Marker visiable={show} title="江苏省" position={new AMap.LngLat(118.767413,32.041544)} /> | ||
<Marker visiable={show} title="浙江省" position={new AMap.LngLat(120.153576,30.287459)} /> | ||
<Marker visiable={show} title="安徽省" position={new AMap.LngLat(117.283042,31.86119)} /> | ||
<Marker visiable={show} title="福建省" position={new AMap.LngLat(119.306239,26.075302)} /> | ||
<Marker visiable={show} title="江西省" position={new AMap.LngLat(115.892151,28.676493)} /> | ||
<Marker visiable={show} title="山东省" position={new AMap.LngLat(117.000923,36.675807)} /> | ||
<Marker visiable={show} title="河南省" position={new AMap.LngLat(113.665412,34.757975)} /> | ||
<Marker visiable={show} title="湖北省" position={new AMap.LngLat(114.298572,30.584355)} /> | ||
<Marker visiable={show} title="湖南省" position={new AMap.LngLat(112.982279,28.19409)} /> | ||
<Marker visiable={show} title="广东省" position={new AMap.LngLat(113.280637,23.125178)} /> | ||
<Marker visiable={show} title="广西壮族自治区" position={new AMap.LngLat(108.320004,22.82402)} /> | ||
<Marker visiable={show} title="海南省" position={new AMap.LngLat(110.33119,20.031971)} /> | ||
<Marker visiable={show} title="重庆市" position={new AMap.LngLat(106.504962,29.533155)} /> | ||
<Marker visiable={show} title="四川省" position={new AMap.LngLat(104.065735,30.659462)} /> | ||
<Marker visiable={show} title="贵州省" position={new AMap.LngLat(106.713478,26.578343)} /> | ||
<Marker visiable={show} title="云南省" position={new AMap.LngLat(102.712251,25.040609)} /> | ||
<Marker visiable={show} title="西藏自治区" position={new AMap.LngLat(91.132212,29.660361)} /> | ||
<Marker visiable={show} title="陕西省" position={new AMap.LngLat(108.948024,34.263161)} /> | ||
<Marker visiable={show} title="甘肃省" position={new AMap.LngLat(103.823557,36.058039)} /> | ||
<Marker visiable={show} title="青海省" position={new AMap.LngLat(101.778916,36.623178)} /> | ||
<Marker visiable={show} title="宁夏回族自治区" position={new AMap.LngLat(106.278179,38.46637)} /> | ||
<Marker visiable={show} title="新疆维吾尔自治区" position={new AMap.LngLat(87.617733,43.792818)} /> | ||
<Marker visiable={show} title="台湾省" position={new AMap.LngLat(121.509062,25.044332)} /> | ||
<Marker visiable={show} title="香港特別行政區" position={new AMap.LngLat(114.173355,22.320048)} /> | ||
<Marker visiable={show} title="澳門特別行政區" position={new AMap.LngLat(113.54909,22.198951)} /> | ||
<Marker visible={show} title="北京市" position={new AMap.LngLat(116.405285,39.904989)} /> | ||
<Marker visible={show} title="天津市" position={new AMap.LngLat(117.190182,39.125596)} /> | ||
<Marker visible={show} title="河北省" position={new AMap.LngLat(114.502461,38.045474)} /> | ||
<Marker visible={show} title="山西省" position={new AMap.LngLat(112.549248,37.857014)} /> | ||
<Marker visible={show} title="内蒙古自治区" position={new AMap.LngLat(111.670801,40.818311)} /> | ||
<Marker visible={show} title="辽宁省" position={new AMap.LngLat(123.429096,41.796767)} /> | ||
<Marker visible={show} title="吉林省" position={new AMap.LngLat(125.3245,43.886841)} /> | ||
<Marker visible={show} title="黑龙江省" position={new AMap.LngLat(126.642464,45.756967)} /> | ||
<Marker visible={show} title="上海市" position={new AMap.LngLat(121.472644,31.231706)} /> | ||
<Marker visible={show} title="江苏省" position={new AMap.LngLat(118.767413,32.041544)} /> | ||
<Marker visible={show} title="浙江省" position={new AMap.LngLat(120.153576,30.287459)} /> | ||
<Marker visible={show} title="安徽省" position={new AMap.LngLat(117.283042,31.86119)} /> | ||
<Marker visible={show} title="福建省" position={new AMap.LngLat(119.306239,26.075302)} /> | ||
<Marker visible={show} title="江西省" position={new AMap.LngLat(115.892151,28.676493)} /> | ||
<Marker visible={show} title="山东省" position={new AMap.LngLat(117.000923,36.675807)} /> | ||
<Marker visible={show} title="河南省" position={new AMap.LngLat(113.665412,34.757975)} /> | ||
<Marker visible={show} title="湖北省" position={new AMap.LngLat(114.298572,30.584355)} /> | ||
<Marker visible={show} title="湖南省" position={new AMap.LngLat(112.982279,28.19409)} /> | ||
<Marker visible={show} title="广东省" position={new AMap.LngLat(113.280637,23.125178)} /> | ||
<Marker visible={show} title="广西壮族自治区" position={new AMap.LngLat(108.320004,22.82402)} /> | ||
<Marker visible={show} title="海南省" position={new AMap.LngLat(110.33119,20.031971)} /> | ||
<Marker visible={show} title="重庆市" position={new AMap.LngLat(106.504962,29.533155)} /> | ||
<Marker visible={show} title="四川省" position={new AMap.LngLat(104.065735,30.659462)} /> | ||
<Marker visible={show} title="贵州省" position={new AMap.LngLat(106.713478,26.578343)} /> | ||
<Marker visible={show} title="云南省" position={new AMap.LngLat(102.712251,25.040609)} /> | ||
<Marker visible={show} title="西藏自治区" position={new AMap.LngLat(91.132212,29.660361)} /> | ||
<Marker visible={show} title="陕西省" position={new AMap.LngLat(108.948024,34.263161)} /> | ||
<Marker visible={show} title="甘肃省" position={new AMap.LngLat(103.823557,36.058039)} /> | ||
<Marker visible={show} title="青海省" position={new AMap.LngLat(101.778916,36.623178)} /> | ||
<Marker visible={show} title="宁夏回族自治区" position={new AMap.LngLat(106.278179,38.46637)} /> | ||
<Marker visible={show} title="新疆维吾尔自治区" position={new AMap.LngLat(87.617733,43.792818)} /> | ||
<Marker visible={show} title="台湾省" position={new AMap.LngLat(121.509062,25.044332)} /> | ||
<Marker visible={show} title="香港特別行政區" position={new AMap.LngLat(114.173355,22.320048)} /> | ||
<Marker visible={show} title="澳門特別行政區" position={new AMap.LngLat(113.54909,22.198951)} /> | ||
</Map> | ||
@@ -100,3 +100,3 @@ </div> | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
title="北京市" | ||
@@ -115,3 +115,3 @@ // offset={new AMap.Pixel(-13, -30)} | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
title="北京市" | ||
@@ -194,3 +194,3 @@ label={{ | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
icon={new AMap.Icon({ | ||
@@ -204,3 +204,3 @@ imageSize: new AMap.Size(25, 34), | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
icon={new AMap.Icon({ | ||
@@ -214,3 +214,3 @@ imageSize: new AMap.Size(25, 34), | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
icon={new AMap.Icon({ | ||
@@ -271,3 +271,3 @@ imageSize: new AMap.Size(25, 34), | ||
<Marker | ||
visiable={show} | ||
visible={show} | ||
offset={new AMap.Pixel(-13, -30)} | ||
@@ -301,3 +301,3 @@ position={new AMap.LngLat(116.205467, 39.907761)} | ||
|--------- |-------- |--------- |-------- | | ||
| visiable | 覆盖物是否可见。 | `boolean` | - | | ||
| visible | 覆盖物是否可见。 | `boolean` | - | | ||
| map | 要显示该marker的地图对象 | `Map` | - | | ||
@@ -304,0 +304,0 @@ | position | 点标记在地图上显示的位置,默认为地图中心点 | `LngLat` | - | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25004
294
+ Added@uiw/react-amap-map@7.1.0(transitive)
+ Added@uiw/react-amap-types@7.1.0(transitive)
+ Added@uiw/react-amap-utils@7.1.0(transitive)
- Removed@uiw/react-amap-map@7.0.2(transitive)
- Removed@uiw/react-amap-types@7.0.2(transitive)
- Removed@uiw/react-amap-utils@7.0.2(transitive)
Updated@uiw/react-amap-map@7.1.0
Updated@uiw/react-amap-utils@7.1.0