Quickstart
Flutter Quickstart
Get started with our Static Maps Flutter SDK
Generate API Key
Journey Static Maps is currently in private beta. To get started, create an account in our dashboard and generate an API key to use in your application.
Get Started
Configure the SDK
To get started, first install the package:
dart pub add static_map
Then, initialize the SDK with your API key. You can do this in your main
function:
lib/main.dart
import 'package:static_map/static_map.dart';
void main() {
// Initialize the SDK with your API key
StaticMap.initialize(apiKey: '12345678');
runApp(MyApp());
}
Generate a Static Map
To generate a static map, use the StaticMapImage
widget. You can customize the map by passing in various parameters, such as the center, zoom level, markers, and paths.
StaticMapImage(
options: StaticMapOptions(
width: 300,
height: 300,
padding: 40,
scale: 2,
overlays: [
const StaticMapPath(
polyline: '}rueFf~ejVxGw@f@pH~`@wEqCqb@',
),
],
),
);
The code above will generate the following static map: