Skip to content

Commit

Permalink
Add appropriate MapBox attributions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bramp committed Sep 27, 2023
1 parent 11557dc commit 10315eb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
Binary file added example/assets/mapbox-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 45 additions & 1 deletion example/lib/pages/retina.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_map_example/widgets/drawer.dart';
import 'package:latlong2/latlong.dart';
import 'package:url_launcher/url_launcher.dart';

class RetinaPage extends StatefulWidget {
static const String route = '/retina';
Expand Down Expand Up @@ -72,7 +73,50 @@ class _RetinaPageState extends State<RetinaPage> {
initialCenter: LatLng(51.5, -0.09),
initialZoom: 5,
),
nonRotatedChildren: const [],
nonRotatedChildren: [
Align(
alignment: Alignment.bottomLeft,
child: LogoSourceAttribution(
Image.asset("assets/mapbox-logo-white.png"),
height: 16,
),
),
Align(
alignment: Alignment.bottomRight,
child: DefaultTextStyle(
style: const TextStyle(color: Colors.white),
child: Padding(
padding: const EdgeInsets.all(6),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextSourceAttribution(
'Mapbox',
onTap: () => launchUrl(Uri.parse(
'https://www.mapbox.com/about/maps/')),
),
const SizedBox(width: 10),
TextSourceAttribution(
'OpenStreetMap',
onTap: () => launchUrl(Uri.parse(
'https://www.openstreetmap.org/copyright')),
),
const SizedBox(width: 10),
TextSourceAttribution(
'Improve this map',
prependCopyright: false,
onTap: () => launchUrl(
// TODO This URL can end in #/-74.5/40/10 to specify
// the location. Make this change automagically.
Uri.parse(
'https://www.mapbox.com/map-feedback/')),
),
],
),
),
),
),
],
children: [
TileLayer(
tileSize: tileSize,
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ flutter:
- assets/map/anholt_osmbright/14/8726/
- assets/map/anholt_osmbright/14/8727/
- assets/map/epsg3413/amsr2.png
- assets/mapbox-logo-white.png
- assets/

0 comments on commit 10315eb

Please sign in to comment.