@maptiler/geocoding-control 3.0.0-rc.5 → 3.0.0-rc.7

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.
@@ -1,6 +1,6 @@
1
1
  import { ControlOptions, Map as LMap, Marker, MarkerOptions, PathOptions, StyleFunction, ZoomPanOptions } from 'leaflet';
2
2
  import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
3
- import { Feature, PickedResultStyle } from '../types';
3
+ import { Feature, FlyToFeatures, PickedResultStyle } from '../types';
4
4
  export type LeafletGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "fetchFullGeometryOnPick"> & {
5
5
  /**
6
6
  * Marker to be added to the map at the location of the user-selected result using a default set of Marker options.
@@ -45,6 +45,16 @@ export type LeafletGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "fetc
45
45
  * Default value is `true`.
46
46
  */
47
47
  flyTo?: null | boolean | ZoomPanOptions;
48
+ /**
49
+ * Specifies if found features (shown in result list) should be also animated to on the map. `flyTo` muset be enabled in any way for this to have any effect.
50
+ *
51
+ * - If `false` or `"never"` then animating the map to found features is disabled.
52
+ * - If `true` or `"always"` then animating the map to found features is enabled.
53
+ * - If `"external"` then animating the map to found features is enabled only when explicitly calling `setQuery` or `submitQuery` methods.
54
+ *
55
+ * Default: `"external"`.
56
+ */
57
+ flyToFeatures?: boolean | FlyToFeatures;
48
58
  /**
49
59
  * Specifies if selected (not picked) feature should be also animated to on the map.
50
60
  *
@@ -1,6 +1,6 @@
1
1
  import { default as maplibregl } from 'maplibre-gl';
2
2
  import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
3
- import { Feature, PickedResultStyle } from '../types';
3
+ import { Feature, FlyToFeatures, PickedResultStyle } from '../types';
4
4
  type FillLayerSpecification = maplibregl.FillLayerSpecification;
5
5
  type FitBoundsOptions = maplibregl.FitBoundsOptions;
6
6
  type FlyToOptions = maplibregl.FlyToOptions;
@@ -58,7 +58,17 @@ export type MaplibreglGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "a
58
58
  */
59
59
  flyTo?: null | boolean | (FlyToOptions & FitBoundsOptions);
60
60
  /**
61
- * Specifies if selected (not picked) feature should be also animated to on the map.
61
+ * Specifies if found features (shown in result list) should be also animated to on the map. `flyTo` muset be enabled in any way for this to have any effect.
62
+ *
63
+ * - If `false` or `"never"` then animating the map to found features is disabled.
64
+ * - If `true` or `"always"` then animating the map to found features is enabled.
65
+ * - If `"external"` then animating the map to found features is enabled only when explicitly calling `setQuery` or `submitQuery` methods.
66
+ *
67
+ * Default: `"external"`.
68
+ */
69
+ flyToFeatures?: boolean | FlyToFeatures;
70
+ /**
71
+ * Specifies if selected (not picked) feature should be also animated to on the map. `flyTo` muset be enabled in any way for this to have any effect.
62
72
  *
63
73
  * Default: `false`.
64
74
  */
@@ -3,7 +3,7 @@ import { Options } from 'ol/control/Control';
3
3
  import { StyleFunction, StyleLike } from 'ol/style/Style';
4
4
  import { FlatStyleLike } from 'ol/style/flat';
5
5
  import { MaptilerGeocoderOptions } from '../geocoder/geocoder-options';
6
- import { PickedResultStyle } from '../types';
6
+ import { FlyToFeatures, PickedResultStyle } from '../types';
7
7
  export type OpenLayersGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "fetchFullGeometryOnPick"> & {
8
8
  /**
9
9
  * Marker to be added to the map at the location of the user-selected result.
@@ -36,6 +36,16 @@ export type OpenLayersGeocodingControlOptions = Omit<MaptilerGeocoderOptions, "f
36
36
  * Default value is `true`.
37
37
  */
38
38
  flyTo?: null | boolean | (AnimationOptions & FitOptions);
39
+ /**
40
+ * Specifies if found features (shown in result list) should be also animated to on the map. `flyTo` muset be enabled in any way for this to have any effect.
41
+ *
42
+ * - If `false` or `"never"` then animating the map to found features is disabled.
43
+ * - If `true` or `"always"` then animating the map to found features is enabled.
44
+ * - If `"external"` then animating the map to found features is enabled only when explicitly calling `setQuery` or `submitQuery` methods.
45
+ *
46
+ * Default: `"external"`.
47
+ */
48
+ flyToFeatures?: boolean | FlyToFeatures;
39
49
  /**
40
50
  * Specifies if selected (not picked) feature should be also animated to on the map.
41
51
  *
@@ -26,6 +26,7 @@ export declare namespace MaptilerGeocoderEvent {
26
26
  type FeaturesHideEvent = CustomEvent<void>;
27
27
  type FeaturesListedEvent = CustomEvent<{
28
28
  features: Feature[] | undefined;
29
+ external: boolean;
29
30
  }>;
30
31
  type FeaturesClearEvent = CustomEvent<void>;
31
32
  }
@@ -62,8 +62,10 @@ export declare class MaptilerGeocoderElement extends LitElement implements Mapti
62
62
  private abortController?;
63
63
  /** Focus state of input element */
64
64
  private focused;
65
- /** Focus state of input element, delayed for a moment to not close feature list immediately after losing focus */
66
- private focusedDelayed;
65
+ /** Visibility state of feature list */
66
+ private isFeatureListVisible;
67
+ /** Feature list is currently interacted with using pointer device so it should not be closed even though input lost focus */
68
+ private isFeatureListInteractedWith;
67
69
  protected firstUpdated(): void;
68
70
  /**
69
71
  * Set the options of this instance.
@@ -39,6 +39,7 @@ export type ProximityRule = {
39
39
  cachedLocationExpiry?: number;
40
40
  } & PositionOptions));
41
41
  export type PickedResultStyle = "marker-only" | "full-geometry" | "full-geometry-including-polygon-center-marker";
42
+ export type FlyToFeatures = "never" | "always" | "external";
42
43
  export type EnableReverse = "never" | "always" | "button";
43
44
  export type ShowPlaceType = "never" | "always" | "if-needed";
44
45
  export type TypeRule = PlaceType | [minZoom: number | null | undefined, maxZoom: number | null | undefined, type: PlaceType];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "3.0.0-rc.5",
3
+ "version": "3.0.0-rc.7",
4
4
  "description": "The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.",
5
5
  "type": "module",
6
6
  "author": {