Skip to content

Commit

Permalink
docs: update wording based on Google recommendation (#361)
Browse files Browse the repository at this point in the history
- use 'Maps JavaScript API' or 'Google Maps JavaScript API' instead of 'Google Maps API' or other forms
 - use 'Google map(s)' when referring to maps in general
 - update some other brand related wordings
  • Loading branch information
usefulthink committed May 11, 2024
1 parent 5ad5e98 commit ca95431
Show file tree
Hide file tree
Showing 44 changed files with 128 additions and 109 deletions.
12 changes: 8 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: Something does not work as expected
title: '[Bug]'
labels: bug
labels: [bug]
body:
- type: markdown
attributes:
Expand All @@ -11,7 +11,7 @@ body:
Before reporting, please verify that you are using the latest version of the `@vis.gl/react-google-maps` library.
You may find answers faster by searching in [the documentation](https://visgl.github.io/react-google-maps/search) and [existing issues](https://github.com/visgl/react-google-maps/issue).
If you are unsure whether it is a bug in your own implementation or the library itself, consider starting a conversation in [Discussions](https://github.com/visgl/react-map-gl/discussions) instead.
If you are unsure whether it is a bug in your own implementation or the library itself, consider starting a conversation in [Discussions](https://github.com/visgl/react-google-maps/discussions) instead.
- type: textarea
attributes:
label: Description
Expand All @@ -38,7 +38,7 @@ body:
Example:
- **Library version**: @vis.gl/react-google-maps@1.0.0
- **Google maps version**: weekly (whatever is passed to the `version`
- **Google Maps JavaScript API version**: weekly (whatever is passed to the `version`
prop of the APIProvider, default is 'weekly', ideally including the
value of `google.maps.version`)
- **Browser and Version**: Chrome 119.0
Expand All @@ -54,7 +54,11 @@ body:
- type: textarea
attributes:
label: Logs
description: Please check the browser console for any relevant errors or warnings and post them here.
description: |
Please check the browser console for any relevant errors or warnings and post them here.
**Important**: stack traces can sometimes include your API-key as part of the script URLs,
make sure to remove or replace them before submitting.
render: text
validations:
required: false
65 changes: 41 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
> [!IMPORTANT]
> This project is still in its alpha phase.
>
> When using it be aware that things may not yet work as expected and can
> break at any point. Releases happen often, so when you experience problems,
> make sure you are using the latest version (check with `npm outdated` in
> your project) before opening an issue.
>
> We are still in a phase where we can easily make bigger changes, so we ask
> you to please [provide feedback](https://github.com/visgl/react-google-maps/issues/new)
> on everything you notice - including, but not limited to
>
> - developer experience (installation, typings, sourcemaps, framework integration, ...)
> - hard to understand concepts and APIs
> - wrong, missing, outdated or inaccurate documentation
> - use-cases not covered by the API
> - missing features
> - and of course any bugs you encounter
>
> Also, feel free to use [GitHub discussions](https://github.com/visgl/react-google-maps/discussions) to ask questions or start a new
> discussion.
# React Components for the Google Maps JavaScript API

[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/visgl/react-google-maps/tree/main/LICENSE)
Expand Down Expand Up @@ -50,7 +28,7 @@ package name has to be quoted)_
## Usage

Import the [`APIProvider`][api-provider] and wrap it around all components that should have
access to the Google Maps API.
access to the Maps JavaScript API.
Any component within the context of the `APIProvider` can use the hooks and
components provided by this library.

Expand Down Expand Up @@ -120,7 +98,7 @@ const MyComponent = () => {

const App = () => {
return (
<APIProvider apiKey={...}>
<APIProvider apiKey={'YOUR API KEY HERE'}>
<MyComponent />
</APIProvider>
);
Expand All @@ -132,6 +110,35 @@ const App = () => {
Explore our [examples directory on GitHub](./examples) or the
[examples on our website][examples] for full implementation examples.

## Terms of Service

`@vis.gl/react-google-maps` uses Google Maps Platform services. Use of Google
Maps Platform services through this library is subject to the
[Google Maps Platform Terms of Service][gmp-tos].

This library is not a Google Maps Platform Core Service.
Therefore, the Google Maps Platform Terms of Service (e.g., Technical
Support Services, Service Level Agreements, and Deprecation Policy)
do not apply to this library.

## Support

This library is offered via an open source license. It is not governed by the
Google Maps Platform [Support Technical Support Services Guidelines][gmp-tssg],
the [SLA][gmp-sla], or the [Deprecation Policy][gmp-dp] (however, any Google
Maps Platform services used by this library remain subject to the Google Maps
Platform Terms of Service).

If you find a bug, or have a feature request, please [file an issue][rgm-issues]
on GitHub. If you would like to get answers to technical questions from
other Google Maps Platform developers, feel free to open a thread in the
[discussions section on GitHub][rgm-discuss] or ask a question through one of
our [developer community channels][gmp-community].

If you'd like to contribute, please check the [Contributing guide][rgm-contrib].

You can also discuss this library on [our Discord server][gmp-discord].

[api-provider]: https://visgl.github.io/react-google-maps/docs/api-reference/components/api-provider
[api-map]: https://visgl.github.io/react-google-maps/docs/api-reference/components/map
[api-marker]: https://visgl.github.io/react-google-maps/docs/api-reference/components/marker
Expand All @@ -143,3 +150,13 @@ Explore our [examples directory on GitHub](./examples) or the
[gmp-services]: https://developers.google.com/maps/documentation/javascript#services
[gmp-libraries]: https://developers.google.com/maps/documentation/javascript/libraries
[npm-package]: https://www.npmjs.com/package/@vis.gl/react-google-maps
[gmp-tos]: https://cloud.google.com/maps-platform/terms
[gmp-tssg]: https://cloud.google.com/maps-platform/terms/tssg
[gmp-sla]: https://cloud.google.com/maps-platform/terms/sla
[gmp-dp]: https://cloud.google.com/maps-platform/terms/other/deprecation-policy
[rgm-issues]: https://github.com/visgl/react-google-maps/issues
[rgm-discuss]: https://github.com/visgl/react-google-maps/discussions
[rgm-contrib]: https://visgl.github.io/react-google-maps/docs/contributing
[gmp-community]: https://developers.google.com/maps/developer-community
[gmp-discord]: https://discord.gg/f4hvx8Rp2q

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ to the map and any other component.
Ultimately, in the spirit of the [reactive programming paradigm][wiki-reactive]
used in React, data from this single source of truth should
always flow down the component hierarchy. If components manage their own
state, as Google Maps is designed to do, we risk the components going out of
state, as Google maps are designed to do, we risk the components going out of
sync.

`@vis.gl/react-google-maps` provides a reactive wrapper for the Google Maps
Expand Down
6 changes: 3 additions & 3 deletions docs/api-reference/components/api-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ components and hooks of this library.
It can be added at any level of the application (typically somewhere
at the top of your component-tree), and it will render all child components
unmodified. A re-render is only triggered once the loading status of the
Google Maps API changes.
Maps JavaScript API changes.

Normally, there should only be a single instance of the APIProvider in a page,
but there are situations (e.g., multiple React render-roots in a page) where
this isn't possible. In those cases, make sure to create all `APIProvider`
components using the exact same props, since only the first one to
render will actually load the maps API.

When the Google Maps API has already been loaded externally
When the Maps JavaScript API has already been loaded externally
(i.e., the [`google.maps.importLibrary`][gmp-import-library] function exists),
the
`APIProvider` will ignore all specified props and use the existing
Expand All @@ -33,7 +33,7 @@ first render will in most cases have no effect, cause an error, or both.

## Usage

The `APIProvider` only needs the [Google Maps API Key][gmp-api-keys] to function.
The `APIProvider` only needs the [Google Maps Platform API Key][gmp-api-keys] to function.
This has to be provided via the `apiKey` prop:

```tsx
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/components/info-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ InfoWindow.
:::note

The rendered InfoWindow includes a close-button that can't be removed or
controlled via the Google Maps API. This means that the application can't
controlled via the Maps JavaScript API. This means that the application can't
fully control the visibility of the InfoWindow.

To keep your state in sync with the map, you have to provide a listener for the
Expand Down
14 changes: 7 additions & 7 deletions docs/api-reference/components/map.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `<Map>` Component

React component to render a [Google Map][gmp-map]. It can be placed as a child
React component to render a [Google map][gmp-map]. It can be placed as a child
into any other component, but it has to be somewhere inside an
[`<APIProvider>`][api-provider] container.

Expand Down Expand Up @@ -104,7 +104,7 @@ If you experience any problems using this feature, please file a
## Props

The `MapProps` type extends the [`google.maps.MapOptions` interface][gmp-map-options]
and includes all possible options available for a Google Map as props.
and includes all possible options available for a Google map as props.

The most important of these options are also listed below along with the
properties added for the react-library.
Expand Down Expand Up @@ -189,7 +189,7 @@ is approximately:
- `15`: Streets
- `20`: Buildings

The Google Maps API Documentation [has some more information on this topic][gmp-coordinates].
The Maps JavaScript API Documentation [has some more information on this topic][gmp-coordinates].

#### `heading`: number

Expand Down Expand Up @@ -239,14 +239,14 @@ const MapWithEventHandler = props => {
};
```

See [the table below](#mapping-of-google-maps-event-names-to-react-props)
See [the table below](#mapping-of-maps-javascript-api-event-names-to-react-props)
for the full list of events and corresponding prop names.

All event callbacks receive a single argument of type `MapEvent` with the
following properties and methods:

- **`event.type`: string** The Google Maps event type of the event.
- **`event.map`: google.maps.Map** The Map instance that dispatched the event.
- **`event.type`: string** The event type of the event from the Maps JavaScript API.
- **`event.map`: google.maps.Map** The map instance that dispatched the event.
- **`event.stoppable`: boolean** Indicates if the event can be stopped in
the event-handler. This is only the case for the `MapMouseEvent` type.
- **`event.stop()`: () => void** for stoppable events, this will cause the
Expand All @@ -270,7 +270,7 @@ Based on the specific event, there is also additional information in the
- **`placeId`: string | null** when a place marker on the map is clicked,
this will contain the placeId of the Google Places API for that place.

#### Mapping of Google Maps Event names to React props
#### Mapping of Maps JavaScript API Event names to React props

| Google Maps Event | React Prop | Event Type |
| --------------------------------- | --------------------------------------- | ----------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/components/marker.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default App;

## Props

The MarkerProps interface extends the [google.maps.MarkerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions) and includes all possible options available for a Google Maps Platform Marker. Additionally, it is possible to add different event listeners, e.g. the click event with the `onClick` property.
The MarkerProps interface extends the [google.maps.MarkerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions) and includes all possible options available for a Maps JavaScript API Marker. Additionally, it is possible to add different event listeners, e.g. the click event with the `onClick` property.

```tsx
interface MarkerProps extends google.maps.MarkerOptions {
Expand Down
1 change: 0 additions & 1 deletion docs/api-reference/hooks/use-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const MyComponent = () => {

// do something with the map instance
}, [map]);
// Do something with the Google Maps map instance

return <>...</>;
};
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/hooks/use-maps-library.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `useMapsLibrary` Hook

React hook to get access to the different [Google Maps API libraries][gmp-libraries].
React hook to get access to the different [Maps JavaScript API libraries][gmp-libraries].
This is essentially a react-version of the `google.maps.importLibrary` function.

```tsx
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ carefully.

The focus will be on providing an extensible library of **"low-level"
abstractions** that can be used to implement known and unknown use-cases of
the Google Maps API in a React application.
the Google Maps JavaScript API in a React application.

In a lot of cases – especially when a solution needs to have a lot of
flexibility (implementing an Autocomplete component for example) and room
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/deckgl-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following props need to be defined and passed to the DeckGL component:
- `onViewStateChange`

Make sure that the controller is always set to true and an initial view state is defined. To ensure that deck.gl works
well with the Google Maps Platform map, set the `limitTiltRange` function, which can be imported from the Google Maps React
well with the Google map, set the `limitTiltRange` function, which can be imported from `@vis.gl/react-gogle-maps`
library, to `onViewStateChange`.

```tsx
Expand Down
12 changes: 6 additions & 6 deletions docs/guides/interacting-with-google-maps-api.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Interacting with the Google Maps API
# Interacting with the Google Maps JavaScript API

With the provided components, you are able to declaratively create a
[Google Map](../api-reference/components/map.md) or a map with
[Google map](../api-reference/components/map.md) or a map with
[markers](../api-reference/components/marker.md) for example.

Besides that, there are three main ways and concepts to interact
with the Google Maps API on lower level with this library.
with the Maps JavaScript API on lower level with this library.
You can use the provided hooks, the refs that are available for
some components or use the
[`useMapsLibrary`](../api-reference/hooks/use-maps-library.md) hook
to tap into other libraries and services of the Google Maps API or
to tap into other libraries and services of the Maps JavaScript API or
craft your own custom hooks.

## Hooks
Expand Down Expand Up @@ -47,7 +47,7 @@ const App = () => (
```

The [useMapsLibrary](../api-reference/hooks/use-maps-library.md) hook can be
utilized to load other parts of the Google Maps API that are not loaded by default.
utilized to load other parts of the Maps JavaScript API that are not loaded by default.
For example, the Places Service or the Geocoding Service.
[Learn how to use this hook.](#other-google-maps-api-libraries-and-services)

Expand Down Expand Up @@ -92,7 +92,7 @@ const App = () => {
export default App;
```

## Other Google Maps API libraries and services
## Other Maps JavaScript API libraries and services

The Maps JavaScript API has a lot of [additional libraries](https://developers.google.com/maps/documentation/javascript/libraries)
for things like geocoding, routing, the Places API, Street View, and
Expand Down
6 changes: 2 additions & 4 deletions examples/_template/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Basic Google Maps Setup Example

![image](https://user-images.githubusercontent.com/39244966/208682692-d5b23518-9e51-4a87-8121-29f71e41c777.png)
# Example

This is an example to show how to setup a simple Google Maps Map with the `<Map/>` component of the Google Maps React
library.

## Google Maps API key
## Google Maps Platform API key

This example does not come with an API key. Running the examples locally requires a valid API key for the Google Maps Platform.
See [the official documentation][get-api-key] on how to create and configure your own key.
Expand Down
6 changes: 3 additions & 3 deletions examples/autocomplete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Here you can find a few example implementations of the autocomplete functionalit

We have three different implementations to demonstrate how to add autocomplete functionality to your application

### 1) Google Maps Autocomplete Widget
### 1) Maps JavaScript API Autocomplete Widget

When using the [Google Maps Autocomplete widget][autocomplete-widget] you provide an HTML input element of your choice and Google handles all the rest. It will fetch predictions when the user types and it will get the details for a place when the user selects a prediction from the list.
When using the [Autocomplete widget][autocomplete-widget] you provide an HTML input element of your choice and Google handles all the rest. It will fetch predictions when the user types and it will get the details for a place when the user selects a prediction from the list.

### 2) Custom Build

Expand All @@ -20,7 +20,7 @@ When building your own you are completely free but also responsible for the user

This is basically the same as the custom build, except for not having to implement the list/dropdown/DOM handling yourself. A lot of third party text box widgets provide functionionality for handling keyboard navigation and focus handling. For the demo we used the [Combobox][combobox] from `react-widgets`.

## Google Maps API key
## Google Maps Platform API Key

This example does not come with an API key. Running the examples locally requires a valid API key for the Google Maps Platform.
See [the official documentation][get-api-key] on how to create and configure your own key. For this example to work you also need to enable the `Places API` in your Google Cloud Console.
Expand Down
2 changes: 1 addition & 1 deletion examples/autocomplete/src/autocomplete-alpha.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// NOTE: This requires the alpha version of the Google Maps API and is not yet
// NOTE: This requires the alpha version of the Maps JavaScript API and is not yet
// recommended to be used in production applications. We will add this to the example map
// when it reaches GA (General Availability). Treat this as a preview of what's to come.

Expand Down
2 changes: 1 addition & 1 deletion examples/autocomplete/src/control-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function ControlPanel({

<p>
This example demonstrates three different methods of adding autocomplete
functionality to your appplication using the Google Maps Places API.
functionality to your appplication using the Google Places API.
</p>

<div className="autocomplete-mode">
Expand Down
7 changes: 3 additions & 4 deletions examples/basic-map/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Basic Google Maps Setup Example
# Basic Map Setup Example

![image](https://user-images.githubusercontent.com/39244966/208682692-d5b23518-9e51-4a87-8121-29f71e41c777.png)

This is an example to show how to setup a simple Google Maps Map with the `<Map/>` component of the Google Maps React
library.
This is an example to show how to setup a simple Google map with the `<Map/>` component.

## Google Maps API key
## Google Maps Platform API Key

This example does not come with an API key. Running the examples locally requires a valid API key for the Google Maps Platform.
See [the official documentation][get-api-key] on how to create and configure your own key.
Expand Down
6 changes: 2 additions & 4 deletions examples/basic-map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Basic Google Maps Map Component Example</title>
<meta
name="description"
content="Basic Google Maps Map Component Example" />
<title>Basic Map Component Example</title>
<meta name="description" content="Basic Map Component Example" />
<style>
body {
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/change-map-styles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is an example to demonstrate changing the style of the `<Map/>` component using local and cloud-based map styles as well as map types.

## Google Maps API key
## Google Maps Platform API Key

This example does not come with an API key. Running the examples locally requires a valid API key for the Google Maps Platform.
See [the official documentation][get-api-key] on how to create and configure your own key.
Expand Down
Loading

1 comment on commit ca95431

@Mitpf
Copy link

@Mitpf Mitpf commented on ca95431 Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for Directions example may be is good to add some style in the Map elment style={{ width: '80vw', height: '50vh' }}, otherwise is possible not rendering of map

Please sign in to comment.