mahal_map 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -23,7 +23,7 @@ interface IAdditionalParamType {
23
23
  /**
24
24
  * Поверхность @grammaps/maps3d-web, описанная локально. Пакет в зависимости не ставится —
25
25
  * он приходит снаружи, как и maplibre-gl, поэтому импортировать его типы нельзя. Здесь
26
- * повторена публичная часть .d.ts версии 0.7.3; всё необязательное помечено `?`, чтобы
26
+ * повторена публичная часть .d.ts версии 0.10.0; всё необязательное помечено `?`, чтобы
27
27
  * более старая сборка на странице не ломала типы у потребителя.
28
28
  */
29
29
  type Maps3DThemeName = "light" | "dark" | "navigator-light" | "navigator-dark" | "mobile-light" | "mobile-dark";
@@ -124,6 +124,41 @@ interface IMaps3DRoadHit {
124
124
  props: Record<string, unknown>;
125
125
  distancePx: number;
126
126
  }
127
+ /** Платность парковки: по ней участок и покрашен. */
128
+ type Maps3DParkingSubtype = "paid" | "free" | "unknown";
129
+ /**
130
+ * Справка о площадной парковке — ровно то, что есть в тайле. Отсутствующий атрибут — `null`.
131
+ * Графика работы и названия здесь нет: в слое `landuse` их не бывает.
132
+ */
133
+ interface IMaps3DParkingInfo {
134
+ /** `osm_id` участка — он же идентификатор для hoverParking(). */
135
+ id: number | string;
136
+ /** `unknown` значит «не указано», а не «бесплатно». */
137
+ subtype: Maps3DParkingSubtype;
138
+ /** Исходное `fee` из тайла (`yes`/`no`). */
139
+ fee: string | null;
140
+ /** Кому можно: `yes`, `private`, `customers`, `residents`, `permissive`, `no`… */
141
+ access: string | null;
142
+ /** OSM `parking=*`: `surface`, `multi-storey`, `underground`, `rooftop`… */
143
+ kind: string | null;
144
+ /** Число мест. */
145
+ capacity: number | null;
146
+ /** Все свойства фичи как есть. */
147
+ props: Record<string, unknown>;
148
+ }
149
+ /** Облик парковки под курсором. Не заданные цвета остаются цветами подтипа. */
150
+ interface IMaps3DParkingHoverStyle {
151
+ /** Цвет заливки. Не задан — цвет подтипа. */
152
+ color?: string | null;
153
+ /** Непрозрачность заливки. По умолчанию 0.55. */
154
+ opacity?: number;
155
+ /** Цвет канта. Не задан — кант подтипа. */
156
+ outlineColor?: string | null;
157
+ /** Во сколько раз толще кант. По умолчанию 2.2. */
158
+ outlineWidth?: number;
159
+ /** CSS-курсор над парковкой. По умолчанию `pointer`; `null` — не трогать. */
160
+ cursor?: string | null;
161
+ }
127
162
  interface IMaps3DTrafficOptions {
128
163
  raster?: boolean;
129
164
  rasterMaxZoom?: number;
@@ -145,6 +180,11 @@ interface IMaps3DClosuresOptions {
145
180
  }
146
181
  interface IMaps3DPlacesOptions {
147
182
  highlight?: boolean;
183
+ /**
184
+ * Непрозрачность заливки парковок в режиме выделения. Не задана — кривая по зуму;
185
+ * заданная перебивает её постоянным значением на всех зумах. С 0.10.0.
186
+ */
187
+ fillOpacity?: number;
148
188
  paid?: boolean;
149
189
  free?: boolean;
150
190
  unknown?: boolean;
@@ -240,6 +280,17 @@ interface IMaps3DLayer {
240
280
  y: number;
241
281
  }, tolerancePx?: number): IMaps3DRoadHit | null;
242
282
  readonly roadsNamed?: boolean;
283
+ parkingAt?(point: {
284
+ x: number;
285
+ y: number;
286
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
287
+ onParkingHover?(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
288
+ setParkingHoverStyle?(style: IMaps3DParkingHoverStyle): void;
289
+ setParkingHoverEnabled?(enabled: boolean): void;
290
+ readonly parkingHoverEnabled?: boolean;
291
+ hoverParking?(id: number | string | null): boolean;
292
+ hoveredParking?(): number | string | null;
293
+ onParkingClick?(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
243
294
  traffic?: boolean;
244
295
  trafficRaster?: boolean;
245
296
  setTraffic?(enabled: boolean): void;
@@ -564,6 +615,16 @@ declare class MahalMap {
564
615
  x: number;
565
616
  y: number;
566
617
  }, tolerancePx?: number): IMaps3DRoadHit | null;
618
+ static onParkingHover(instance: MahalMap, callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
619
+ static setParkingHoverStyle(instance: MahalMap, style: IMaps3DParkingHoverStyle): void;
620
+ static setParkingHoverEnabled(instance: MahalMap, enabled: boolean): void;
621
+ static hoverParking(instance: MahalMap, id: number | string | null): boolean;
622
+ static hoveredParking(instance: MahalMap): string | number | null;
623
+ static onParkingClick(instance: MahalMap, callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
624
+ static parkingAt(instance: MahalMap, point: {
625
+ x: number;
626
+ y: number;
627
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
567
628
  static onBuildingHover(instance: MahalMap, callback: ((info: IMaps3DBuildingClickInfo | null) => void) | null): void;
568
629
  static setHoverEnabled(instance: MahalMap, enabled: boolean): void;
569
630
  static setHoverStyle(instance: MahalMap, style: IMaps3DHoverStyle): void;
@@ -670,6 +731,31 @@ declare class MahalMap {
670
731
  }, tolerancePx?: number): IMaps3DRoadHit | null;
671
732
  /** Есть ли в текущем стиле названия дорог. Нет — roadAt() всегда вернёт null. */
672
733
  get roadsNamed(): boolean;
734
+ /**
735
+ * Участок под курсором либо null. Зовётся ТОЛЬКО при смене участка, не на каждое
736
+ * движение мыши. `null` вместо колбэка — отписаться и погасить подсветку.
737
+ */
738
+ onParkingHover(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
739
+ /** Облик подсветки: color, opacity, outlineColor, outlineWidth, cursor. */
740
+ setParkingHoverStyle(style: IMaps3DParkingHoverStyle): void;
741
+ /** Вкл/выкл наведение, не теряя подписку. */
742
+ setParkingHoverEnabled(enabled: boolean): void;
743
+ /** Включено ли наведение на парковки. */
744
+ get parkingHoverEnabled(): boolean;
745
+ /** Подсветить участок программно (например, со строки списка). `null` — погасить. */
746
+ hoverParking(id: number | string | null): boolean;
747
+ /** `osm_id` подсвеченного участка или null. */
748
+ hoveredParking(): number | string | null;
749
+ /** Клик по участку: справка либо null. `null` вместо колбэка — отписаться. */
750
+ onParkingClick(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
751
+ /**
752
+ * Парковка под точкой холста (`e.point` события карты). Попадание — по границе полигона;
753
+ * допуск по умолчанию 0 — строго внутрь участка.
754
+ */
755
+ parkingAt(point: {
756
+ x: number;
757
+ y: number;
758
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
673
759
  /**
674
760
  * Подписаться на наведение. Колбэк приходит только в момент смены дома под курсором,
675
761
  * а не на каждое движение мыши. `null` отписывает и гасит подсветку.
@@ -1016,4 +1102,4 @@ declare namespace index {
1016
1102
  export { index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
1017
1103
  }
1018
1104
 
1019
- export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };
1105
+ export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DParkingSubtype, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ interface IAdditionalParamType {
23
23
  /**
24
24
  * Поверхность @grammaps/maps3d-web, описанная локально. Пакет в зависимости не ставится —
25
25
  * он приходит снаружи, как и maplibre-gl, поэтому импортировать его типы нельзя. Здесь
26
- * повторена публичная часть .d.ts версии 0.7.3; всё необязательное помечено `?`, чтобы
26
+ * повторена публичная часть .d.ts версии 0.10.0; всё необязательное помечено `?`, чтобы
27
27
  * более старая сборка на странице не ломала типы у потребителя.
28
28
  */
29
29
  type Maps3DThemeName = "light" | "dark" | "navigator-light" | "navigator-dark" | "mobile-light" | "mobile-dark";
@@ -124,6 +124,41 @@ interface IMaps3DRoadHit {
124
124
  props: Record<string, unknown>;
125
125
  distancePx: number;
126
126
  }
127
+ /** Платность парковки: по ней участок и покрашен. */
128
+ type Maps3DParkingSubtype = "paid" | "free" | "unknown";
129
+ /**
130
+ * Справка о площадной парковке — ровно то, что есть в тайле. Отсутствующий атрибут — `null`.
131
+ * Графика работы и названия здесь нет: в слое `landuse` их не бывает.
132
+ */
133
+ interface IMaps3DParkingInfo {
134
+ /** `osm_id` участка — он же идентификатор для hoverParking(). */
135
+ id: number | string;
136
+ /** `unknown` значит «не указано», а не «бесплатно». */
137
+ subtype: Maps3DParkingSubtype;
138
+ /** Исходное `fee` из тайла (`yes`/`no`). */
139
+ fee: string | null;
140
+ /** Кому можно: `yes`, `private`, `customers`, `residents`, `permissive`, `no`… */
141
+ access: string | null;
142
+ /** OSM `parking=*`: `surface`, `multi-storey`, `underground`, `rooftop`… */
143
+ kind: string | null;
144
+ /** Число мест. */
145
+ capacity: number | null;
146
+ /** Все свойства фичи как есть. */
147
+ props: Record<string, unknown>;
148
+ }
149
+ /** Облик парковки под курсором. Не заданные цвета остаются цветами подтипа. */
150
+ interface IMaps3DParkingHoverStyle {
151
+ /** Цвет заливки. Не задан — цвет подтипа. */
152
+ color?: string | null;
153
+ /** Непрозрачность заливки. По умолчанию 0.55. */
154
+ opacity?: number;
155
+ /** Цвет канта. Не задан — кант подтипа. */
156
+ outlineColor?: string | null;
157
+ /** Во сколько раз толще кант. По умолчанию 2.2. */
158
+ outlineWidth?: number;
159
+ /** CSS-курсор над парковкой. По умолчанию `pointer`; `null` — не трогать. */
160
+ cursor?: string | null;
161
+ }
127
162
  interface IMaps3DTrafficOptions {
128
163
  raster?: boolean;
129
164
  rasterMaxZoom?: number;
@@ -145,6 +180,11 @@ interface IMaps3DClosuresOptions {
145
180
  }
146
181
  interface IMaps3DPlacesOptions {
147
182
  highlight?: boolean;
183
+ /**
184
+ * Непрозрачность заливки парковок в режиме выделения. Не задана — кривая по зуму;
185
+ * заданная перебивает её постоянным значением на всех зумах. С 0.10.0.
186
+ */
187
+ fillOpacity?: number;
148
188
  paid?: boolean;
149
189
  free?: boolean;
150
190
  unknown?: boolean;
@@ -240,6 +280,17 @@ interface IMaps3DLayer {
240
280
  y: number;
241
281
  }, tolerancePx?: number): IMaps3DRoadHit | null;
242
282
  readonly roadsNamed?: boolean;
283
+ parkingAt?(point: {
284
+ x: number;
285
+ y: number;
286
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
287
+ onParkingHover?(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
288
+ setParkingHoverStyle?(style: IMaps3DParkingHoverStyle): void;
289
+ setParkingHoverEnabled?(enabled: boolean): void;
290
+ readonly parkingHoverEnabled?: boolean;
291
+ hoverParking?(id: number | string | null): boolean;
292
+ hoveredParking?(): number | string | null;
293
+ onParkingClick?(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
243
294
  traffic?: boolean;
244
295
  trafficRaster?: boolean;
245
296
  setTraffic?(enabled: boolean): void;
@@ -564,6 +615,16 @@ declare class MahalMap {
564
615
  x: number;
565
616
  y: number;
566
617
  }, tolerancePx?: number): IMaps3DRoadHit | null;
618
+ static onParkingHover(instance: MahalMap, callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
619
+ static setParkingHoverStyle(instance: MahalMap, style: IMaps3DParkingHoverStyle): void;
620
+ static setParkingHoverEnabled(instance: MahalMap, enabled: boolean): void;
621
+ static hoverParking(instance: MahalMap, id: number | string | null): boolean;
622
+ static hoveredParking(instance: MahalMap): string | number | null;
623
+ static onParkingClick(instance: MahalMap, callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
624
+ static parkingAt(instance: MahalMap, point: {
625
+ x: number;
626
+ y: number;
627
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
567
628
  static onBuildingHover(instance: MahalMap, callback: ((info: IMaps3DBuildingClickInfo | null) => void) | null): void;
568
629
  static setHoverEnabled(instance: MahalMap, enabled: boolean): void;
569
630
  static setHoverStyle(instance: MahalMap, style: IMaps3DHoverStyle): void;
@@ -670,6 +731,31 @@ declare class MahalMap {
670
731
  }, tolerancePx?: number): IMaps3DRoadHit | null;
671
732
  /** Есть ли в текущем стиле названия дорог. Нет — roadAt() всегда вернёт null. */
672
733
  get roadsNamed(): boolean;
734
+ /**
735
+ * Участок под курсором либо null. Зовётся ТОЛЬКО при смене участка, не на каждое
736
+ * движение мыши. `null` вместо колбэка — отписаться и погасить подсветку.
737
+ */
738
+ onParkingHover(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
739
+ /** Облик подсветки: color, opacity, outlineColor, outlineWidth, cursor. */
740
+ setParkingHoverStyle(style: IMaps3DParkingHoverStyle): void;
741
+ /** Вкл/выкл наведение, не теряя подписку. */
742
+ setParkingHoverEnabled(enabled: boolean): void;
743
+ /** Включено ли наведение на парковки. */
744
+ get parkingHoverEnabled(): boolean;
745
+ /** Подсветить участок программно (например, со строки списка). `null` — погасить. */
746
+ hoverParking(id: number | string | null): boolean;
747
+ /** `osm_id` подсвеченного участка или null. */
748
+ hoveredParking(): number | string | null;
749
+ /** Клик по участку: справка либо null. `null` вместо колбэка — отписаться. */
750
+ onParkingClick(callback: ((info: IMaps3DParkingInfo | null) => void) | null): void;
751
+ /**
752
+ * Парковка под точкой холста (`e.point` события карты). Попадание — по границе полигона;
753
+ * допуск по умолчанию 0 — строго внутрь участка.
754
+ */
755
+ parkingAt(point: {
756
+ x: number;
757
+ y: number;
758
+ }, tolerancePx?: number): IMaps3DParkingInfo | null;
673
759
  /**
674
760
  * Подписаться на наведение. Колбэк приходит только в момент смены дома под курсором,
675
761
  * а не на каждое движение мыши. `null` отписывает и гасит подсветку.
@@ -1016,4 +1102,4 @@ declare namespace index {
1016
1102
  export { index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
1017
1103
  }
1018
1104
 
1019
- export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };
1105
+ export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DParkingSubtype, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };