Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-amap-types

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-amap-types - npm Package Compare versions

Comparing version 2.7.6 to 2.7.7

2

package.json
{
"name": "@uiw/react-amap-types",
"version": "2.7.6",
"version": "2.7.7",
"description": "基于 React 封装的高德地图组件。AMap Component Based On React.",

@@ -5,0 +5,0 @@ "homepage": "https://uiwjs.github.io/react-amap/#/types",

@@ -22,3 +22,3 @@ declare global {

*/
setLng?(lng): void;
setLng?(lng: number): void;
/**

@@ -28,3 +28,3 @@ * 获取纬度值

*/
setLat?(lat): void;
setLat?(lat: number): void;
/**

@@ -56,3 +56,3 @@ * 获取纬度值

*/
subtract?(another, noWrap): LngLat;
subtract?(another: LngLat, noWrap: boolean): LngLat;
/**

@@ -267,3 +267,3 @@ * 获取从当前经纬度位置向东移动 E 米,向北移动 N 米的坐标位置

/** 共同部分事件定义 */
private interface EventsCommonProps {
interface EventsCommonProps {
/** 鼠标左键单击事件 */

@@ -270,0 +270,0 @@ onClick?(event: MapsEvent): void;

@@ -129,3 +129,3 @@ /// <reference path="./base.d.ts" />

*/
class HawkEye extends Omit<Control, 'addTo' | 'remove'> {
class HawkEye extends Control {
constructor(opts: HawkEyeOptions);

@@ -165,3 +165,3 @@ /**

*/
layers?: array;
layers?: any[];
/**

@@ -168,0 +168,0 @@ * 缩略图的宽度,同CSS,如'200px'

@@ -20,3 +20,3 @@ /// <reference path="./base.d.ts" />

*/
setCenter(center: [number, number] | LngLat, immediately: boolean = false, duration?: number): void;
setCenter(center: [number, number] | LngLat, immediately: boolean, duration?: number): void;
/**

@@ -29,3 +29,3 @@ * 地图缩放至指定级别并以指定点为地图显示中心点

*/
setZoomAndCenter(zoom: number, center: [number, number] | LngLat, immediately: boolean = false, duration?: number);
setZoomAndCenter(zoom: number, center: [number, number] | LngLat, immediately: boolean, duration?: number): void;
/**

@@ -44,3 +44,3 @@ * 获取当前地图视图范围/可视区域。

*/
setZoom(zoom: number, immediately: boolean = false, duration?: number): void;
setZoom(zoom: number, immediately: boolean, duration?: number): void;
/**

@@ -63,3 +63,3 @@ * 获取当前地图缩放级别, 默认取值范围为[2, 20]

*/
setPitch(Pitch: number, immediately: boolean = false, duration?: number): void;
setPitch(Pitch: number, immediately: boolean, duration?: number): void;
/** 返回地图对象的容器 */

@@ -77,3 +77,3 @@ getContainer(): HTMLElement;

*/
setRotation(rotation: number, immediately: boolean = false, duration?: number)
setRotation(rotation: number, immediately: boolean, duration?: number): number
/**

@@ -127,3 +127,3 @@ * 添加图层到地图上

*/
setDefaultCursor(cursor): void;
setDefaultCursor(cursor: string): void;
/**

@@ -242,3 +242,3 @@ * 从地图上移除图层

*/
getCity(getCityCallBack: (data: CityCallBack) => void, lnglat: Array<number>)
getCity(getCityCallBack: (data: CityCallBack) => void, lnglat: Array<number>): CityCallBack;
/**

@@ -261,3 +261,3 @@ * 按照行政区名称或adcode来设置地图显示的中心点。

*/
setFitView(overlays: Array<TileLayer> | null, immediately: boolean = false, avoid: Array<number>, maxZoom?: number): Bounds;
setFitView(overlays: Array<TileLayer> | null, immediately: boolean, avoid: Array<number>, maxZoom?: number): Bounds;
/**

@@ -279,3 +279,3 @@ * 添加控件。参数可以是插件列表中的任何插件对象,如:ToolBar、OverView、Scale等

*/
setMapStyle(value): void;
setMapStyle(value: string): void;
/**

@@ -282,0 +282,0 @@ * 获取地图显示样式

@@ -11,6 +11,6 @@ /// <reference path="./base.d.ts" />

*/
class DistrictLayer {
static World: typeof World;
static Country: typeof Country;
static Province: typeof Province;
class DistrictLayer<DistrictLayerStyle = any> {
World: typeof World;
Country: typeof Country;
Province: typeof Province;
constructor(opts: DistrictLayerOptions);

@@ -26,3 +26,3 @@ /** 设定显示的国家 SOC */

/** 获取样式信息 */
getStyles(): void;
getStyles(): DistrictLayerStyle;
/** 获取该图层可显示的级别范围 */

@@ -49,3 +49,3 @@ setZooms(zooms: [number, number]): void;

}
interface DistrictLayerOptions {
interface DistrictLayerOptions<DistrictLayerStyle = any> {
/** 行政区的编码 adcode与省市行政区对照表 */

@@ -75,21 +75,5 @@ adcode?: string;

}
interface DistrictLayerStyle {
/** (default 1) 描边线宽 */
['stroke-width']?: number
/** (default [0.18,0.63,0.94,1]) 海岸线颜色 */
['coastline-stroke']:? Array<string> | string | Function;
/** (default [0.35,0.35,0.35,1]) 国境线颜色 */
['nation-stroke']:? Array<string> | string | Function;
/** (default [0.5,0.5,0.5,1]) 省界颜色 */
['province-stroke']:? Array<string> | string | Function;
/** (default [0.7,0.7,0.7,1]) 城市界颜色 */
['city-stroke']:? Array<string> | string | Function;
/** (default [0.85,0.85,0.85,1]) 区/县界颜色 */
['county-stroke']:? Array<string> | string | Function;
/** (default [1,1,1,1]) 填充色 */
fill?: Array<string> | string | Function;
}
private class World extends DistrictLayer {}
private class Country extends DistrictLayer {}
private class Province extends DistrictLayer {}
class World extends DistrictLayer {}
class Country extends DistrictLayer {}
class Province extends DistrictLayer {}
}

@@ -22,3 +22,3 @@ /// <reference path="./base.d.ts" />

/** 设置图层透明度,范围 [0 ~ 1] */
setOpacity(opacity): number;
setOpacity(opacity: number): number;
/** 获取图层透明度 */

@@ -106,3 +106,4 @@ getOpacity(): number;

/** 卫星图层类,继承自 TileLayer。 */
class Satellite extends Omit<TileLayer, 'setTileUrl', 'reload'> {
class Satellite extends TileLayer {
// class Satellite extends Omit<typeof TileLayer, 'setTileUrl', 'reload'> {
constructor(opts: SatelliteLayerOptions);

@@ -115,3 +116,3 @@ /** 销毁图层 */

/** 实时交通图层类,继承自TileLayer。 */
class Traffic extends Omit<TileLayer, 'setTileUrl', 'reload'> {
class Traffic extends TileLayer {
constructor(opts: TrafficLayerOptions);

@@ -217,6 +218,6 @@ /** 停止自动更新数据 */

/** 矢量覆盖物图层,可添加/删除/查询矢量覆盖物(Polygon/Polyline/CircleMarker/Ellipse/RectAngle/BezierCurve)的图层 */
class VectorLayer {
class VectorLayer<VectorOverlay = any> {
constructor(opts: VectorLayerOptions);
/** 添加矢量覆盖物到集合中,不支持添加重复的覆盖物 */
add(vectors): void;
add(vectors: VectorOverlay | VectorOverlay[]): void;
/** 删除矢量覆盖物 */

@@ -299,7 +300,7 @@ remove(vectors: VectorLayer | Array<VectorLayer>): void;

/** 热力图的渐变区间,热力图按照设置的颜色及间隔显示热力图,例{0.4:'rgb(0, 255, 255)',0.85:'rgb(100, 0, 255)',},其中 key 表示间隔位置,取值范围: [0,1] ,value 为颜色值。默认:heatmap.js标准配色方案 */
gradient?: object;
gradient?: Record<number, string>;
/** 热力图透明度区间数组,取值范围 [0,1] ,0表示完全透明,1表示不透明,默认: [0,1] */
opacity?: array;
opacity?: number[];
/** 支持的缩放级别范围,取值范围 [3-20] ,默认: [3,20] */
zooms?: array;
zooms?: number[];
/** 是否可见 */

@@ -316,3 +317,3 @@ visible?: boolean;

/** 影响高度平滑度的贝塞尔曲线因子,默认 [0.5, 0, 1, 0.5] , */
heightBezier?: array;
heightBezier?: number[];
/** 取样精度,越小越平滑,越大性能越高 */

@@ -319,0 +320,0 @@ gridSize?: number;

@@ -6,14 +6,2 @@ /// <reference path="./base.d.ts" />

namespace Overlay {
interface EventMap<I> {
touchstart: MapsEvent<'touchstart', I>;
touchmove: MapsEvent<'touchmove', I>;
touchend: MapsEvent<'touchend', I>;
click: MapsEvent<'click', I>;
rightclick: MapsEvent<'rightclick', I>;
dblclick: MapsEvent<'dblclick', I>;
mousemove: MapsEvent<'mousemove', I>;
mouseover: MapsEvent<'mouseover', I>;
mousedown: MapsEvent<'mousedown', I>;
mouseup: MapsEvent<'mouseup', I>;
}
interface Options<ExtraData = any> {

@@ -46,13 +34,5 @@ /**

}
abstract class Overlay<ExtraData = any> extends EventEmitter {
abstract class Overlay<ExtraData = any> extends MapEventListener<'touchstart' | 'touchmove' | 'touchend' | 'click' | 'rightclick' | 'dblclick' | 'mousemove' | 'mouseover' | 'mousedown' | 'mouseup'> {
constructor(options?: Overlay.Options);
/**
* 显示覆盖物
*/
show(): void;
/**
* 隐藏覆盖物
*/
hide(): void;
/**
* 获取所属地图

@@ -83,6 +63,6 @@ */

*/
class Marker extends MapEventListener<'dragstart' | 'touchmove' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragging' | 'dragend' | 'moving' | 'moveend' | 'touchend' | 'movealong' | 'touchstart'> extends MoveAnimation {
class Marker extends MapEventListener<'dragstart' | 'touchmove' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragging' | 'dragend' | 'moving' | 'moveend' | 'touchend' | 'movealong' | 'touchstart'> {
constructor(opts: MarkerOptions);
/** 获取点标记的文字提示 */
getTitle(): ?string;
getTitle(): string | undefined;
/** 鼠标滑过点标时的文字提示 */

@@ -162,2 +142,14 @@ setTitle(title: string): void;

getSize(): Vector;
/** 以指定的时长,点标记沿指定的路径移动,加载 AMap.MoveAnimation 后可以使用 */
moveAlong(path: Array<LngLat> | Array<Vector> | Array<MoveAlongObj>, opts?: MoveAlongOptions): void;
/** 暂停点标记动画,加载 AMap.MoveAnimation 后创建的点标记可以使用 */
pauseMove(): void;
/** 重新启动点标记动画,加载 AMap.MoveAnimation 后可以使用 */
resumeMove(): void;
/** 停止点标记动画,加载 AMap.MoveAnimation 后可以使用 */
stopMove(): void;
/** 开启点标记动画,加载 AMap.MoveAnimation 后可以使用 */
startMove(): void;
/** 以给定时间移动点标记到指定位置,加载 AMap.MoveAnimation 后可以使用 */
moveTo(targetPosition: MoveToOptions, opts?: MoveAlongOptions): void;
}

@@ -987,3 +979,3 @@ interface MarkerOptions {

/** 文本标记 */
class Text extends MapEventListener<'moving' | 'touchmove' | 'touchend' | 'movealong' | 'touchstart' | 'moveend' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragstart' | 'dragend' | 'dragging'> extends MoveAnimation {
class Text extends MapEventListener<'moving' | 'touchmove' | 'touchend' | 'movealong' | 'touchstart' | 'moveend' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragstart' | 'dragend' | 'dragging'> {
constructor(opts: TextOptions);

@@ -1002,3 +994,3 @@ /** 获取文本标记内容 */

getzIndex(): number | undefined;;
getMap(): ?Map;
getMap(): Map | undefined;
setMap(map: Map): void;

@@ -1024,2 +1016,14 @@ addTo(map: Map): void;

remove(): void;
/** 以指定的时长,点标记沿指定的路径移动,加载 AMap.MoveAnimation 后可以使用 */
moveAlong(path: Array<LngLat> | Array<Vector> | Array<MoveAlongObj>, opts?: MoveAlongOptions): void;
/** 暂停点标记动画,加载 AMap.MoveAnimation 后创建的点标记可以使用 */
pauseMove(): void;
/** 重新启动点标记动画,加载 AMap.MoveAnimation 后可以使用 */
resumeMove(): void;
/** 停止点标记动画,加载 AMap.MoveAnimation 后可以使用 */
stopMove(): void;
/** 开启点标记动画,加载 AMap.MoveAnimation 后可以使用 */
startMove(): void;
/** 以给定时间移动点标记到指定位置,加载 AMap.MoveAnimation 后可以使用 */
moveTo(targetPosition: MoveToOptions, opts?: MoveAlongOptions): void;
}

@@ -1217,7 +1221,3 @@ interface TextEvents extends EventsCommonProps {

*/
interface MoveAnimation {
/** 以指定的时长,点标记沿指定的路径移动,加载 AMap.MoveAnimation 后可以使用 */
moveAlong(path: Array<LngLat> | Array<Vector> | Array<MoveAlongObj>, opts?: MoveAlongOptions): void;
/** 暂停点标记动画,加载 AMap.MoveAnimation 后创建的点标记可以使用 */
pauseMove(): void;
class MoveAnimation {
/** 重新启动点标记动画,加载 AMap.MoveAnimation 后可以使用 */

@@ -1264,3 +1264,3 @@ resumeMove(): void;

/** 标注类 */
class LabelMarker extends MapEventListener<'mousedown' | 'mouseup' | 'touchstart' | 'touchmove' | 'touchend' | 'click' | 'mousemove' | 'mouseover' | 'mouseout'> extends MoveAnimation {
class LabelMarker extends MapEventListener<'mousedown' | 'mouseup' | 'touchstart' | 'touchmove' | 'touchend' | 'click' | 'mousemove' | 'mouseover' | 'mouseout'> {
constructor(opts: LabelMarkerOptions);

@@ -1290,2 +1290,14 @@ getName(): string | undefined;

remove(): void;
/** 以指定的时长,点标记沿指定的路径移动,加载 AMap.MoveAnimation 后可以使用 */
moveAlong(path: Array<LngLat> | Array<Vector> | Array<MoveAlongObj>, opts?: MoveAlongOptions): void;
/** 暂停点标记动画,加载 AMap.MoveAnimation 后创建的点标记可以使用 */
pauseMove(): void;
/** 重新启动点标记动画,加载 AMap.MoveAnimation 后可以使用 */
resumeMove(): void;
/** 停止点标记动画,加载 AMap.MoveAnimation 后可以使用 */
stopMove(): void;
/** 开启点标记动画,加载 AMap.MoveAnimation 后可以使用 */
startMove(): void;
/** 以给定时间移动点标记到指定位置,加载 AMap.MoveAnimation 后可以使用 */
moveTo(targetPosition: MoveToOptions, opts?: MoveAlongOptions): void;
}

@@ -1292,0 +1304,0 @@ interface LabelMarkerOptions {

@@ -262,3 +262,3 @@ /// <reference path="./base.d.ts" />

/** 设置是否强制限制城市 */
search(keyword?: string, callback: (status: 'complete' | 'error' | 'no_data', result?: AutoCompleteSearchCallback) => void): void;
search(keyword?: string, callback?: (status: 'complete' | 'error' | 'no_data', result?: AutoCompleteSearchCallback) => void): void;
}

@@ -265,0 +265,0 @@ interface AutoCompleteSearchCallback {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc