Skip to content

Commit 344e65f

Browse files
authored
feat(geo): Rename 'Geocoder' to 'LocationSearch' (#1938)
* Re-alias Geocoder component as LocationSearch * Refactor examples to use LocationSearch component * Update Geocoder e2e tests to reflect LocationSearch change * Update docs to reference LocationSearch instead of Geocoder * Rename cypress test step files * Create bright-frogs-remember.md
1 parent c6e99bd commit 344e65f

File tree

17 files changed

+81
-62
lines changed

17 files changed

+81
-62
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui-react": patch
3+
---
4+
5+
feat(geo): Rename 'Geocoder' to 'LocationSearch'

docs/src/pages/[platform]/components/geo/fragments/geocoder-position.react.mdx renamed to docs/src/pages/[platform]/components/geo/fragments/location-search-position.react.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
```js{12}
2-
import { MapView, Geocoder } from '@aws-amplify/ui-react';
2+
import { MapView, LocationSearch } from '@aws-amplify/ui-react';
33
import { Amplify } from 'aws-amplify';
44
55
import '@aws-amplify/ui-react/styles.css';
66
77
import awsExports from './aws-exports';
88
99
Amplify.configure(awsExports);
10-
export default function GeocoderPosition() {
10+
export default function LocationSearchPosition() {
1111
return (
1212
<MapView>
13-
<Geocoder position="top-left" />
13+
<LocationSearch position="top-left" />
1414
</MapView>
1515
);
1616
}

docs/src/pages/[platform]/components/geo/fragments/geocoder-quick-start.react.mdx renamed to docs/src/pages/[platform]/components/geo/fragments/location-search-quick-start.react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```js{1,4,13} file=../../../../../../../examples/next/pages/ui/components/geo/map-with-geocoder/index.page.tsx
1+
```js{1,4,13} file=../../../../../../../examples/next/pages/ui/components/geo/map-with-location-search/index.page.tsx
22

33
```

docs/src/pages/[platform]/components/geo/fragments/standalone-geocoder.react.mdx renamed to docs/src/pages/[platform]/components/geo/fragments/location-search-standalone.react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```js{1,4,16} file=../../../../../../../examples/next/pages/ui/components/geo/standalone-geocoder/index.page.tsx
1+
```js{1,4,16} file=../../../../../../../examples/next/pages/ui/components/geo/standalone-location-search/index.page.tsx
22

33
```

docs/src/pages/[platform]/components/geo/react.mdx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,43 @@ when the marker is clicked. The `offset` property can be used to prevent the pop
6161
_Note: Ensure `originalEvent.stopPropagation()` is called in the marker click handler. This allows the `showPopup`
6262
state to be handled by the component._
6363

64-
## Geocoder (Location Search)
64+
## Location Search
6565

66-
`Geocoder` provides location search powered by [Amazon Location Service](https://aws.amazon.com/location/) for the
67-
`MapView` component, using the viewport as the proximity for generating results. `Geocoder` is used as a child
66+
_Component can also be imported as `Geocoder`_
67+
68+
`LocationSearch` provides location search powered by [Amazon Location Service](https://aws.amazon.com/location/) for the
69+
`MapView` component, using the viewport as the proximity for generating results. `LocationSearch` is used as a child
6870
component of `MapView` for which it renders visual markers and information based on its location search results.
6971

70-
You can import the `Geocoder` component with related styles and use it as a child of `MapView` without any
72+
You can import the `LocationSearch` component with related styles and use it as a child of `MapView` without any
7173
additional configuration.
7274

7375
<Fragment platforms={['react']}>
74-
{({ platform }) => import(`./fragments/geocoder-quick-start.${platform}.mdx`)}
76+
{({ platform }) =>
77+
import(`./fragments/location-search-quick-start.${platform}.mdx`)
78+
}
7579
</Fragment>
7680

77-
### Geocoder Position
81+
### LocationSearch Position
7882

79-
`Geocoder` can be provided a `position` property when used with `MapView`. The property is not reactive, meaning the
83+
`LocationSearch` can be provided a `position` property when used with `MapView`. The property is not reactive, meaning the
8084
position is fixed after the component mounts. Valid values are `'top-right'`, `'top-left'`, `'bottom-right'`, and
8185
`'bottom-left'`. Default value is `'top-right'`.
8286

8387
<Fragment platforms={['react']}>
84-
{({ platform }) => import(`./fragments/geocoder-position.${platform}.mdx`)}
88+
{({ platform }) =>
89+
import(`./fragments/location-search-position.${platform}.mdx`)
90+
}
8591
</Fragment>
8692

87-
### Standalone Geocoder
93+
### Standalone LocationSearch
8894

89-
`Geocoder` can also be used as a standalone component without `MapView`. As a standalone component, `Geocoder`
95+
`LocationSearch` can also be used as a standalone component without `MapView`. As a standalone component, `LocationSearch`
9096
provides search results based on an initial proximity. When used as a standlone component, the `proximity` property
9197
with provided `latitude` and `longitude` properties is required.
9298

9399
<Fragment platforms={['react']}>
94-
{({ platform }) => import(`./fragments/standalone-geocoder.${platform}.mdx`)}
100+
{({ platform }) =>
101+
import(`./fragments/location-search-standalone.${platform}.mdx`)
102+
}
95103
</Fragment>

examples/next/pages/ui/components/geo/map-with-geocoder/aws-exports.js renamed to examples/next/pages/ui/components/geo/map-with-location-search/aws-exports.js

File renamed without changes.

examples/next/pages/ui/components/geo/map-with-geocoder/index.page.tsx renamed to examples/next/pages/ui/components/geo/map-with-location-search/index.page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MapView, Geocoder } from '@aws-amplify/ui-react';
1+
import { MapView, LocationSearch } from '@aws-amplify/ui-react';
22
import { Amplify } from 'aws-amplify';
33

44
import '@aws-amplify/ui-react/styles.css';
@@ -7,10 +7,10 @@ import awsExports from './aws-exports';
77

88
Amplify.configure(awsExports);
99

10-
export default function MapWithGeocoder() {
10+
export default function MapWithLocationSearch() {
1111
return (
1212
<MapView>
13-
<Geocoder />
13+
<LocationSearch />
1414
</MapView>
1515
);
1616
}

examples/next/pages/ui/components/geo/standalone-geocoder/aws-exports.js renamed to examples/next/pages/ui/components/geo/standalone-location-search/aws-exports.js

File renamed without changes.

examples/next/pages/ui/components/geo/standalone-geocoder/index.page.tsx renamed to examples/next/pages/ui/components/geo/standalone-location-search/index.page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Geocoder } from '@aws-amplify/ui-react';
1+
import { LocationSearch } from '@aws-amplify/ui-react';
22
import { Amplify } from 'aws-amplify';
33

44
import '@aws-amplify/ui-react/styles.css';
@@ -12,6 +12,6 @@ const SAN_FRANCISCO = {
1212
longitude: -122.431,
1313
};
1414

15-
export default function StandaloneGeocoder() {
16-
return <Geocoder proximity={SAN_FRANCISCO} />;
15+
export default function StandaloneLocationSearch() {
16+
return <LocationSearch proximity={SAN_FRANCISCO} />;
1717
}

packages/e2e/cypress/integration/ui/components/geo/map-with-geocoder/map-with-geocoder.steps.ts renamed to packages/e2e/cypress/integration/ui/components/geo/map-with-location-search/map-with-location-search.steps.ts

File renamed without changes.

0 commit comments

Comments
 (0)