diff --git a/guide/src/web-getting-started.md b/guide/src/web-getting-started.md index a446fb27d..860cee70e 100644 --- a/guide/src/web-getting-started.md +++ b/guide/src/web-getting-started.md @@ -3,7 +3,7 @@ This section of the guide covers how to integrate Ferrostar into a web app. While there are limitations to the web [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API) (notably no background updates), -PWAs and other mobile-optimized sites +**Progressive Web Apps (PWAs)** and other mobile-optimized sites can be a great solution when a native iOS/Android app is impractical or prohibitively expensive. We'll cover the "batteries included" approach, but flag areas for customization and overrides along the way. @@ -33,7 +33,7 @@ Then add `wasm()` and `topLevelAwait()` to the `plugins` section of your Vite co TODO -## Add Ferrostar web components to your web app +## Add Ferrostar web components to your Web App The Ferrostar web SDK uses the [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) to ensure maximum compatibility across frontend frameworks. @@ -43,35 +43,57 @@ You can import the components just like other things you’re used to in JavaScr import { FerrostarMap, BrowserLocationProvider } from "@stadiamaps/ferrostar-components"; ``` -## Configure the `` component +## Configure the Component -Now you can use Ferrostar in your HTML like this: +Now you can use Ferrostar in your web component like this: -```html +## HTML + +``` ``` -Here we have used Stadia Maps URLs, which should work without authentication for local development. -(Refer to the [authentication docs](https://docs.stadiamaps.com/authentication/) -for network deployment details; you can start with a free account.) +## React + +```javascript +import React from 'react'; +import { FerrostarMap } from "@stadiamaps/ferrostar-webcomponents"; + +const MyMapComponent = () => { +return ( + +); +}; + +export default MyMapComponent; +``` + +--- -See the [vendors appendix](./vendors.md) for a list of other compatible vendors. +## CSS Requirements -`` additionally requires setting some CSS manually, or it will be invisible! +The `` component requires setting some CSS manually; otherwise, it will be invisible! ```css ferrostar-map { - display: block; - width: 100%; - height: 100%; +display: block; +width: 100%; +height: 100%; } ``` +--- + That’s all you need to get started! ### Configuration explained